We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9e6023 commit 5f07fd2Copy full SHA for 5f07fd2
compiler/rustc_lint/src/unused.rs
@@ -1358,6 +1358,10 @@ impl EarlyLintPass for UnusedParens {
1358
false
1359
};
1360
1361
+ // In edition 2015, dyn is a contextual keyword and `dyn::foo::Bar` is
1362
+ // parsed as a path, so parens are necessary to disambiguate. See
1363
+ // - tests/ui/lint/unused/unused-parens-trait-obj-e2015.rs and
1364
+ // - https://doc.rust-lang.org/reference/types/trait-object.html#r-type.trait-object.syntax-edition2018
1365
let dyn2015_exception = cx.sess().psess.edition == Edition2015
1366
&& matches!(ty.kind, ast::TyKind::TraitObject(..))
1367
&& i == 0
0 commit comments