mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
add and update tests
This commit is contained in:
parent
e2e425e8d2
commit
86e8bbe4fd
@ -1,8 +1,8 @@
|
||||
error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
|
||||
error[E0741]: `(dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
|
||||
--> $DIR/issue-63322-forbid-dyn.rs:9:18
|
||||
|
|
||||
LL | fn test<const T: &'static dyn A>() {
|
||||
| ^^^^^^^^^^^^^^ `&'static (dyn A + 'static)` doesn't derive both `PartialEq` and `Eq`
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
14
src/test/ui/const-generics/issues/issue-97278.rs
Normal file
14
src/test/ui/const-generics/issues/issue-97278.rs
Normal file
@ -0,0 +1,14 @@
|
||||
#![feature(adt_const_params)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
enum Bar {
|
||||
Bar(Arc<i32>)
|
||||
}
|
||||
|
||||
fn test<const BAR: Bar>() {}
|
||||
//~^ ERROR `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]`
|
||||
|
||||
fn main() {}
|
9
src/test/ui/const-generics/issues/issue-97278.stderr
Normal file
9
src/test/ui/const-generics/issues/issue-97278.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0741]: `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
|
||||
--> $DIR/issue-97278.rs:11:20
|
||||
|
|
||||
LL | fn test<const BAR: Bar>() {}
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0741`.
|
Loading…
Reference in New Issue
Block a user