-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve liveness analysis for generators #84333
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
Merged
+107
−23
Merged
Changes from all commits
Commits
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
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,150 +1,190 @@ | ||
warning: value assigned to `last` is never read | ||
--> $DIR/liveness-upvars.rs:9:9 | ||
--> $DIR/liveness-upvars.rs:10:9 | ||
| | ||
LL | last = Some(s); | ||
| ^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/liveness-upvars.rs:3:9 | ||
--> $DIR/liveness-upvars.rs:4:9 | ||
| | ||
LL | #![warn(unused)] | ||
| ^^^^^^ | ||
= note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]` | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: unused variable: `last` | ||
--> $DIR/liveness-upvars.rs:9:9 | ||
--> $DIR/liveness-upvars.rs:10:9 | ||
| | ||
LL | last = Some(s); | ||
| ^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/liveness-upvars.rs:3:9 | ||
--> $DIR/liveness-upvars.rs:4:9 | ||
| | ||
LL | #![warn(unused)] | ||
| ^^^^^^ | ||
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: unused variable: `sum` | ||
--> $DIR/liveness-upvars.rs:21:9 | ||
--> $DIR/liveness-upvars.rs:22:9 | ||
| | ||
LL | sum += x; | ||
| ^^^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value captured by `c` is never read | ||
--> $DIR/liveness-upvars.rs:31:9 | ||
--> $DIR/liveness-upvars.rs:32:9 | ||
| | ||
LL | c = 1; | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value captured by `c` is never read | ||
--> $DIR/liveness-upvars.rs:35:9 | ||
--> $DIR/liveness-upvars.rs:36:9 | ||
| | ||
LL | c = 1; | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: unused variable: `c` | ||
--> $DIR/liveness-upvars.rs:41:9 | ||
--> $DIR/liveness-upvars.rs:42:9 | ||
| | ||
LL | c += 1; | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value assigned to `c` is never read | ||
--> $DIR/liveness-upvars.rs:44:9 | ||
--> $DIR/liveness-upvars.rs:45:9 | ||
| | ||
LL | c += 1; | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: unused variable: `c` | ||
--> $DIR/liveness-upvars.rs:44:9 | ||
--> $DIR/liveness-upvars.rs:45:9 | ||
| | ||
LL | c += 1; | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value assigned to `c` is never read | ||
--> $DIR/liveness-upvars.rs:57:9 | ||
--> $DIR/liveness-upvars.rs:58:9 | ||
| | ||
LL | c += 1; | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `c` is never read | ||
--> $DIR/liveness-upvars.rs:63:9 | ||
--> $DIR/liveness-upvars.rs:64:9 | ||
| | ||
LL | c += 1; | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `d` is never read | ||
--> $DIR/liveness-upvars.rs:72:13 | ||
--> $DIR/liveness-upvars.rs:73:13 | ||
| | ||
LL | d = Some("d1"); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `e` is never read | ||
--> $DIR/liveness-upvars.rs:76:13 | ||
--> $DIR/liveness-upvars.rs:77:13 | ||
| | ||
LL | e = Some("e1"); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `e` is never read | ||
--> $DIR/liveness-upvars.rs:78:13 | ||
--> $DIR/liveness-upvars.rs:79:13 | ||
| | ||
LL | e = Some("e2"); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: unused variable: `e` | ||
--> $DIR/liveness-upvars.rs:76:13 | ||
--> $DIR/liveness-upvars.rs:77:13 | ||
| | ||
LL | e = Some("e1"); | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value assigned to `v` is never read | ||
--> $DIR/liveness-upvars.rs:86:13 | ||
--> $DIR/liveness-upvars.rs:87:13 | ||
| | ||
LL | v = T::default(); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `z` is never read | ||
--> $DIR/liveness-upvars.rs:98:17 | ||
--> $DIR/liveness-upvars.rs:99:17 | ||
| | ||
LL | z = T::default(); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: unused variable: `z` | ||
--> $DIR/liveness-upvars.rs:98:17 | ||
--> $DIR/liveness-upvars.rs:99:17 | ||
| | ||
LL | z = T::default(); | ||
| ^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: 17 warnings emitted | ||
warning: value assigned to `state` is never read | ||
--> $DIR/liveness-upvars.rs:125:9 | ||
| | ||
LL | state = 4; | ||
| ^^^^^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `state` is never read | ||
--> $DIR/liveness-upvars.rs:128:9 | ||
| | ||
LL | state = 5; | ||
| ^^^^^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: unused variable: `state` | ||
--> $DIR/liveness-upvars.rs:125:9 | ||
| | ||
LL | state = 4; | ||
| ^^^^^ | ||
| | ||
= help: did you mean to capture by reference instead? | ||
|
||
warning: value assigned to `s` is never read | ||
--> $DIR/liveness-upvars.rs:137:9 | ||
| | ||
LL | s = 1; | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: value assigned to `s` is never read | ||
--> $DIR/liveness-upvars.rs:139:9 | ||
| | ||
LL | s = yield (); | ||
| ^ | ||
| | ||
= help: maybe it is overwritten before being read? | ||
|
||
warning: 22 warnings emitted | ||
|
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.