Skip to content

Commit ba3cf12

Browse files
committed
remove now unnecessary match arm
1 parent e9b96f9 commit ba3cf12

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

src/librustc_resolve/late.rs

-3
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ impl<'a> PathSource<'a> {
236236
}
237237
msg
238238
}
239-
// This is a guess that `self` corresponds to the lhs.
240-
// This triggers on the lhs of `std::mem:size_of::<u32>();`.
241-
ExprKind::Type(..) => "value",
242239
_ => "function",
243240
},
244241
_ => "value",

src/librustc_resolve/late/diagnostics.rs

-48
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use rustc_span::symbol::{kw, sym, Ident};
2020
use rustc_span::{BytePos, Span};
2121

2222
use log::debug;
23-
use std::ops::Deref;
2423

2524
type Res = def::Res<ast::NodeId>;
2625

@@ -615,53 +614,6 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
615614
return false;
616615
}
617616
}
618-
(
619-
Res::Def(DefKind::Enum, def_id),
620-
PathSource::Expr(Some(Expr { kind: ExprKind::Type(expr, ty), .. })),
621-
) => {
622-
match (expr.deref(), ty.deref()) {
623-
(
624-
Expr { kind: ExprKind::Path(..), .. },
625-
Ty { kind: TyKind::Path(None, path), .. },
626-
) if path.segments.len() == 1 => {
627-
if let Some(variants) = self.collect_enum_variants(def_id) {
628-
if variants
629-
.into_iter()
630-
.filter(|variant| {
631-
variant.segments[variant.segments.len() - 1].ident
632-
== path.segments[0].ident
633-
})
634-
.next()
635-
.is_some()
636-
{
637-
err.delay_as_bug();
638-
let sp = expr.span.between(ty.span);
639-
if self
640-
.r
641-
.session
642-
.parse_sess
643-
.type_ascription_path_suggestions
644-
.borrow()
645-
.contains(&sp)
646-
{
647-
// We already suggested changing `:` into `::` during parsing.
648-
return false;
649-
}
650-
let mut err =
651-
self.r.session.struct_span_err(sp, "expected `::`, found `:`");
652-
err.span_suggestion(
653-
sp,
654-
"write a path separator instead",
655-
"::".to_string(),
656-
Applicability::MachineApplicable,
657-
);
658-
err.emit();
659-
}
660-
}
661-
}
662-
_ => {}
663-
}
664-
}
665617
(
666618
Res::Def(DefKind::Enum, def_id),
667619
PathSource::TupleStruct(_) | PathSource::Expr(..),

0 commit comments

Comments
 (0)