Skip to content
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

Merged
merged 1 commit into from
Oct 29, 2022
Merged

Conversation

compiler-errors
Copy link
Member

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

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 22, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 22, 2022

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 22, 2022
@compiler-errors compiler-errors added the F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` label Oct 22, 2022
_ 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",
Copy link
Contributor

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?

Copy link
Member Author

@compiler-errors compiler-errors Oct 22, 2022

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?

Copy link
Contributor

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

@oli-obk
Copy link
Contributor

oli-obk commented Oct 28, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 28, 2022

📌 Commit 4accf83 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 28, 2022
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`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 28, 2022
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``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 29, 2022
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`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 29, 2022
…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
@bors bors merged commit 790a716 into rust-lang:master Oct 29, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 29, 2022
@compiler-errors compiler-errors deleted the tait-scope branch November 2, 2022 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants