Skip to content

Commit 12e283b

Browse files
committed
Revert unconditional emission of generic collision diagnostic
Emission of this diagnostic became unconditional in 8e83a57, prior to which it was sometimes suppressed in rustdoc, in order that colliding lifetimes would resolve to `LifetimeRes::Error` (which now requires an `ErrorGuaranteed`). However, that case was already caught and for lifetime errors the code was already unreachable.
1 parent f9725d5 commit 12e283b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

compiler/rustc_resolve/src/late.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,13 +3068,9 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
30683068
Entry::Occupied(entry) => {
30693069
let span = *entry.get();
30703070
let err = ResolutionError::NameAlreadyUsedInParameterList(ident, span);
3071-
let guar = self.r.report_error(param.ident.span, err);
3071+
let guar = self.report_error(param.ident.span, err);
30723072
let rib = match param.kind {
3073-
GenericParamKind::Lifetime => {
3074-
// Record lifetime res, so lowering knows there is something fishy.
3075-
self.record_lifetime_param(param.id, LifetimeRes::Error(guar));
3076-
continue;
3077-
}
3073+
GenericParamKind::Lifetime => unreachable!(), // handled by `if let` above
30783074
GenericParamKind::Type { .. } => &mut function_type_rib,
30793075
GenericParamKind::Const { .. } => &mut function_value_rib,
30803076
};

0 commit comments

Comments
 (0)