diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-02-10 23:41:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-10 23:41:35 -0500 |
| commit | 92cf7aecb4c1e45c9b09620e09598a8cd5bb4837 (patch) | |
| tree | 10309750f863b155b0cd6bcb008adaec07eb7a38 /src | |
| parent | 4269e5207eff7d653e232516f4d612fb3d19fa4a (diff) | |
| parent | c7f9811abab9289eac9b577aba4c60a5afb0bef4 (diff) | |
| download | rust-92cf7aecb4c1e45c9b09620e09598a8cd5bb4837.tar.gz rust-92cf7aecb4c1e45c9b09620e09598a8cd5bb4837.zip | |
Rollup merge of #39692 - oli-obk:patch-2, r=aturon
remove wrong packed struct test This UB was found by running the test under [Miri](https://github.com/solson/miri) which rejects these unsafe unaligned loads. :smile:
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/run-pass/dst-field-align.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/test/run-pass/dst-field-align.rs b/src/test/run-pass/dst-field-align.rs index cf2acfe986c..c36833f2fb6 100644 --- a/src/test/run-pass/dst-field-align.rs +++ b/src/test/run-pass/dst-field-align.rs @@ -25,12 +25,6 @@ struct Baz<T: ?Sized> { a: T } -#[repr(packed)] -struct Packed<T: ?Sized> { - a: u8, - b: T -} - struct HasDrop<T: ?Sized> { ptr: Box<usize>, data: T @@ -55,12 +49,6 @@ fn main() { // The pointers should be the same assert_eq!(ptr1, ptr2); - // Test that packed structs are handled correctly - let p : Packed<usize> = Packed { a: 0, b: 13 }; - assert_eq!(p.b.get(), 13); - let p : &Packed<Bar> = &p; - assert_eq!(p.b.get(), 13); - // Test that nested DSTs work properly let f : Foo<Foo<usize>> = Foo { a: 0, b: Foo { a: 1, b: 17 }}; assert_eq!(f.b.b.get(), 17); |
