Skip to content

Commit

Permalink
Auto merge of rust-lang#104180 - fee1-dead-contrib:fix-wf-fndef, r=ol…
Browse files Browse the repository at this point in the history
…i-obk

Use `nominal_obligations_without_const` in wf for FnDef

Fixes rust-lang#104155.
  • Loading branch information
bors committed Nov 9, 2022
2 parents 91385d5 + b3a328e commit d22c433
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ impl<'tcx> WfPredicates<'tcx> {
}

ty::FnDef(did, substs) => {
let obligations = self.nominal_obligations(did, substs);
let obligations = self.nominal_obligations_without_const(did, substs);
self.out.extend(obligations);
}

Expand Down
5 changes: 5 additions & 0 deletions src/test/ui/consts/issue-104155.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// check-pass
const _: () = core::mem::forget(Box::<u32>::default);
const _: () = core::mem::forget(|| Box::<u32>::default());

fn main() {}

0 comments on commit d22c433

Please sign in to comment.