rust/library/alloc/src
Matthias Krüger 16b251be10
Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu
PinCoerceUnsized trait into core

cc ``@Darksonn`` ``@wedsonaf`` ``@ojeda``

This is a PR to introduce a `PinCoerceUnsized` trait in order to make trait impls generated by the proc-macro `#[derive(SmartPointer)]`, proposed by [RFC](e17e19ac7a/text/3621-derive-smart-pointer.md (pincoerceunsized-1)), sound. There you may find explanation, justification and discussion about the alternatives.

Note that we do not seek stabilization of this `PinCoerceUnsized` trait in the near future. The stabilisation of this trait does not block the eventual stabilization process of the `#[derive(SmartPointer)]` macro. Ideally, use of `DerefPure` is more preferrable except this will actually constitute a breaking change. `PinCoerceUnsized` emerges as a solution to the said soundness hole while avoiding the breaking change. More details on the `DerefPure` option have been described in this [section](e17e19ac7a/text/3621-derive-smart-pointer.md (derefpure)) of the RFC linked above.

Earlier discussion can be found in this [Zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Pin.20and.20soundness.20of.20unsizing.20coercions) and [rust-for-linux thread](https://rust-lang.zulipchat.com/#narrow/stream/425075-rust-for-linux/topic/.23.5Bderive.28SmartPointer.29.5D.20and.20pin.20unsoundness.20rfc.233621).

try-job: dist-various-2
2024-08-07 00:34:11 +02:00
..
alloc Reformat use declarations. 2024-07-29 08:26:52 +10:00
boxed Reformat use declarations. 2024-07-29 08:26:52 +10:00
collections Rollup merge of #128309 - kmicklas:btreeset-cursor, r=Amanieu 2024-08-05 05:40:20 +02:00
ffi Reformat use declarations. 2024-07-29 08:26:52 +10:00
raw_vec Reformat use declarations. 2024-07-29 08:26:52 +10:00
rc Reformat use declarations. 2024-07-29 08:26:52 +10:00
slice Reformat use declarations. 2024-07-29 08:26:52 +10:00
sync Reformat use declarations. 2024-07-29 08:26:52 +10:00
testing Reformat use declarations. 2024-07-29 08:26:52 +10:00
vec Rollup merge of #127586 - zachs18:more-must-use, r=cuviper 2024-08-03 11:17:42 +02:00
alloc.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
borrow.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
boxed.rs Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu 2024-08-07 00:34:11 +02:00
fmt.rs Fix doc nits 2024-07-26 13:26:33 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs PinCoerceUnsized trait into core 2024-07-31 17:10:55 +08:00
macros.rs Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
raw_vec.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
rc.rs Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu 2024-08-07 00:34:11 +02:00
slice.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
str.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
string.rs Rollup merge of #127586 - zachs18:more-must-use, r=cuviper 2024-08-03 11:17:42 +02:00
sync.rs PinCoerceUnsized trait into core 2024-07-31 17:10:55 +08:00
task.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
tests.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00