about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-23 14:30:01 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-23 14:30:01 +0200
commit5f1eea93a9340d5f2243c5467b4234bd0c14e7a5 (patch)
treeec24623c5ada2f74e29f0626e958a6b25c432e2d
parent9910f156df7a17cbbdf319790ce005487d66d2fd (diff)
downloadrust-5f1eea93a9340d5f2243c5467b4234bd0c14e7a5.tar.gz
rust-5f1eea93a9340d5f2243c5467b4234bd0c14e7a5.zip
test usage
-rw-r--r--src/test/ui/const-generics/argument_order.rs5
-rw-r--r--src/test/ui/const-generics/argument_order.stderr12
2 files changed, 15 insertions, 2 deletions
diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs
index 9a9b7986c9c..1d1adf39434 100644
--- a/src/test/ui/const-generics/argument_order.rs
+++ b/src/test/ui/const-generics/argument_order.rs
@@ -13,4 +13,7 @@ struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
     b: &'b U,
 }
 
-fn main() { }
+fn main() {
+    let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
+    //~^ ERROR lifetime provided when a type was expected
+ }
diff --git a/src/test/ui/const-generics/argument_order.stderr b/src/test/ui/const-generics/argument_order.stderr
index bc2be3b8f10..19e895b8eb8 100644
--- a/src/test/ui/const-generics/argument_order.stderr
+++ b/src/test/ui/const-generics/argument_order.stderr
@@ -25,5 +25,15 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-error: aborting due to 3 previous errors; 1 warning emitted
+error[E0747]: lifetime provided when a type was expected
+  --> $DIR/argument_order.rs:17:23
+   |
+LL |     let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
+   |                       ^^^^^^^
+   |
+   = note: lifetime arguments must be provided before type arguments
+   = help: reorder the arguments: lifetimes, then types, then consts: `<'a, 'b, T, U, N, M>`
+
+error: aborting due to 4 previous errors; 1 warning emitted
 
+For more information about this error, try `rustc --explain E0747`.