-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove some dead or leftover code related to rustc-intrinsic abi removal #139530
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 |
---|---|---|
|
@@ -719,7 +719,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) { | |
def_id, | ||
tcx.def_ident_span(def_id).unwrap(), | ||
i.name, | ||
ExternAbi::Rust, | ||
) | ||
} | ||
} | ||
|
@@ -787,16 +786,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) { | |
for item in items { | ||
let def_id = item.id.owner_id.def_id; | ||
|
||
if tcx.has_attr(def_id, sym::rustc_intrinsic) { | ||
intrinsic::check_intrinsic_type( | ||
tcx, | ||
item.id.owner_id.def_id, | ||
item.span, | ||
item.ident.name, | ||
abi, | ||
); | ||
} | ||
Comment on lines
-790
to
-798
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. So this was for So yeah I agree with removing this.^^ 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. I think it was just something I overlooked in the transition PR where an ABI check was turned into an attr check. Not explicitly added for the attr |
||
|
||
let generics = tcx.generics_of(def_id); | ||
let own_counts = generics.own_counts(); | ||
if generics.own_params.len() - own_counts.lifetimes != 0 { | ||
|
This file was deleted.
This file was deleted.
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.
Please don't remove it but instead add a comment after with
// REMOVED: explanation
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.
Dealing with no-longer emitted error codes is a pain. Some time ago, I added some comments at the top of this file to explain what one has to do (which I had to figure out by trial and error as nothing seemed documented). Not sure how to make this more visible.
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.
Agreed but
--explain
is still supposed to work. ^^'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.
Wouldn't it make sense to keep this error for misused
#[rustc_intrinsic]
?Currently that annotation appears to be silently ignored (or ICE) when misapplied playground
For this reason I hadn't removed the check motioned in #139530 (comment)
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.
This is an internal attribute, having it ICE is entirely fine.
Having it silently ignored is a bit unfortunate; not sure if there's an ways way to avoid that -- probably only after the attribute refactor (Cc @jdonszelmann )
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.
Currently,
rustc_*
attributes are excluded from the "must have logic to check whether they are used in the correct place" rule. Some have impls regardless, but most do not.