-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Uplift trait ref is knowable into rustc_next_trait_solver
#127437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -524,6 +524,10 @@ impl<'tcx> Interner for TyCtxt<'tcx> { | |
self.is_object_safe(trait_def_id) | ||
} | ||
|
||
fn trait_is_fundamental(self, def_id: DefId) -> bool { | ||
self.trait_def(def_id).is_fundamental | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we instead uplift There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems really annoying, and also ties rustc's internal repr of things to the type system. I don't think I want to do this. |
||
} | ||
|
||
fn trait_may_be_implemented_via_object(self, trait_def_id: DefId) -> bool { | ||
self.trait_def(trait_def_id).implement_via_object | ||
} | ||
|
@@ -635,6 +639,10 @@ bidirectional_lang_item_map! { | |
} | ||
|
||
impl<'tcx> rustc_type_ir::inherent::DefId<TyCtxt<'tcx>> for DefId { | ||
fn is_local(self) -> bool { | ||
self.is_local() | ||
} | ||
|
||
fn as_local(self) -> Option<LocalDefId> { | ||
self.as_local() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change the builtin attr to be
only_local
if it isn't already?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. This isn't possible without changing the way
AdtKind
serialization works. When we deserialize an ADT, we actually callhas_attr
on it, since we recreate itsAdtFlags
from scratch. Changing this is pretty involved and includes serializingAdtFlags
directly.