Skip to content

Commit 4635369

Browse files
author
Jethro Beekman
committed
Revert "Fix early lints inside an async desugaring"
This reverts commit a74b2fb.
1 parent e6a0f3c commit 4635369

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

compiler/rustc_lint/src/early.rs

-16
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
143143
run_early_pass!(self, check_fn, fk, span, id);
144144
self.check_id(id);
145145
ast_visit::walk_fn(self, fk, span);
146-
147-
// Explicitly check for lints associated with 'closure_id', since
148-
// it does not have a corresponding AST node
149-
if let ast_visit::FnKind::Fn(_, _, sig, _, _) = fk {
150-
if let ast::Async::Yes { closure_id, .. } = sig.header.asyncness {
151-
self.check_id(closure_id);
152-
}
153-
}
154146
run_early_pass!(self, check_fn_post, fk, span, id);
155147
}
156148

@@ -216,14 +208,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
216208

217209
fn visit_expr_post(&mut self, e: &'a ast::Expr) {
218210
run_early_pass!(self, check_expr_post, e);
219-
220-
// Explicitly check for lints associated with 'closure_id', since
221-
// it does not have a corresponding AST node
222-
if let ast::ExprKind::Closure(_, asyncness, ..) = e.kind {
223-
if let ast::Async::Yes { closure_id, .. } = asyncness {
224-
self.check_id(closure_id);
225-
}
226-
}
227211
}
228212

229213
fn visit_generic_arg(&mut self, arg: &'a ast::GenericArg) {

src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// check-pass
2-
// edition:2018
32
#![warn(semicolon_in_expressions_from_macros)]
43

54
#[allow(dead_code)]
@@ -12,11 +11,6 @@ macro_rules! foo {
1211
}
1312
}
1413

15-
#[allow(semicolon_in_expressions_from_macros)]
16-
async fn bar() {
17-
foo!(first);
18-
}
19-
2014
fn main() {
2115
// This `allow` doesn't work
2216
#[allow(semicolon_in_expressions_from_macros)]

src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: trailing semicolon in macro used in expression position
2-
--> $DIR/semicolon-in-expressions-from-macros.rs:8:13
2+
--> $DIR/semicolon-in-expressions-from-macros.rs:7:13
33
|
44
LL | true;
55
| ^
@@ -8,7 +8,7 @@ LL | foo!(first)
88
| ----------- in this macro invocation
99
|
1010
note: the lint level is defined here
11-
--> $DIR/semicolon-in-expressions-from-macros.rs:3:9
11+
--> $DIR/semicolon-in-expressions-from-macros.rs:2:9
1212
|
1313
LL | #![warn(semicolon_in_expressions_from_macros)]
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | #![warn(semicolon_in_expressions_from_macros)]
1717
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1818

1919
warning: trailing semicolon in macro used in expression position
20-
--> $DIR/semicolon-in-expressions-from-macros.rs:8:13
20+
--> $DIR/semicolon-in-expressions-from-macros.rs:7:13
2121
|
2222
LL | true;
2323
| ^

0 commit comments

Comments
 (0)