Skip to content

Commit 42ecd46

Browse files
committed
assert impossible branch is impossible
1 parent ee44706 commit 42ecd46

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_resolve/src/ident.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,10 +743,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
743743

744744
let ambiguity_error_kind = if is_builtin(innermost_res) || is_builtin(res) {
745745
Some(AmbiguityKind::BuiltinAttr)
746-
} else if innermost_res == derive_helper_compat
747-
|| res == derive_helper_compat && innermost_res != derive_helper
748-
{
746+
} else if innermost_res == derive_helper_compat {
749747
Some(AmbiguityKind::DeriveHelper)
748+
} else if res == derive_helper_compat && innermost_res != derive_helper {
749+
span_bug!(
750+
orig_ident.span,
751+
"impossible inner resolution kind"
752+
)
750753
} else if innermost_flags.contains(Flags::MACRO_RULES)
751754
&& flags.contains(Flags::MODULE)
752755
&& !self.disambiguate_macro_rules_vs_modularized(innermost_binding, binding)

0 commit comments

Comments
 (0)