Bless tests.
This commit is contained in:
parent
a87ab48099
commit
b711723d41
@ -6,6 +6,15 @@ LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
|
|||||||
|
|
|
|
||||||
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
|
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: `&'static str` is forbidden as the type of a const generic parameter
|
||||||
|
--> $DIR/issue-56445-1.rs:9:25
|
||||||
|
|
|
||||||
|
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
|
||||||
|
| ^^^^^^^
|
||||||
|
|
|
||||||
|
= note: the only supported types are integers, `bool` and `char`
|
||||||
|
= help: more complex types are supported with `#![feature(adt_const_params)]`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0771`.
|
For more information about this error, try `rustc --explain E0771`.
|
||||||
|
@ -8,5 +8,6 @@ use std::marker::PhantomData;
|
|||||||
|
|
||||||
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
|
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
|
||||||
//~^ ERROR: use of non-static lifetime `'a` in const generic
|
//~^ ERROR: use of non-static lifetime `'a` in const generic
|
||||||
|
//[min]~| ERROR: `&'static str` is forbidden as the type of a const generic parameter
|
||||||
|
|
||||||
impl Bug<'_, ""> {}
|
impl Bug<'_, ""> {}
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
error[E0771]: use of non-static lifetime `'a` in const generic
|
||||||
|
--> $DIR/E0771.rs:4:41
|
||||||
|
|
|
||||||
|
LL | fn function_with_str<'a, const STRING: &'a str>() {}
|
||||||
|
| ^^
|
||||||
|
|
|
||||||
|
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
|
||||||
|
|
||||||
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
|
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||||
--> $DIR/E0771.rs:1:12
|
--> $DIR/E0771.rs:1:12
|
||||||
|
|
|
|
||||||
@ -7,14 +15,6 @@ LL | #![feature(adt_const_params)]
|
|||||||
= note: `#[warn(incomplete_features)]` on by default
|
= note: `#[warn(incomplete_features)]` on by default
|
||||||
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
|
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
|
||||||
|
|
||||||
error[E0771]: use of non-static lifetime `'a` in const generic
|
|
||||||
--> $DIR/E0771.rs:4:41
|
|
||||||
|
|
|
||||||
LL | fn function_with_str<'a, const STRING: &'a str>() {}
|
|
||||||
| ^^
|
|
||||||
|
|
|
||||||
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
|
|
||||||
|
|
||||||
error: aborting due to previous error; 1 warning emitted
|
error: aborting due to previous error; 1 warning emitted
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0771`.
|
For more information about this error, try `rustc --explain E0771`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user