Add regression test for #47814
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
parent
2341517696
commit
c366129205
14
src/test/ui/associated-consts/issue-47814.rs
Normal file
14
src/test/ui/associated-consts/issue-47814.rs
Normal file
@ -0,0 +1,14 @@
|
||||
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!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
14
src/test/ui/associated-consts/issue-47814.stderr
Normal file
14
src/test/ui/associated-consts/issue-47814.stderr
Normal 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user