mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
add UI regression test for offset_of! recovery
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use std::mem::offset_of;
|
||||
|
||||
struct S {
|
||||
x: (),
|
||||
}
|
||||
|
||||
impl S {
|
||||
fn a() {
|
||||
offset_of!(Self, Self::x);
|
||||
//~^ ERROR offset_of expects dot-separated field and variant names
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
error: offset_of expects dot-separated field and variant names
|
||||
--> $DIR/offset-of-error-recovery.rs:9:26
|
||||
|
|
||||
LL | offset_of!(Self, Self::x);
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Reference in New Issue
Block a user