Skip to content

Impl trait diagnostic tweaks - #119703

Merged
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:impl-trait-tweaks
Jan 8, 2024
Merged

Impl trait diagnostic tweaks#119703
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:impl-trait-tweaks

Conversation

@compiler-errors

@compiler-errorscompiler-errors commented Jan 7, 2024

Copy link
Copy Markdown
Contributor
  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
Copy Markdown
Collaborator

r? @petrochenkov

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

@rustbotrustbot 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
Copy Markdown
ContributorAuthor

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

@rustbotrustbot assigned fmease and unassigned petrochenkovJan 7, 2024

@fmeasefmease left a comment

Copy link
Copy Markdown
Member

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

Comment threadtests/ui/impl-trait/where-allowed.rs
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

@fmeasefmeaseJan 7, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Jan 7, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 94de510 has been approved by fmease

It is now in the queue for this repository.

@borsbors 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
Copy Markdown
ContributorAuthor

wait i'll fix that variable binding nit

@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors r-

@borsbors 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
Copy Markdown
Member

ok ok :)

@fmease

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jan 7, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 7e38b70 has been approved by fmease

It is now in the queue for this repository.

@borsbors 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"
Fixesrust-lang#119629
@compiler-errorscompiler-errors changed the title Impl trait tweaksImpl trait diagnostic tweaksJan 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:masterJan 8, 2024
@rustbotrustbot 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"
Fixesrust-lang#119629
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@compiler-errors@rustbot@fmease@bors@petrochenkov