1
Fork 0

Stop using Interner in the compiler randomly

This commit is contained in:
Michael Goulet 2025-03-26 04:10:00 +00:00
parent 14804d1ed1
commit 5f1e36f8ad
2 changed files with 7 additions and 5 deletions

View file

@ -16,7 +16,7 @@ use rustc_infer::traits::{Obligation, PolyTraitObligation, SelectionError};
use rustc_middle::ty::fast_reject::DeepRejectCtxt;
use rustc_middle::ty::{self, Ty, TypeVisitableExt, TypingMode};
use rustc_middle::{bug, span_bug};
use rustc_type_ir::{Interner, elaborate};
use rustc_type_ir::elaborate;
use tracing::{debug, instrument, trace};
use super::SelectionCandidate::*;
@ -802,7 +802,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
| ty::UnsafeBinder(_) => {
// Only consider auto impls of unsafe traits when there are
// no unsafe fields.
if self.tcx().trait_is_unsafe(def_id) && self_ty.has_unsafe_fields() {
if self.tcx().trait_def(def_id).safety.is_unsafe()
&& self_ty.has_unsafe_fields()
{
return;
}