Skip to content

Commit a10251e

Browse files
committed
remove type_ascription_path_suggestions in parser
1 parent f91bd15 commit a10251e

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
@@ -1375,26 +1357,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
13751357
Res::Def(DefKind::Enum, def_id),
13761358
PathSource::TupleStruct(..) | PathSource::Expr(..),
13771359
) => {
1378-
if self
1379-
.diagnostic_metadata
1380-
.current_type_ascription
1381-
.last()
1382-
.map(|sp| {
1383-
self.r
1384-
.tcx
1385-
.sess
1386-
.parse_sess
1387-
.type_ascription_path_suggestions
1388-
.borrow()
1389-
.contains(&sp)
1390-
})
1391-
.unwrap_or(false)
1392-
{
1393-
err.downgrade_to_delayed_bug();
1394-
// We already suggested changing `:` into `::` during parsing.
1395-
return false;
1396-
}
1397-
13981360
self.suggest_using_enum_variant(err, source, def_id, span);
13991361
}
14001362
(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
@@ -213,8 +213,6 @@ pub struct ParseSess {
213213
pub env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>,
214214
/// File paths accessed during the build.
215215
pub file_depinfo: Lock<FxHashSet<Symbol>>,
216-
/// All the type ascriptions expressions that have had a suggestion for likely path typo.
217-
pub type_ascription_path_suggestions: Lock<FxHashSet<Span>>,
218216
/// Whether cfg(version) should treat the current release as incomplete
219217
pub assume_incomplete_release: bool,
220218
/// Spans passed to `proc_macro::quote_span`. Each span has a numerical
@@ -257,7 +255,6 @@ impl ParseSess {
257255
reached_eof: Lock::new(false),
258256
env_depinfo: Default::default(),
259257
file_depinfo: Default::default(),
260-
type_ascription_path_suggestions: Default::default(),
261258
assume_incomplete_release: false,
262259
proc_macro_quoted_spans: Default::default(),
263260
attr_id_generator: AttrIdGenerator::new(),

0 commit comments

Comments
 (0)