Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const_generics: assert resolve hack causes an error #79236

Merged
merged 2 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<'a> Resolver<'a> {
_ => {
bug!(
"GenericParamsFromOuterFunction should only be used with Res::SelfTy, \
DefKind::TyParam"
DefKind::TyParam or DefKind::ConstParam"
);
}
}
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,7 @@ impl<'a> Resolver<'a> {
span: Span,
all_ribs: &[Rib<'a>],
) -> Res {
const CG_BUG_STR: &str = "min_const_generics resolve check didn't stop compilation";
debug!("validate_res_from_ribs({:?})", res);
let ribs = &all_ribs[rib_index + 1..];

Expand Down Expand Up @@ -2639,6 +2640,8 @@ impl<'a> Resolver<'a> {
},
);
}

self.session.delay_span_bug(span, CG_BUG_STR);
return Res::Err;
}
}
Expand Down Expand Up @@ -2720,6 +2723,8 @@ impl<'a> Resolver<'a> {
},
);
}

self.session.delay_span_bug(span, CG_BUG_STR);
return Res::Err;
}

Expand Down