aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-06-27 19:42:42 +0100
committerPaul Daniel Faria <[email protected]>2020-08-10 13:44:54 +0100
commit38440d53d8329ac9f3f2013c6e32b3f69b069c72 (patch)
tree9f8bef46fc35c1ad4476e6c91e68c085c39da811 /crates/ra_ide/src/syntax_highlighting
parentc9e670b8754b8262b5071a96c32cbcd22ff968f4 (diff)
Cleanup repr check, fix packed repr check and test
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting')
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tests.rs14
1 files changed, 5 insertions, 9 deletions
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 };
295#[repr(packed)] 295#[repr(packed)]
296struct Packed { 296struct Packed {
297 a: u16, 297 a: u16,
298 b: u8,
299 c: u32,
300} 298}
301 299
302trait DoTheAutoref { 300trait DoTheAutoref {
@@ -313,11 +311,11 @@ struct HasAligned {
313} 311}
314 312
315impl DoTheAutoref for NeedsAlign { 313impl DoTheAutoref for NeedsAlign {
316 fn calls_autored(&self) {} 314 fn calls_autoref(&self) {}
317} 315}
318 316
319fn main() { 317fn main() {
320 let x = &5 as *const usize; 318 let x = &5 as *const _ as *const usize;
321 let u = Union { b: 0 }; 319 let u = Union { b: 0 };
322 unsafe { 320 unsafe {
323 unsafe_fn(); 321 unsafe_fn();
@@ -327,13 +325,11 @@ fn main() {
327 Union { a } => (), 325 Union { a } => (),
328 } 326 }
329 HasUnsafeFn.unsafe_method(); 327 HasUnsafeFn.unsafe_method();
330 let y = *(x); 328 let _y = *(x);
331 let z = -x; 329 let z = -x;
332 let a = global_mut.a; 330 let a = global_mut.a;
333 let packed = Packed { a: 0, b: 0, c: 0 }; 331 let packed = Packed { a: 0 };
334 let a = &packed.a; 332 let _a = &packed.a;
335 let b = &packed.b;
336 let c = &packed.c;
337 let h = HasAligned{ a: NeedsAlign { a: 1 } }; 333 let h = HasAligned{ a: NeedsAlign { a: 1 } };
338 h.a.calls_autoref(); 334 h.a.calls_autoref();
339 } 335 }