about summary refs log tree commit diff
path: root/src/tools/miri
blob: deb9bfd24648d50142ab29b810175837c4718885 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
tree 98572934e68bade78e8e4402368b7d86d2a89e2e
parent c8b3cf00601441eb38f740417f1653f8bcb500cc
parent 77cec811b44ff5931251b5fcaf5594b63dae0afa
author bors <bors@rust-lang.org> 1641737400 +0000
committer bors <bors@rust-lang.org> 1641737400 +0000

Auto merge of #1952 - RalfJung:self-referential, r=RalfJung

exclude mutable references to !Unpin types from uniqueness guarantees

This basically works around https://github.com/rust-lang/unsafe-code-guidelines/issues/148 by not requiring uniqueness any more for mutable references to self-referential generators. That corresponds to [the same work-around that was applied in rustc itself](https://github.com/rust-lang/rust/blob/b81553267437627af63c79c1a20c73af865a842a/compiler/rustc_middle/src/ty/layout.rs#L2482).

I am not entirely sure if this is a good idea since it might hide too many errors in case types are "accidentally" `!Unpin`. OTOH, our test suite still passes, and to my knowledge the vast majority of types is `Unpin`. (`place.layout.ty` is monomorphic, we should always exactly know which type this is.)