-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tweak errors for missing associated types and type parameters #67268
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr
Outdated
Show resolved
Hide resolved
--> $DIR/issue-28344.rs:4:17 | ||
| | ||
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ||
| ^^^^^^^^^^^^^ associated type `Output` must be specified | ||
| ^^^^^^ help: specify the associated type: `BitXor<Output = Type>` |
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.
This is the case I'm protecting against when figuring out that there's a path with only one segment in the trait ref.
LL | / pub trait Bar<X=usize, A=Self> { | ||
LL | | fn foo(&self); | ||
LL | | } | ||
| |_- type parameter `A` must be specified for this | ||
... | ||
LL | let e = Bar::<usize>::lol(); | ||
| ^^^ missing reference to `A` |
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.
This is the case I'm protecting against when making sure that the path segment has no args being set.
Colorized output of test case in #66380: |
This comment has been minimized.
This comment has been minimized.
0c037e0
to
2c923df
Compare
This comment has been minimized.
This comment has been minimized.
0d4e2c9
to
6563089
Compare
This comment has been minimized.
This comment has been minimized.
6563089
to
30e0a0d
Compare
Blasting @rust-lang/wg-diagnostics for feedback |
From a purely .stderr POV, this seems like a good improvement. From a happy-code-path POV, the diagnostics are well isolated so readability should not suffer. 👍 overall. |
7bbcd7c
to
9ccc1dd
Compare
This comment has been minimized.
This comment has been minimized.
8e712a0
to
dab3906
Compare
⌛ Testing commit 60cfff65987b46e37f9ab3cc8280d8c393297c5d with merge a0ba6f68f8a1a802b47ef02dce477556ff4f87f1... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
60cfff6
to
621d7e9
Compare
@bors r=oli-obk fixed the last bit of non-determinism I could see |
📌 Commit 621d7e9 has been approved by |
⌛ Testing commit 621d7e9 with merge ba2a07a8f0785e26e0de57f352f5bdc3f18b8ccd... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
@bors retry |
Tweak errors for missing associated types and type parameters * On `dyn Trait` missing associated types, provide a structured suggestion for them * On missing type parameters, provide structured suggestion for them * Point at trait definition when missing required type parameter * Tweak output of E0658 * Tweak wording of E0719 * Account for `Trait1 + Trait2` case Fix #66380, fix #60595. CC #63711.
☀️ Test successful - checks-azure |
dyn Trait
missing associated types, provide a structured suggestion for themTrait1 + Trait2
caseFix #66380, fix #60595. CC #63711.