1
Fork 0

Use derive_const and rm manual StructuralEq impl

This commit is contained in:
Deadbeef 2022-11-12 12:57:10 +00:00
parent 5f4e73c4a4
commit 4b217e4624
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