Skip to content

Commit 5f1eea9

Browse files
committed
test usage
1 parent 9910f15 commit 5f1eea9

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/test/ui/const-generics/argument_order.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
1313
b: &'b U,
1414
}
1515

16-
fn main() { }
16+
fn main() {
17+
let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
18+
//~^ ERROR lifetime provided when a type was expected
19+
}

src/test/ui/const-generics/argument_order.stderr

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,15 @@ LL | #![feature(const_generics)]
2525
= note: `#[warn(incomplete_features)]` on by default
2626
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
2727

28-
error: aborting due to 3 previous errors; 1 warning emitted
28+
error[E0747]: lifetime provided when a type was expected
29+
--> $DIR/argument_order.rs:17:23
30+
|
31+
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
32+
| ^^^^^^^
33+
|
34+
= note: lifetime arguments must be provided before type arguments
35+
= help: reorder the arguments: lifetimes, then types, then consts: `<'a, 'b, T, U, N, M>`
36+
37+
error: aborting due to 4 previous errors; 1 warning emitted
2938

39+
For more information about this error, try `rustc --explain E0747`.

0 commit comments

Comments
 (0)