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

Impl trait diagnostic tweaks #119703

Merged
merged 3 commits into from
Jan 8, 2024
Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 7, 2024

  1. Tweak some names for impl Trait being used in the wrong position
  2. Remove two helper functions that are no longer needed since RPITIT is stable, and which causes matches to be a bit obtuse.
  3. Split and fix the part where the error notes that it's "only allowed in XX"

Fixes #119629

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2024

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2024
@compiler-errors
Copy link
Member Author

r? fmease or feel free to reassign if you don't want to review it 😆

@rustbot rustbot assigned fmease and unassigned petrochenkov Jan 7, 2024
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, very nice! r=me with or without nits fixed

tests/ui/impl-trait/where-allowed.rs Show resolved Hide resolved
@@ -1,7 +1,7 @@
struct Bug {
V1: [(); {
let f: impl core::future::Future<Output = u8> = async { 1 };
//~^ `impl Trait` only allowed in function and inherent method argument and return types
//~^ `impl Trait` is not allowed in variable bindings
Copy link
Member

@fmease fmease Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in variable bindings is fine but in the type of variable bindings is better imo, not super important

@fmease
Copy link
Member

fmease commented Jan 7, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 7, 2024

📌 Commit 94de510 has been approved by fmease

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 Jan 7, 2024
@compiler-errors
Copy link
Member Author

wait i'll fix that variable binding nit

@compiler-errors
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 7, 2024
@fmease
Copy link
Member

fmease commented Jan 7, 2024

ok ok :)

@fmease
Copy link
Member

fmease commented Jan 7, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2024

📌 Commit 7e38b70 has been approved by fmease

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 7, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 7, 2024
… r=fmease

Impl trait tweaks

1. Tweak some names for `impl Trait` being used in the wrong position
2. Remove two helper functions that are no longer needed since RPITIT is stable, and which causes matches to be a bit obtuse.
3. Split and fix the part where the error notes that it's "only allowed in XX"

Fixes rust-lang#119629
@compiler-errors compiler-errors changed the title Impl trait tweaks Impl trait diagnostic tweaks Jan 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#116129 (Rewrite `pin` module documentation to clarify usage and invariants)
 - rust-lang#119702 (Miri subtree update)
 - rust-lang#119703 (Impl trait tweaks)
 - rust-lang#119705 (Support `~const` in associated functions in trait impls)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#116129 (Rewrite `pin` module documentation to clarify usage and invariants)
 - rust-lang#119703 (Impl trait diagnostic tweaks)
 - rust-lang#119705 (Support `~const` in associated functions in trait impls)
 - rust-lang#119708 (Unions are not `PointerLike`)
 - rust-lang#119711 (Delete unused makefile in tests/ui)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0207e24 into rust-lang:master Jan 8, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
Rollup merge of rust-lang#119703 - compiler-errors:impl-trait-tweaks, r=fmease

Impl trait diagnostic tweaks

1. Tweak some names for `impl Trait` being used in the wrong position
2. Remove two helper functions that are no longer needed since RPITIT is stable, and which causes matches to be a bit obtuse.
3. Split and fix the part where the error notes that it's "only allowed in XX"

Fixes rust-lang#119629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Error messages for where impl Trait is allowed do not account for return-position-impl-trait-in-trait (RPITIT)
5 participants