Skip to content

Commit b711723

Browse files
committed
Bless tests.
1 parent a87ab48 commit b711723

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

src/test/ui/const-generics/issues/issue-56445-1.min.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
66
|
77
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
88

9-
error: aborting due to previous error
9+
error: `&'static str` is forbidden as the type of a const generic parameter
10+
--> $DIR/issue-56445-1.rs:9:25
11+
|
12+
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
13+
| ^^^^^^^
14+
|
15+
= note: the only supported types are integers, `bool` and `char`
16+
= help: more complex types are supported with `#![feature(adt_const_params)]`
17+
18+
error: aborting due to 2 previous errors
1019

1120
For more information about this error, try `rustc --explain E0771`.

src/test/ui/const-generics/issues/issue-56445-1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ use std::marker::PhantomData;
88

99
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
1010
//~^ ERROR: use of non-static lifetime `'a` in const generic
11+
//[min]~| ERROR: `&'static str` is forbidden as the type of a const generic parameter
1112

1213
impl Bug<'_, ""> {}

src/test/ui/error-codes/E0771.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
error[E0771]: use of non-static lifetime `'a` in const generic
2+
--> $DIR/E0771.rs:4:41
3+
|
4+
LL | fn function_with_str<'a, const STRING: &'a str>() {}
5+
| ^^
6+
|
7+
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
8+
19
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
210
--> $DIR/E0771.rs:1:12
311
|
@@ -7,14 +15,6 @@ LL | #![feature(adt_const_params)]
715
= note: `#[warn(incomplete_features)]` on by default
816
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
917

10-
error[E0771]: use of non-static lifetime `'a` in const generic
11-
--> $DIR/E0771.rs:4:41
12-
|
13-
LL | fn function_with_str<'a, const STRING: &'a str>() {}
14-
| ^^
15-
|
16-
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
17-
1818
error: aborting due to previous error; 1 warning emitted
1919

2020
For more information about this error, try `rustc --explain E0771`.

0 commit comments

Comments
 (0)