Skip to content

Commit 2d27932

Browse files
committed
remove EarlySyntaxWarning for type ascription
1 parent b002c9f commit 2d27932

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use rustc_ast as ast;
22
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
33
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
44
use rustc_ast::{PatKind, RangeEnd};
5-
use rustc_errors::StashKey;
65
use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP};
76
use rustc_session::parse::{feature_err, feature_err_issue, feature_warn};
87
use rustc_session::Session;
@@ -380,19 +379,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
380379

381380
fn visit_expr(&mut self, e: &'a ast::Expr) {
382381
match e.kind {
383-
ast::ExprKind::Type(..) => {
384-
if self.sess.parse_sess.span_diagnostic.err_count() > 0 {
385-
// And if it isn't, cancel the early-pass warning.
386-
if let Some(err) = self
387-
.sess
388-
.parse_sess
389-
.span_diagnostic
390-
.steal_diagnostic(e.span, StashKey::EarlySyntaxWarning)
391-
{
392-
err.cancel()
393-
}
394-
}
395-
}
396382
ast::ExprKind::TryBlock(_) => {
397383
gate_feature_post!(&self, try_blocks, e.span, "`try` expression is experimental");
398384
}

0 commit comments

Comments
 (0)