about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMichael Hewson <michael@michaelhewson.ca>2019-10-26 16:44:06 -0400
committerGitHub <noreply@github.com>2019-10-26 16:44:06 -0400
commitfb4095df94bf07dc745a0c0e07adc93b52f04673 (patch)
tree0facd9d8c5905e3a13ae8d82e5fe3d2c61cac983 /src/libstd/sys/unix/stack_overflow.rs
parent46e6c533d08a2c6d22083a2756a0b569e001c3c4 (diff)
downloadrust-fb4095df94bf07dc745a0c0e07adc93b52f04673.tar.gz
rust-fb4095df94bf07dc745a0c0e07adc93b52f04673.zip
Update comments re type parameter hack in object safety
To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue https://github.com/rust-lang/rust/issues/43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions