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 47814 #98687

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
13 changes: 13 additions & 0 deletions src/test/ui/associated-types/issue-47814.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
struct ArpIPv4<'a> {
s: &'a u8
}

impl<'a> ArpIPv4<'a> {
const LENGTH: usize = 20;

pub fn to_buffer() -> [u8; Self::LENGTH] { //~ ERROR generic `Self` types are currently not permitted in anonymous constants
unimplemented!()
}
}

pub fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/associated-types/issue-47814.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/issue-47814.rs:8:32
|
LL | pub fn to_buffer() -> [u8; Self::LENGTH] {
| ^^^^
|
note: not a concrete type
--> $DIR/issue-47814.rs:5:10
|
LL | impl<'a> ArpIPv4<'a> {
| ^^^^^^^^^^^

error: aborting due to previous error