diff options
| author | bors <bors@rust-lang.org> | 2022-09-22 04:22:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-22 04:22:24 +0000 |
| commit | 7a8636c843bd24038fe1d1f69b4a8e4b0ea55d4e (patch) | |
| tree | 242508adbaeccdb47f57c20a90717945a433130a /compiler/rustc_trait_selection/src | |
| parent | 626b02a8f97a9e35a647aa18fcdb67cbcb3b09c8 (diff) | |
| parent | 898c76cd8257ffd91e9de9714215ece477e1065b (diff) | |
| download | rust-7a8636c843bd24038fe1d1f69b4a8e4b0ea55d4e.tar.gz rust-7a8636c843bd24038fe1d1f69b4a8e4b0ea55d4e.zip | |
Auto merge of #100982 - fee1-dead-contrib:const-impl-requires-const-trait, r=oli-obk
Require `#[const_trait]` on `Trait` for `impl const Trait` r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/wf.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index 104a465a3b5..8da68c225d8 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -129,7 +129,7 @@ pub fn predicates_for_generics<'tcx>( move |(idx, (predicate, span))| Obligation { cause: cause(idx, span), recursion_depth: 0, - param_env: param_env, + param_env, predicate, }, ) diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index 5ea28fb47cf..9722b48a68a 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -392,7 +392,8 @@ impl<'tcx> WfPredicates<'tcx> { // `i32: Clone` // `i32: Copy` // ] - let obligations = self.nominal_obligations(data.item_def_id, data.substs); + // Projection types do not require const predicates. + let obligations = self.nominal_obligations_without_const(data.item_def_id, data.substs); self.out.extend(obligations); let tcx = self.tcx(); |
