Rollup merge of #59007 - varkor:invalid-const-arg-test, r=petrochenkov

Add a test for invalid const arguments

Closes https://github.com/rust-lang/rust/issues/58811.
This commit is contained in:
Pietro Albini 2019-03-08 09:42:15 +01:00 committed by GitHub
commit 961e378ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,3 @@
fn main() {
let _: Vec<&str, "a"> = Vec::new(); //~ ERROR wrong number of const arguments
}

View File

@ -0,0 +1,9 @@
error[E0107]: wrong number of const arguments: expected 0, found 1
--> $DIR/invalid-constant-in-args.rs:2:22
|
LL | let _: Vec<&str, "a"> = Vec::new(); //~ ERROR wrong number of const arguments
| ^^^ unexpected const argument
error: aborting due to previous error
For more information about this error, try `rustc --explain E0107`.