Fix dogfood errors

This commit is contained in:
flip1995 2020-11-20 10:06:26 +01:00
parent dd4e471b3f
commit 5ee0a400fc
No known key found for this signature in database
GPG key ID: 1CA0DF2AF59D68A5
2 changed files with 2 additions and 3 deletions

View file

@ -73,7 +73,7 @@ declare_lint_pass!(PanicUnimplemented => [UNIMPLEMENTED, UNREACHABLE, TODO, PANI
impl<'tcx> LateLintPass<'tcx> for PanicUnimplemented {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if let Some(_) = match_panic_call(cx, expr) {
if match_panic_call(cx, expr).is_some() {
let span = get_outer_span(expr);
if is_expn_of(expr.span, "unimplemented").is_some() {
span_lint(

View file

@ -110,8 +110,7 @@ pub fn eq_expr_opt(l: &Option<P<Expr>>, r: &Option<P<Expr>>) -> bool {
pub fn eq_struct_rest(l: &StructRest, r: &StructRest) -> bool {
match (l, r) {
(StructRest::Base(lb), StructRest::Base(rb)) => eq_expr(lb, rb),
(StructRest::Rest(_), StructRest::Rest(_)) => true,
(StructRest::None, StructRest::None) => true,
(StructRest::Rest(_), StructRest::Rest(_)) | (StructRest::None, StructRest::None) => true,
_ => false,
}
}