dtolnay / case-studies

Analysis of various tricky Rust code
Apache License 2.0
1.7k stars 46 forks source link

Add note about type_alias_bounds #2

Closed dtolnay closed 5 years ago

dtolnay commented 5 years ago

unit-type-parameters/README.md#documentation

This section should call out that type_alias_bounds is a future compatibility lint in the sense that the compiler may enforce the bounds eventually and the current behavior is considered a compiler bug.

The thing that makes it safe and correct to write here is that the RHS of the type alias uses exactly the same bounds as the LHS. Where that isn't the case, future compiler changes may break it.

Centril commented 5 years ago

cc https://github.com/rust-lang/rust/issues/49441 https://github.com/rust-lang/rust/issues/21903

cc @eddyb @nikomatsakis

eddyb commented 5 years ago

Ugh, I think this wasn't correctly implemented yet, so the lint is still wrong. Maybe someone else should take over the original PRs I made?