Account for impl Trait {
when impl Trait for Type {
was intended by estebank · Pull Request #131273 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation8 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
On editions where bare traits are never allowed, detect if the user has written impl Trait
with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type:
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/missing-for-type-in-impl.rs:8:6
|
LL | impl Foo<i64> {
| ^^^^^^^^
|
help: add `dyn` keyword before this trait
|
LL | impl dyn Foo<i64> {
| +++
help: you might have intended to implement this trait for a given type
|
LL | impl Foo<i64> for /* Type */ {
| ++++++++++++++
CC #131051.
On editions where bare traits are never allowed, detect if the user has
written impl Trait
with no type, silence any dyn-compatibility errors,
and provide a structured suggestion for the potentially missing type:
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/missing-for-type-in-impl.rs:8:6
|
LL | impl Foo<i64> {
| ^^^^^^^^
|
help: add `dyn` keyword before this trait
|
LL | impl dyn Foo<i64> {
| +++
help: you might have intended to implement this trait for a given type
|
LL | impl Foo<i64> for /* Type */ {
| ++++++++++++++
r? @Nadrieril
rustbot has assigned @Nadrieril.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
HIR ty lowering was modified
cc @fmease
📌 Commit e057c43 has been approved by compiler-errors
It is now in the queue for this repository.
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
…kingjubilee
Rollup of 9 pull requests
Successful merges:
- rust-lang#129517 (Compute array length from type for unconditional panic lint. )
- rust-lang#130367 (Check elaborated projections from dyn don't mention unconstrained late bound lifetimes)
- rust-lang#130403 (Stabilize
const_slice_from_raw_parts_mut
) - rust-lang#130633 (Add support for reborrowing pinned method receivers)
- rust-lang#131105 (update
Literal
's intro) - rust-lang#131194 (Fix needless_lifetimes in stable_mir)
- rust-lang#131260 (rustdoc: cleaner errors on disambiguator/namespace mismatches)
- rust-lang#131267 (Stabilize
BufRead::skip_until
) - rust-lang#131273 (Account for
impl Trait {
whenimpl Trait for Type {
was intended)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#131273 - estebank:issue-131051, r=compiler-errors
Account for impl Trait {
when impl Trait for Type {
was intended
On editions where bare traits are never allowed, detect if the user has written impl Trait
with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type:
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/missing-for-type-in-impl.rs:8:6
|
LL | impl Foo<i64> {
| ^^^^^^^^
|
help: add `dyn` keyword before this trait
|
LL | impl dyn Foo<i64> {
| +++
help: you might have intended to implement this trait for a given type
|
LL | impl Foo<i64> for /* Type */ {
| ++++++++++++++
CC rust-lang#131051.
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.