1
Fork 0

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`
This commit is contained in:
Matthias Krüger 2022-11-13 17:37:37 +01:00 committed by GitHub
commit eefea28dea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -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