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 https://github.com/rust-lang/rust/pull/34355
This commit is contained in:
Aaron Hill 2021-07-19 09:33:35 -05:00
parent 8df945c471
commit f9f238e6b8
No known key found for this signature in database
GPG key ID: B4087E510E98B164
3 changed files with 19 additions and 6 deletions

View file

@ -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() {}

View file

@ -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