Skip to content

Commit f3eba21

Browse files
authored
Rollup merge of rust-lang#105236 - JohnTitor:issue-47814, r=compiler-errors
Add regression test for rust-lang#47814 Closes rust-lang#47814 r? `@compiler-errors` Signed-off-by: Yuki Okushi <[email protected]>
2 parents f2e223c + c366129 commit f3eba21

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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] {
9+
//~^ ERROR: generic `Self` types are currently not permitted in anonymous constants
10+
unimplemented!()
11+
}
12+
}
13+
14+
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)