Suggest that expressions that look like const generic arguments should be enclosed in brackets#77502
Conversation
src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs
Outdated
Show resolved
Hide resolved
src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs
Outdated
Show resolved
Hide resolved
debf4a7 to
5f8aa8a
Compare
|
I'll get to this next weekend most likely. |
...nst-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs
Outdated
Show resolved
Hide resolved
c23db00 to
b03e75e
Compare
|
@petrochenkov: I've moved the functions to |
|
@petrochenkov: I've added some more tests. The error messages in these cases are not ideal, but they're particularly difficult to handle well. |
e4f2b91 to
9aa3cfb
Compare
Handling |
|
r=me with commits squashed. |
…enclosed in brackets Co-Authored-By: Esteban Kuber <github@kuber.com.ar>
9aa3cfb to
ac14540
Compare
|
@bors r=petrochenkov |
|
📌 Commit ac14540 has been approved by |
|
☀️ Test successful - checks-actions |
I pulled out the changes for const expressions from #71592 (without the trait object diagnostic changes) and made some small changes; the implementation is @estebank's.
We're also going to want to make some changes separately to account for trait objects (they result in poor diagnostics, as is evident from one of the test cases here), such as an adaption of #72273.
Fixes #70753.
r? @petrochenkov