Suggest type next to visibility for const items#157382
Conversation
|
HIR ty lowering was modified cc @fmease |
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? compiler |
|
Hey, thanks for a PR, I'm a bit busy this week. I will try to review within next 3 days |
This comment has been minimized.
This comment has been minimized.
749eb9b to
bbbde3e
Compare
|
I went through the pr, looks good. There is already an alternative test if it is an external crate(non-local) at tests/ui/const-generics/mgca/non-local-const-without-type_const.rs, so, not needed for this pr since it exist. |
|
There is some code duplication between the branches, but that's ok. One thing that'd be nice to have is a check for whether the feature is enabled in order to add a note explaining that this change only would work on nightly (like we do in the errors when using a feature that isn't enabled). Other than that, r=me. |
|
@rustbot author |
bbbde3e to
5ea3958
Compare
Am I understanding correctly that you mean we should add this note only when If that's my understanding, then for this test case, when MGCA is not enabled, the code compiles successfully instead of emitting an error with a suggestion to use |
|
thank you for the review :) |
resolve: #157368
Adjusts the
type constsuggestion to preserve visibility ordering, sopub constis suggested aspub type constinstead oftype pub const.