about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-24 13:23:17 +0000
committerbors <bors@rust-lang.org>2018-03-24 13:23:17 +0000
commitb4aa80dd73df9708022cc383aad8da1dcf38d1df (patch)
tree96feb584c23b8680534b22f984fe70834ead5ec2 /src/rustllvm/RustWrapper.cpp
parenta0b0f5fba5d7bf18b24d1fa0e454a4fe871fecee (diff)
parent94468dac6350a29dc2eb1eed01308ec78224f7ba (diff)
downloadrust-b4aa80dd73df9708022cc383aad8da1dcf38d1df.tar.gz
rust-b4aa80dd73df9708022cc383aad8da1dcf38d1df.zip
Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertj
support elision in impl headers

You can now do things like:

```
impl MyTrait<'_> for &u32 { ... }
```

Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138).

We do not support elision with deprecated forms:

```
impl MyTrait for std::cell::Ref<u32> { } // ERROR
```

Builds on the in-band lifetime stuff.

r? @cramertj

Fixes #15872
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions