Commit 883b6aa
committed
Auto merge of rust-lang#67039 - xfix:manually-implement-pin-traits, r=nikomatsakis
Use deref target in Pin trait implementations
Using deref target instead of pointer itself avoids providing access to `&Rc<T>` for malicious implementations, which would allow calling `Rc::get_mut`.
This is a breaking change necessary due to unsoundness, however the impact of it should be minimal.
This only fixes the issue with malicious `PartialEq` implementations, other `Pin` soundness issues are still here.
See <https://internals.rust-lang.org/t/unsoundness-in-pin/11311/73> for more details.File tree
3 files changed
+81
-17
lines changed- src
- libcore
- test/ui/issues
3 files changed
+81
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
393 | | - | |
394 | | - | |
395 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
400 | | - | |
| 401 | + | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
405 | | - | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
407 | 414 | | |
408 | | - | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | | - | |
| 418 | + | |
412 | 419 | | |
413 | 420 | | |
414 | 421 | | |
415 | | - | |
| 422 | + | |
416 | 423 | | |
417 | 424 | | |
418 | 425 | | |
419 | | - | |
420 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
421 | 431 | | |
422 | | - | |
| 432 | + | |
423 | 433 | | |
424 | 434 | | |
425 | | - | |
| 435 | + | |
426 | 436 | | |
427 | 437 | | |
428 | 438 | | |
429 | | - | |
| 439 | + | |
430 | 440 | | |
431 | 441 | | |
432 | 442 | | |
433 | | - | |
| 443 | + | |
434 | 444 | | |
435 | 445 | | |
436 | 446 | | |
437 | | - | |
| 447 | + | |
438 | 448 | | |
439 | 449 | | |
440 | 450 | | |
441 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
442 | 466 | | |
443 | 467 | | |
444 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments