-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove ObsoleteInPlace
#60803
Merged
Merged
Remove ObsoleteInPlace
#60803
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 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 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 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 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 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 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 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 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 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,18 +1,19 @@ | ||
error: emplacement syntax is obsolete (for now, anyway) | ||
--> $DIR/bad.rs:9:5 | ||
| | ||
LL | x <- y; | ||
| ^^^^^^ | ||
| | ||
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911> | ||
|
||
error: emplacement syntax is obsolete (for now, anyway) | ||
error: expected expression, found keyword `in` | ||
--> $DIR/bad.rs:10:5 | ||
| | ||
LL | in(foo) { bar }; | ||
| ^^^^^^^^^^^^^^^ | ||
| ^^ expected expression | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/bad.rs:9:8 | ||
| | ||
LL | let (x, y, foo, bar); | ||
| ---------------- consider giving the pattern a type | ||
LL | x <- y; | ||
| ^^^ cannot infer type | ||
| | ||
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911> | ||
= note: type must be known at this point | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
// Check that `<-` and `in` syntax gets a hard error. | ||
|
||
// revisions: good bad | ||
//[good] run-pass | ||
|
||
#[cfg(bad)] | ||
fn main() { | ||
let (x, y, foo, bar); | ||
x <- y; //[bad]~ ERROR emplacement syntax is obsolete | ||
in(foo) { bar }; //[bad]~ ERROR emplacement syntax is obsolete | ||
fn foo() { | ||
let (x, y) = (0, 0); | ||
x <- y; //~ ERROR expected one of | ||
//~^ ERROR mismatched types | ||
} | ||
|
||
#[cfg(good)] | ||
fn main() { | ||
let (foo, bar) = (0, 0); | ||
in(foo) { bar }; //~ ERROR expected expression, found keyword `in` | ||
} |
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,27 @@ | ||
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `<-` | ||
--> $DIR/bad.rs:5:7 | ||
| | ||
LL | x <- y; | ||
| ^^ expected one of 8 possible tokens here | ||
|
||
error: expected expression, found keyword `in` | ||
--> $DIR/bad.rs:11:5 | ||
| | ||
LL | in(foo) { bar }; | ||
| ^^ expected expression | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/bad.rs:5:5 | ||
| | ||
LL | fn foo() { | ||
| - possibly return type missing here? | ||
LL | let (x, y) = (0, 0); | ||
LL | x <- y; | ||
| ^ expected (), found integer | ||
| | ||
= note: expected type `()` | ||
found type `{integer}` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
fn main() { | ||
let x = -5; | ||
if x<-1 { | ||
//~^ ERROR emplacement syntax is obsolete | ||
if x<-1 { //~ ERROR expected `{`, found `<-` | ||
println!("ok"); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,10 @@ | ||
error: emplacement syntax is obsolete (for now, anyway) | ||
--> $DIR/placement-syntax.rs:3:8 | ||
error: expected `{`, found `<-` | ||
--> $DIR/placement-syntax.rs:3:9 | ||
| | ||
LL | if x<-1 { | ||
| ^^^^ | ||
| | ||
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911> | ||
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` | ||
| | ||
LL | if x< -1 { | ||
| ^^^ | ||
| -- ^^ expected `{` | ||
| | | ||
| this `if` statement has a condition, but no block | ||
|
||
error: aborting due to previous error | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a shame that we lost this suggestion...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added #62632 to track this.