diff options
Diffstat (limited to 'tests/ui/offset-of/offset-of-inference.rs')
| -rw-r--r-- | tests/ui/offset-of/offset-of-inference.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/offset-of/offset-of-inference.rs b/tests/ui/offset-of/offset-of-inference.rs new file mode 100644 index 00000000000..ba87574eae0 --- /dev/null +++ b/tests/ui/offset-of/offset-of-inference.rs @@ -0,0 +1,11 @@ +// Test that inference types in `offset_of!` don't ICE. + +#![feature(offset_of)] + +struct Foo<T> { + x: T, +} + +fn main() { + let _ = core::mem::offset_of!(Foo<_>, x); //~ ERROR: type annotations needed +} |
