about summary refs log tree commit diff
path: root/src/libstd/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-01 13:19:18 +0000
committerbors <bors@rust-lang.org>2018-03-01 13:19:18 +0000
commit3eeb5a665e313c5b281820099e04d4c6c8188b46 (patch)
treee16ca17237185c562aa8a02f382c3102e6f44061 /src/libstd/sys/unix/process/process_unix.rs
parenta85417f5938023d1491b44d94da705f539bb8b17 (diff)
parent3e84aeda0fa308424338529611a8ee157776b221 (diff)
downloadrust-3eeb5a665e313c5b281820099e04d4c6c8188b46.tar.gz
rust-3eeb5a665e313c5b281820099e04d4c6c8188b46.zip
Auto merge of #46785 - leodasvacas:type-check-defaults-at-declaration, r=nikomatsakis
[Underspecified semantics] Type check defaults at declaration.

Fixes  #46669. See the test for code that compiles on stable but will no longer compile. This falls under a "Underspecified language semantics" fix. **Needs crater**.

On type and trait declarations, we currently allow anything that name checks as a type parameter default. That allows the user to write a default that can never be applied, or even a default that may conditionally be applied depending on the type of another parameter. Mostly this just defers the error to use sites, but also allows clever hacks such as `Foo<T, U = <T as Iterator>::Item>` where `U` will be able to apply it's default only when `T: Iterator`. Maybe that means this bug is a feature, but it's a fiddly behaviour that seems undesirable.

This PR validates defaults at declaration sites by ensuring all predicates on the parameter are valid for the default. With the exception of `Self: Sized` which we don't want to check to allow things like `trait Add<RHS = Self>`.
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions