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 :) |
yes |
|
When Given that, is there anything else you had in mind that should be added to the diagnostic? |
|
given that i think it's good @bors r+ rollup |
|
@rust-timer build 279b548 |
|
Missing artifact for sha |
|
@rust-timer build 279b548 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (279b548): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -1.1%, secondary -3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.308s -> 481.474s (-1.60%) |
resolve: #157368
Adjusts the
type constsuggestion to preserve visibility ordering, sopub constis suggested aspub type constinstead oftype pub const.