add test for 47814

not sure if the issue should actually get closed though, hm

r? @compiler-errors
This commit is contained in:
Matthias Krüger 2022-06-29 22:27:18 +02:00
parent 3fcf43bb0f
commit c9f2865472
2 changed files with 27 additions and 0 deletions

View File

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

View File

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