diff options
| author | bors <bors@rust-lang.org> | 2022-08-04 10:21:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-04 10:21:40 +0000 |
| commit | 6f18f0a9d4548bc87afff1e4c0fe9081c35002c2 (patch) | |
| tree | 8663684051908c2006289035b5c910ffddab9540 /src | |
| parent | 2f2243c9b6686d2314515561a80898e746015231 (diff) | |
| parent | ec3f3074a1d2f0c3f8a4fd245c79a774cf19a7ca (diff) | |
| download | rust-6f18f0a9d4548bc87afff1e4c0fe9081c35002c2.tar.gz rust-6f18f0a9d4548bc87afff1e4c0fe9081c35002c2.zip | |
Auto merge of #99953 - cjgillot:in-path-always, r=petrochenkov
Always create elided lifetimes, even if inferred. `PathSource` gives the context in which a path is encountered. The same `PathSource` is used for the full path and the `QSelf` part. Therefore, we can only rely on `PathSource` to know whether typechecking will be able to infer the lifetimes, not whether we need to insert them at all. Fixes https://github.com/rust-lang/rust/issues/99949
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/lifetimes/elided-lifetime-in-path-in-type-relative-expression.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/lifetimes/elided-lifetime-in-path-in-type-relative-expression.rs b/src/test/ui/lifetimes/elided-lifetime-in-path-in-type-relative-expression.rs new file mode 100644 index 00000000000..b9d2711fd9c --- /dev/null +++ b/src/test/ui/lifetimes/elided-lifetime-in-path-in-type-relative-expression.rs @@ -0,0 +1,17 @@ +// check-pass + +struct Sqlite {} + +trait HasArguments<'q> { + type Arguments; +} + +impl<'q> HasArguments<'q> for Sqlite { + type Arguments = std::marker::PhantomData<&'q ()>; +} + +fn foo() { + let _ = <Sqlite as HasArguments>::Arguments::default(); +} + +fn main() {} |
