Skip to content

Commit f65b875

Browse files
committed
remove type_ascription_path_suggestions in parser
1 parent 9569a01 commit f65b875

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -492,24 +492,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
492492
.filter(|(_, enum_ty_path)| !enum_ty_path.starts_with("std::prelude::"))
493493
.collect();
494494
if !enum_candidates.is_empty() {
495-
if let (PathSource::Type, Some(span)) =
496-
(source, self.diagnostic_metadata.current_type_ascription.last())
497-
{
498-
if self
499-
.r
500-
.tcx
501-
.sess
502-
.parse_sess
503-
.type_ascription_path_suggestions
504-
.borrow()
505-
.contains(span)
506-
{
507-
// Already reported this issue on the lhs of the type ascription.
508-
err.downgrade_to_delayed_bug();
509-
return (true, candidates);
510-
}
511-
}
512-
513495
enum_candidates.sort();
514496

515497
// Contextualize for E0412 "cannot find type", but don't belabor the point
@@ -1391,26 +1373,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
13911373
Res::Def(DefKind::Enum, def_id),
13921374
PathSource::TupleStruct(..) | PathSource::Expr(..),
13931375
) => {
1394-
if self
1395-
.diagnostic_metadata
1396-
.current_type_ascription
1397-
.last()
1398-
.map(|sp| {
1399-
self.r
1400-
.tcx
1401-
.sess
1402-
.parse_sess
1403-
.type_ascription_path_suggestions
1404-
.borrow()
1405-
.contains(&sp)
1406-
})
1407-
.unwrap_or(false)
1408-
{
1409-
err.downgrade_to_delayed_bug();
1410-
// We already suggested changing `:` into `::` during parsing.
1411-
return false;
1412-
}
1413-
14141376
self.suggest_using_enum_variant(err, source, def_id, span);
14151377
}
14161378
(Res::Def(DefKind::Struct, def_id), source) if ns == ValueNS => {

compiler/rustc_session/src/parse.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,6 @@ pub struct ParseSess {
214214
pub env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>,
215215
/// File paths accessed during the build.
216216
pub file_depinfo: Lock<FxHashSet<Symbol>>,
217-
/// All the type ascriptions expressions that have had a suggestion for likely path typo.
218-
pub type_ascription_path_suggestions: Lock<FxHashSet<Span>>,
219217
/// Whether cfg(version) should treat the current release as incomplete
220218
pub assume_incomplete_release: bool,
221219
/// Spans passed to `proc_macro::quote_span`. Each span has a numerical
@@ -258,7 +256,6 @@ impl ParseSess {
258256
reached_eof: AtomicBool::new(false),
259257
env_depinfo: Default::default(),
260258
file_depinfo: Default::default(),
261-
type_ascription_path_suggestions: Default::default(),
262259
assume_incomplete_release: false,
263260
proc_macro_quoted_spans: Default::default(),
264261
attr_id_generator: AttrIdGenerator::new(),

0 commit comments

Comments
 (0)