about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-05-30 10:27:53 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-05-30 14:54:51 -0400
commit9acb351f5756b58b053ca9b834664da971ac52f2 (patch)
tree43f3f7ea9b956836032559407a7d98f487c9c06d /src/test/incremental/thinlto
parent74d09399c1289a20b1c258153f005f2604f9ec46 (diff)
downloadrust-9acb351f5756b58b053ca9b834664da971ac52f2.tar.gz
rust-9acb351f5756b58b053ca9b834664da971ac52f2.zip
reset the "anonymous lifetime mode" for parenthesized where clauses
Background:

The anonymous lifetime mode is used to prohibit elided lifetimes where
they didn't used to be permitted, and instead require that `'_` be
used. For example:

```rust
impl Trait for Ref<T> { .. }
//             ^^^^^^ ERROR: should be `Ref<'_, T>`
```

When we are parsing the parts of the impl header, we enter into an
alternate mode called `CreateParameter`. In this mode, we give an
error for things like `Ref<T>`, but for elided lifetimes in a
reference type like `&T` we make the elided lifetime into an in-band
lifetime:

https://github.com/rust-lang/rust/blob/4f99f37b7e213d69a489884f651adfc6d217cef5/src/librustc/hir/lowering.rs#L4017-L4035

This was not intended to change behavior because we only enter into
that mode in contexts where elision was not historically
permitted. However, the problem is that we fail to reset the mode when
we enter into bounds like `Fn(&u32)`, where elision *was* allowed --
the same occurs for fn types like `fn(&u32`). This PR restores the
original mode in those contexts.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions