+ ; sigs' <- renameSigs okHsBootSig sigs
+ ; return (ValBindsOut [] sigs', usesOnly (hsSigsFVs sigs')) }
+
+rnTopBindsSrc :: HsValBinds RdrName -> RnM (HsValBinds Name, DefUses)
+rnTopBindsSrc binds@(ValBindsIn mbinds _)
+ = do { (binds', dus) <- rnValBinds noTrim binds
+
+ -- Warn about missing signatures,
+ ; let { ValBindsOut _ sigs' = binds'
+ ; ty_sig_vars = mkNameSet [ unLoc n | L _ (TypeSig n _) <- sigs']
+ ; un_sigd_bndrs = duDefs dus `minusNameSet` ty_sig_vars }
+
+ ; warn_missing_sigs <- doptM Opt_WarnMissingSigs
+ ; ifM (warn_missing_sigs)
+ (mappM_ missingSigWarn (nameSetToList un_sigd_bndrs))
+
+ ; return (binds', dus)
+ }
+\end{code}
+
+
+
+%*********************************************************
+%* *
+ HsLocalBinds
+%* *
+%*********************************************************
+
+\begin{code}
+rnLocalBindsAndThen
+ :: HsLocalBinds RdrName
+ -> (HsLocalBinds Name -> RnM (result, FreeVars))
+ -> RnM (result, FreeVars)
+-- This version (a) assumes that the binding vars are not already in scope
+-- (b) removes the binders from the free vars of the thing inside
+-- The parser doesn't produce ThenBinds
+rnLocalBindsAndThen EmptyLocalBinds thing_inside
+ = thing_inside EmptyLocalBinds
+
+rnLocalBindsAndThen (HsValBinds val_binds) thing_inside
+ = rnValBindsAndThen val_binds $ \ val_binds' ->
+ thing_inside (HsValBinds val_binds')
+
+rnLocalBindsAndThen (HsIPBinds binds) thing_inside
+ = rnIPBinds binds `thenM` \ (binds',fv_binds) ->
+ thing_inside (HsIPBinds binds') `thenM` \ (thing, fvs_thing) ->
+ returnM (thing, fvs_thing `plusFV` fv_binds)
+
+-------------
+rnIPBinds (IPBinds ip_binds _no_dict_binds)
+ = do { (ip_binds', fvs_s) <- mapAndUnzipM (wrapLocFstM rnIPBind) ip_binds
+ ; return (IPBinds ip_binds' emptyLHsBinds, plusFVs fvs_s) }
+
+rnIPBind (IPBind n expr)
+ = newIPNameRn n `thenM` \ name ->
+ rnLExpr expr `thenM` \ (expr',fvExpr) ->
+ return (IPBind name expr', fvExpr)