Commit 1b9a16c
committed
librustc: Require lifetimes within the types of values with destructors
to have strictly greater lifetime than the values themselves.
Additionally, remove `#[unsafe_destructor]` in favor of these new
restrictions.
This broke a fair amount of code that had to do with `RefCell`s. We will
probably need to do some work to improve the resulting ergonomics. Most
code that broke looked like:
match foo.bar.borrow().baz { ... }
use_foo(&mut foo);
Change this code to:
{
let bar = foo.bar.borrow();
match bar.baz { ... }
}
use_foo(&mut foo);
This fixes an important memory safety hole relating to destructors,
represented by issue rust-lang#8861.
[breaking-change]1 parent 828e075 commit 1b9a16c
42 files changed
Lines changed: 1160 additions & 645 deletions
File tree
- src
- libcollections
- libcore
- libgreen
- librustc
- driver
- front
- metadata
- middle
- borrowck/gather_loans
- trans
- typeck
- check
- coherence
- infer
- region_inference
- util
- librustdoc
- clean
- librustrt
- libsync
- comm
- libsyntax
- ext
- test/compile-fail
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
- bin/pprof+1-2
- config.sub-3
- configure+2-2
- include/jemalloc/internal/arena.h+23-29
- include/jemalloc/internal/jemalloc_internal.h.in+2-2
- include/jemalloc/internal/private_symbols.txt-1
- include/jemalloc/internal/prof.h+29-28
- include/jemalloc/internal/tcache.h+17-17
- include/jemalloc/internal/util.h+3-11
- include/jemalloc/internal/valgrind.h+6-6
- src/arena.c+14-14
- src/huge.c+3-3
- src/jemalloc.c+125-129
- src/prof.c+34-78
- src/quarantine.c+2-2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1095 | 1096 | | |
1096 | | - | |
1097 | | - | |
| 1097 | + | |
| 1098 | + | |
1098 | 1099 | | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1104 | 1105 | | |
1105 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1106 | 1109 | | |
1107 | | - | |
1108 | 1110 | | |
1109 | 1111 | | |
1110 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
249 | | - | |
| 247 | + | |
| 248 | + | |
250 | 249 | | |
251 | 250 | | |
252 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
0 commit comments