diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2022-11-09 02:08:22 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2022-11-09 02:08:22 +0000 |
| commit | b3a328eecf539be2267b1373f8637f7d31cd6162 (patch) | |
| tree | 05cb2e83fec28656ce64c5df6e2b512fecb57111 | |
| parent | 85f4f41deb1557ca8ab228319d33003dd2f20f45 (diff) | |
| download | rust-b3a328eecf539be2267b1373f8637f7d31cd6162.tar.gz rust-b3a328eecf539be2267b1373f8637f7d31cd6162.zip | |
Use `nominal_obligations_without_const` in wf for FnDef
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/wf.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/consts/issue-104155.rs | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index 8908fe230b0..fc0a9f69003 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -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); } diff --git a/src/test/ui/consts/issue-104155.rs b/src/test/ui/consts/issue-104155.rs new file mode 100644 index 00000000000..1cc8f81b0d2 --- /dev/null +++ b/src/test/ui/consts/issue-104155.rs @@ -0,0 +1,5 @@ +// check-pass +const _: () = core::mem::forget(Box::<u32>::default); +const _: () = core::mem::forget(|| Box::<u32>::default()); + +fn main() {} |
