-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Note scope of TAIT more accurately #103383
Conversation
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
_ if scope == hir::CRATE_HIR_ID => "module", | ||
Node::Item(hir::Item { kind: hir::ItemKind::Mod(_), .. }) => "module", | ||
Node::Item(hir::Item { kind: hir::ItemKind::Impl(_), .. }) => "impl", | ||
_ => "item", |
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.
Not sure how to test this. Of would require mentioning the TAIT outside of a function body where it's defined. Maybe span_bug it?
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.
Are you talking about the "item"
arm specifically? This is an example of where it would now print "item"
:
#![feature(type_alias_impl_trait)]
fn foo() {
type Tait = impl Sized;
}
I guess I could make it specifically match a few more cases where we are allowed by the grammar to place TAITs like function bodies, and then span_bug
the rest?
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.
Right... it maybe useful to special case all of these (e.g. the crate root mentioning the same crate (can we even get that error?))
But this is already correct now, so let's merge it
@bors r+ rollup |
Note scope of TAIT more accurately This maybe explains why the person was confused in rust-lang#101897, since we say "same module" but really should've said "same impl". r? `@oli-obk`
Note scope of TAIT more accurately This maybe explains why the person was confused in rust-lang#101897, since we say "same module" but really should've said "same impl". r? ``@oli-obk``
Note scope of TAIT more accurately This maybe explains why the person was confused in rust-lang#101897, since we say "same module" but really should've said "same impl". r? `@oli-obk`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#102961 (Make `CStr::from_ptr` `const`.) - rust-lang#103342 (Add test for issue 98634) - rust-lang#103383 (Note scope of TAIT more accurately) - rust-lang#103656 (Specialize ToString for Symbol) - rust-lang#103663 (rustdoc: remove redundant CSS/DOM `div.search-container`) - rust-lang#103664 (rustdoc-json-types: Improve ItemSummary::path docs) - rust-lang#103704 (Add a test for TAIT used with impl/dyn Trait inside RPIT) Failed merges: - rust-lang#103618 (Rename some `OwnerId` fields.) r? `@ghost` `@rustbot` modify labels: rollup
This maybe explains why the person was confused in #101897, since we say "same module" but really should've said "same impl".
r? @oli-obk