Skip to content

Commit 943c6c7

Browse files
authored
Rollup merge of rust-lang#98687 - matthiaskrgr:test_47814, r=compiler-errors
add test for 47814 not sure if the issue should actually get closed though, hm r? ``@compiler-errors``
2 parents 57c683a + c9f2865 commit 943c6c7

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct ArpIPv4<'a> {
2+
s: &'a u8
3+
}
4+
5+
impl<'a> ArpIPv4<'a> {
6+
const LENGTH: usize = 20;
7+
8+
pub fn to_buffer() -> [u8; Self::LENGTH] { //~ ERROR generic `Self` types are currently not permitted in anonymous constants
9+
unimplemented!()
10+
}
11+
}
12+
13+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: generic `Self` types are currently not permitted in anonymous constants
2+
--> $DIR/issue-47814.rs:8:32
3+
|
4+
LL | pub fn to_buffer() -> [u8; Self::LENGTH] {
5+
| ^^^^
6+
|
7+
note: not a concrete type
8+
--> $DIR/issue-47814.rs:5:10
9+
|
10+
LL | impl<'a> ArpIPv4<'a> {
11+
| ^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)