Skip to content

Commit b3a328e

Browse files
committed
Use nominal_obligations_without_const in wf for FnDef
1 parent 85f4f41 commit b3a328e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_trait_selection/src/traits/wf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'tcx> WfPredicates<'tcx> {
547547
}
548548

549549
ty::FnDef(did, substs) => {
550-
let obligations = self.nominal_obligations(did, substs);
550+
let obligations = self.nominal_obligations_without_const(did, substs);
551551
self.out.extend(obligations);
552552
}
553553

src/test/ui/consts/issue-104155.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// check-pass
2+
const _: () = core::mem::forget(Box::<u32>::default);
3+
const _: () = core::mem::forget(|| Box::<u32>::default());
4+
5+
fn main() {}

0 commit comments

Comments
 (0)