Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for ice 68875 #98683

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/test/ui/const-generics/ice-68875.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// check-fail

struct DataWrapper<'a> {
data: &'a [u8; Self::SIZE], //~ ERROR generic `Self` types are currently not permitted in anonymous constants
}

impl DataWrapper<'_> {
const SIZE: usize = 14;
}

pub fn main() {}
8 changes: 8 additions & 0 deletions src/test/ui/const-generics/ice-68875.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/ice-68875.rs:4:20
|
LL | data: &'a [u8; Self::SIZE],
| ^^^^

error: aborting due to previous error