Skip to content

Commit 86e8bbe

Browse files
committed
add and update tests
1 parent e2e425e commit 86e8bbe

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
1+
error[E0741]: `(dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
22
--> $DIR/issue-63322-forbid-dyn.rs:9:18
33
|
44
LL | fn test<const T: &'static dyn A>() {
5-
| ^^^^^^^^^^^^^^ `&'static (dyn A + 'static)` doesn't derive both `PartialEq` and `Eq`
5+
| ^^^^^^^^^^^^^^
66

77
error: aborting due to previous error
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(adt_const_params)]
2+
#![allow(incomplete_features)]
3+
4+
use std::sync::Arc;
5+
6+
#[derive(PartialEq, Eq)]
7+
enum Bar {
8+
Bar(Arc<i32>)
9+
}
10+
11+
fn test<const BAR: Bar>() {}
12+
//~^ ERROR `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]`
13+
14+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0741]: `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
2+
--> $DIR/issue-97278.rs:11:20
3+
|
4+
LL | fn test<const BAR: Bar>() {}
5+
| ^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0741`.

0 commit comments

Comments
 (0)