forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove special case for
ExprKind::Paren
in MutVisitor
The special case breaks several useful invariants (`ExpnId`s are globally unique, and never change). This special case was added back in 2016 in rust-lang#34355
- Loading branch information
Showing
3 changed files
with
19 additions
and
6 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
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,9 @@ | ||
// check-pass | ||
// Tests that we properly lint at 'paren' expressions | ||
|
||
fn foo() -> Result<(), String> { | ||
(try!(Ok::<u8, String>(1))); //~ WARN use of deprecated macro `try` | ||
Ok(()) | ||
} | ||
|
||
fn main() {} |
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,10 @@ | ||
warning: use of deprecated macro `try`: use the `?` operator instead | ||
--> $DIR/issue-87274-paren-parent.rs:5:6 | ||
| | ||
LL | (try!(Ok::<u8, String>(1))); | ||
| ^^^ | ||
| | ||
= note: `#[warn(deprecated)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|