Skip to content

Commit 9037ef2

Browse files
Rollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum
change span label for E0435 r? @Mark-Simulacrum
2 parents 747643f + 369d4f1 commit 9037ef2

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
325325
span,
326326
E0435,
327327
"attempt to use a non-constant value in a constant");
328-
err.span_label(span, "non-constant used with constant");
328+
err.span_label(span, "non-constant value");
329329
err
330330
}
331331
ResolutionError::BindingShadowsSomethingUnacceptable(what_binding, name, binding) => {

src/test/compile-fail/E0435.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
fn main () {
1212
let foo = 42u32;
1313
let _: [u8; foo]; //~ ERROR E0435
14-
//~| NOTE non-constant used with constant
14+
//~| NOTE non-constant value
1515
}

src/test/compile-fail/non-constant-expr-for-vec-repeat.rs renamed to src/test/compile-fail/non-constant-expr-for-arr-len.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Check that non constant exprs fail for vector repeat syntax
11+
// Check that non constant exprs fail for array repeat syntax
1212

1313
fn main() {
1414
fn bar(n: usize) {
1515
let _x = [0; n];
1616
//~^ ERROR attempt to use a non-constant value in a constant [E0435]
17-
//~| NOTE non-constant used with constant
17+
//~| NOTE non-constant value
1818
}
1919
}

src/test/compile-fail/non-constant-expr-for-fixed-len-vec.rs

-18
This file was deleted.

0 commit comments

Comments
 (0)