-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Bonus format for E0194 #36148
Bonus format for E0194 #36148
Conversation
@birryree - I'm going to also go on the assumption that the unwraps are okay because the type parameter is local. I tried for a few minutes to come up with a counter example but wasn't able to. @bors r+ rollup |
📌 Commit fb38911 has been approved by |
…thandturner Bonus format for E0194 Bonus fix for rust-lang#35280. Part of rust-lang#35233. Fixes rust-lang#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages. Errors for E0194 now look like this: ``` $> ./build/x86_64-apple-darwin/stage1/bin/rustc src/test/compile-fail/E0194.rs error[E0194]: type parameter `T` shadows another type parameter of the same name --> src/test/compile-fail/E0194.rs:13:26 | 11 | trait Foo<T> { //~ NOTE first `T` declared here | - first `T` declared here 12 | fn do_something(&self) -> T; 13 | fn do_something_else<T: Clone>(&self, bar: T); | ^ shadows another type parameter error: aborting due to previous error ``` r? @jonathandturner
@jonathandturner - I've been looking at the well-formed checker heavily and I based it on what I know about Rust currently and what @nikomatsakis mentioned to me as part of #35280. I took this bonus to a separate issue so I could get a review of the |
Yes, I think the unwraps are ok. :) |
…ng#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages.
fb38911
to
69f0cee
Compare
@bors r+ |
📌 Commit 69f0cee has been approved by |
…thandturner Bonus format for E0194 Bonus fix for rust-lang#35280. Part of rust-lang#35233. Fixes rust-lang#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages. Errors for E0194 now look like this: ``` $> ./build/x86_64-apple-darwin/stage1/bin/rustc src/test/compile-fail/E0194.rs error[E0194]: type parameter `T` shadows another type parameter of the same name --> src/test/compile-fail/E0194.rs:13:26 | 11 | trait Foo<T> { //~ NOTE first `T` declared here | - first `T` declared here 12 | fn do_something(&self) -> T; 13 | fn do_something_else<T: Clone>(&self, bar: T); | ^ shadows another type parameter error: aborting due to previous error ``` r? @jonathandturner
…thandturner Bonus format for E0194 Bonus fix for rust-lang#35280. Part of rust-lang#35233. Fixes rust-lang#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages. Errors for E0194 now look like this: ``` $> ./build/x86_64-apple-darwin/stage1/bin/rustc src/test/compile-fail/E0194.rs error[E0194]: type parameter `T` shadows another type parameter of the same name --> src/test/compile-fail/E0194.rs:13:26 | 11 | trait Foo<T> { //~ NOTE first `T` declared here | - first `T` declared here 12 | fn do_something(&self) -> T; 13 | fn do_something_else<T: Clone>(&self, bar: T); | ^ shadows another type parameter error: aborting due to previous error ``` r? @jonathandturner
@jonathandturner Sorry to give you some extra work, but I just updated my PR to cut down a line that was 101 characters long and broke |
Bonus fix for #35280. Part of #35233. Fixes #36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages.
Errors for E0194 now look like this:
r? @jonathandturner