9a5dcaab67
On structured suggestion for `let` -> `const` and `const` -> `let`, use a proper `Span` and update tests to check the correct application. Follow up to #80012.
12 lines
219 B
Rust
12 lines
219 B
Rust
// run-rustfix
|
|
#![allow(dead_code, non_upper_case_globals)]
|
|
fn main() {
|
|
const n: usize = 0;
|
|
|
|
struct Foo;
|
|
impl Foo {
|
|
const N: usize = n;
|
|
//~^ ERROR attempt to use a non-constant value
|
|
}
|
|
}
|