add and update tests

This commit is contained in:
b-naber 2022-05-24 13:01:11 +02:00
parent e2e425e8d2
commit 86e8bbe4fd
3 changed files with 25 additions and 2 deletions

View File

@ -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

View 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() {}

View 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`.