diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-13 17:37:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-13 17:37:37 +0100 |
| commit | eefea28dea51fe55ebfb436743d60cd84c891c66 (patch) | |
| tree | 014e977e306c97a0c389f2997901ab354cf43ce6 /compiler/rustc_passes/src | |
| parent | 5c764da9b05cd78d0b89d5b4f7b6b401fc773571 (diff) | |
| parent | 4b217e462401a73466cc645cd30f3f9e7d3c218e (diff) | |
| download | rust-eefea28dea51fe55ebfb436743d60cd84c891c66.tar.gz rust-eefea28dea51fe55ebfb436743d60cd84c891c66.zip | |
Rollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk
Use `derive_const` and rm manual StructuralEq impl This does not change any semantics of the impl except for the const stability. It should be fine because trait methods and const bounds can never be used in stable without enabling `const_trait_impl`. cc `@oli-obk`
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 78afa2f25f8..af49d438a22 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -536,6 +536,14 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> { return; } + // if the const impl is derived using the `derive_const` attribute, + // then it would be "stable" at least for the impl. + // We gate usages of it using `feature(const_trait_impl)` anyways + // so there is no unstable leakage + if self.tcx.is_builtin_derive(def_id.to_def_id()) { + return; + } + let is_const = self.tcx.is_const_fn(def_id.to_def_id()) || self.tcx.is_const_trait_impl_raw(def_id.to_def_id()); let is_stable = self |
