Merge pull request #634 from RalfJung/trophy-case
List some bugs that we found
This commit is contained in:
commit
3b834667fd
14
README.md
14
README.md
@ -15,6 +15,8 @@ for example:
|
|||||||
or an invalid enum discriminant)
|
or an invalid enum discriminant)
|
||||||
* WIP: Violations of the rules governing aliasing for reference types
|
* WIP: Violations of the rules governing aliasing for reference types
|
||||||
|
|
||||||
|
Miri has already discovered some [real-world bugs](#bugs-found-by-miri).
|
||||||
|
|
||||||
[rust]: https://www.rust-lang.org/
|
[rust]: https://www.rust-lang.org/
|
||||||
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
|
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
|
||||||
[`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html
|
[`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html
|
||||||
@ -252,6 +254,18 @@ used according to their aliasing restrictions.
|
|||||||
[slides]: https://solson.me/miri-slides.pdf
|
[slides]: https://solson.me/miri-slides.pdf
|
||||||
[report]: https://solson.me/miri-report.pdf
|
[report]: https://solson.me/miri-report.pdf
|
||||||
|
|
||||||
|
## Bugs found by Miri
|
||||||
|
|
||||||
|
Miri has already found a number of bugs in the Rust standard library, which we collect here.
|
||||||
|
|
||||||
|
* [`Debug for vec_deque::Iter` accessing uninitialized memory](https://github.com/rust-lang/rust/issues/53566)
|
||||||
|
* [`From<&[T]> for Rc` creating a not sufficiently aligned reference](https://github.com/rust-lang/rust/issues/54908)
|
||||||
|
* [`BTreeMap` creating a shared reference pointing to a too small allocation](https://github.com/rust-lang/rust/issues/54957)
|
||||||
|
* [`VecDeque` creating overlapping mutable references](https://github.com/rust-lang/rust/pull/56161)
|
||||||
|
* [Futures turning a shared reference into a mutable one](https://github.com/rust-lang/rust/pull/56319)
|
||||||
|
* [`str` turning a shared reference into a mutable one](https://github.com/rust-lang/rust/pull/58200)
|
||||||
|
* [`BTreeMap` creating mutable references that overlap with shared references](https://github.com/rust-lang/rust/pull/58431)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Licensed under either of
|
Licensed under either of
|
||||||
|
@ -9,6 +9,14 @@ fn main() {
|
|||||||
let mut src = VecDeque::new();
|
let mut src = VecDeque::new();
|
||||||
src.push_front(Box::new(2));
|
src.push_front(Box::new(2));
|
||||||
dst.append(&mut src);
|
dst.append(&mut src);
|
||||||
|
for a in dst.iter() {
|
||||||
|
assert_eq!(**a, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regression test for Debug and Diaplay impl's
|
||||||
|
println!("{:?} {:?}", dst, dst.iter());
|
||||||
|
println!("{:?}", VecDeque::<u32>::new().iter());
|
||||||
|
|
||||||
for a in dst {
|
for a in dst {
|
||||||
assert_eq!(*a, 2);
|
assert_eq!(*a, 2);
|
||||||
}
|
}
|
||||||
|
2
tests/run-pass/vecdeque.stdout
Normal file
2
tests/run-pass/vecdeque.stdout
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[2, 2] Iter([2, 2], [])
|
||||||
|
Iter([], [])
|
Loading…
Reference in New Issue
Block a user