Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Clarify (and improve) rules for projections and well-formedness #1214

Merged
merged 10 commits into from
Aug 7, 2015
Prev Previous commit
Next Next commit
Correct issue #.
  • Loading branch information
nikomatsakis committed Jul 17, 2015
commit bcc727f9efb85a09a818e96f2d113bf22104f0ae
8 changes: 4 additions & 4 deletions text/0000-projections-lifetimes-and-wf.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Type system changes to address the outlives relation with respect to
projections, and to better enforce that all types are well-formed
(meaning that they respect their declared bounds). The current
implementation can be both unsound ([#24662]), inconvenient
implementation can be both unsound ([#24622]), inconvenient
([#23442]), and surprising ([#21748], [#25692]). The changes are as follows:

- Simplify the outlives relation to be syntactically based.
Expand Down Expand Up @@ -147,12 +147,12 @@ being [adapted] to cover associated type projections like
still lead to [annoying errors in some situations][#23442]. Finding a
better solution has been on the agenda for some time.

Simultaneously, we realized in [#24662] that the compiler had a bug
Simultaneously, we realized in [#24622] that the compiler had a bug
that caused it erroneously assume that every projection like `I::Item`
outlived the current function body, just as it assumes that type
parameters like `I` outlive the current function body. **This bug can
lead to unsound behavior.** Unfortunately, simply implementing the
naive fix for #24662 exacerbates the shortcomings of the current rules
naive fix for #24622 exacerbates the shortcomings of the current rules
for projections, causing widespread compilation failures in all sorts
of reasonable and obviously correct code.

Expand Down Expand Up @@ -855,7 +855,7 @@ regions, so probably yes.
[RFC 447]: https://github.com/rust-lang/rfcs/blob/master/text/0447-no-unused-impl-parameters.md
[#21748]: https://github.com/rust-lang/rust/issues/21748
[#23442]: https://github.com/rust-lang/rust/issues/23442
[#24662]: https://github.com/rust-lang/rust/issues/24622
[#24622]: https://github.com/rust-lang/rust/issues/24622
[#22436]: https://github.com/rust-lang/rust/pull/22436
[#22246]: https://github.com/rust-lang/rust/issues/22246
[#25860]: https://github.com/rust-lang/rust/issues/25860
Expand Down