-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[WIP] Diagnose elision failure on the AST #96575
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
Closed
Closed
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a87ab48
Ban non-static in const generics in AST.
cjgillot b711723
Bless tests.
cjgillot 865d0fe
Ban non-static lifetimes from AnonConst on AST.
cjgillot 7d990a8
Bless tests.
cjgillot 7034bd2
Merge branch 'elided-path-fn'
cjgillot 504c178
Extract AssocItem handling.
cjgillot dbc04f3
Separate named and anonymous lifetime ribs.
cjgillot db3845d
Introduce AnonymousLifetimeRib::Static.
cjgillot 36f3cd7
Report elision failures on the AST.
cjgillot 4e55414
Bless tests.
cjgillot f5ee6d2
Remove spurious change.
cjgillot 2bf9e1e
Ignore tidy
cjgillot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,17 +1,43 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/issue-63388-2.rs:12:10 | ||
--> $DIR/issue-63388-2.rs:13:10 | ||
| | ||
LL | foo: &dyn Foo, bar: &'a dyn Foo | ||
| -------- ----------- | ||
LL | | ||
LL | ) -> &dyn Foo | ||
| ^ expected named lifetime parameter | ||
| | ||
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `foo` or `bar` | ||
help: consider using the `'a` lifetime | ||
| | ||
LL | ) -> &'a dyn Foo | ||
| ~~~ | ||
| ++ | ||
|
||
error: aborting due to previous error | ||
error[E0759]: `foo` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement | ||
--> $DIR/issue-63388-2.rs:11:9 | ||
| | ||
LL | foo: &dyn Foo, bar: &'a dyn Foo | ||
| ^^^ -------- this data with an anonymous lifetime `'_`... | ||
| | | ||
| ...is used here... | ||
... | ||
LL | foo | ||
| --- ...and is required to live as long as `'static` here | ||
| | ||
note: `'static` lifetime requirement introduced by the return type | ||
--> $DIR/issue-63388-2.rs:13:10 | ||
| | ||
LL | ) -> &dyn Foo | ||
| ^^^^^^^^ requirement introduced by this return type | ||
LL | { | ||
LL | foo | ||
| --- because of this returned expression | ||
help: to declare that the trait object captures data from argument `foo`, you can add an explicit `'_` lifetime bound | ||
| | ||
LL | ) -> &dyn Foo + '_ | ||
| ++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. | ||
Some errors have detailed explanations: E0106, E0759. | ||
For more information about an error, try `rustc --explain E0106`. |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.