From 38440d53d8329ac9f3f2013c6e32b3f69b069c72 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Sat, 27 Jun 2020 14:42:42 -0400 Subject: Cleanup repr check, fix packed repr check and test --- crates/ra_ide/src/syntax_highlighting/tests.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting') diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index c40805850..a7f5ad862 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -295,8 +295,6 @@ static mut global_mut: TypeForStaticMut = TypeForStaticMut { a: 0 }; #[repr(packed)] struct Packed { a: u16, - b: u8, - c: u32, } trait DoTheAutoref { @@ -313,11 +311,11 @@ struct HasAligned { } impl DoTheAutoref for NeedsAlign { - fn calls_autored(&self) {} + fn calls_autoref(&self) {} } fn main() { - let x = &5 as *const usize; + let x = &5 as *const _ as *const usize; let u = Union { b: 0 }; unsafe { unsafe_fn(); @@ -327,13 +325,11 @@ fn main() { Union { a } => (), } HasUnsafeFn.unsafe_method(); - let y = *(x); + let _y = *(x); let z = -x; let a = global_mut.a; - let packed = Packed { a: 0, b: 0, c: 0 }; - let a = &packed.a; - let b = &packed.b; - let c = &packed.c; + let packed = Packed { a: 0 }; + let _a = &packed.a; let h = HasAligned{ a: NeedsAlign { a: 1 } }; h.a.calls_autoref(); } -- cgit v1.2.3