Skip to content

Commit d22c433

Browse files
committed
Auto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obk
Use `nominal_obligations_without_const` in wf for FnDef Fixes #104155.
2 parents 91385d5 + b3a328e commit d22c433

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)