}
else
{
- rust_error_at (expr.get_locus (), "failed to find name: %s",
+ rust_error_at (expr.get_locus (), ErrorCode ("E0425"),
+ "cannot find value %qs in this scope",
expr.as_string ().c_str ());
}
}
fn main() {
break (rust);
- // { dg-error "failed to find name: rust" "" { target *-*-* } .-1 }
+ // { dg-error "cannot find value .rust. in this scope" "" { target *-*-* } .-1 }
}
struct Foo<T, const N: usize = 1> {
// FIXME: This error is bogus. But having it means parsing is valid!
- value: [i32; N], // { dg-error "failed to find name: N" }
+ value: [i32; N], // { dg-error "cannot find value .N. in this scope" }
}
fn main() {
const P: usize = 14;
-struct Foo<const N: usize = { M }>; // { dg-error "failed to find name: M" }
+struct Foo<const N: usize = { M }>; // { dg-error "cannot find value .M. in this scope" }
struct Bar<const N: usize = { P }>;
struct Baz<const N: NotAType = { P }>; // { dg-error "failed to resolve TypePath: NotAType in this scope" }
--- /dev/null
+// https://doc.rust-lang.org/error_codes/E0425.html
+fn main() {
+ let f = x * x * 3; // { dg-error "cannot find value .x. in this scope" }
+ let a = f(); // invalid, too few parameters
+ let b = f(4); // this works!
+ let c = f(2, 3); // invalid, too many parameters
+}