Skip to content

Commit

Permalink
Rollup merge of #42833 - durka:non-constant-used-with-constant, r=Mar…
Browse files Browse the repository at this point in the history
…k-Simulacrum

change span label for E0435

r? @Mark-Simulacrum
  • Loading branch information
Mark-Simulacrum authored Jun 22, 2017
2 parents 227536c + 369d4f1 commit 0886541
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
span,
E0435,
"attempt to use a non-constant value in a constant");
err.span_label(span, "non-constant used with constant");
err.span_label(span, "non-constant value");
err
}
ResolutionError::BindingShadowsSomethingUnacceptable(what_binding, name, binding) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0435.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
fn main () {
let foo = 42u32;
let _: [u8; foo]; //~ ERROR E0435
//~| NOTE non-constant used with constant
//~| NOTE non-constant value
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Check that non constant exprs fail for vector repeat syntax
// Check that non constant exprs fail for array repeat syntax

fn main() {
fn bar(n: usize) {
let _x = [0; n];
//~^ ERROR attempt to use a non-constant value in a constant [E0435]
//~| NOTE non-constant used with constant
//~| NOTE non-constant value
}
}
18 changes: 0 additions & 18 deletions src/test/compile-fail/non-constant-expr-for-fixed-len-vec.rs

This file was deleted.

0 comments on commit 0886541

Please sign in to comment.