-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #99949
- Loading branch information
Showing
2 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/ui/lifetimes/elided-lifetime-in-path-in-type-relative-expression.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |