Fix dogfood

This commit is contained in:
Jason Newcomb 2022-06-14 11:44:43 -04:00
parent 85c1f74fef
commit 5e2a2d3ac9
4 changed files with 17 additions and 17 deletions

View File

@ -413,7 +413,7 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
.find("declare_lint_pass!")
.unwrap_or_else(|| panic!("failed to find `impl_lint_pass`"))
});
let mut impl_lint_pass_end = (&content[impl_lint_pass_start..])
let mut impl_lint_pass_end = content[impl_lint_pass_start..]
.find(']')
.expect("failed to find `impl_lint_pass` terminator");

View File

@ -911,7 +911,18 @@ fn param_auto_deref_stability(ty: Ty<'_>, precedence: i8) -> Position {
ty = ref_ty;
continue;
},
ty::Bool
ty::Infer(_)
| ty::Error(_)
| ty::Param(_)
| ty::Bound(..)
| ty::Opaque(..)
| ty::Placeholder(_)
| ty::Dynamic(..) => Position::ReborrowStable(precedence),
ty::Adt(..) if ty.has_placeholders() || ty.has_param_types_or_consts() => {
Position::ReborrowStable(precedence)
},
ty::Adt(..)
| ty::Bool
| ty::Char
| ty::Int(_)
| ty::Uint(_)
@ -929,17 +940,6 @@ fn param_auto_deref_stability(ty: Ty<'_>, precedence: i8) -> Position {
| ty::Never
| ty::Tuple(_)
| ty::Projection(_) => Position::DerefStable(precedence),
ty::Infer(_)
| ty::Error(_)
| ty::Param(_)
| ty::Bound(..)
| ty::Opaque(..)
| ty::Placeholder(_)
| ty::Dynamic(..) => Position::ReborrowStable(precedence),
ty::Adt(..) if ty.has_placeholders() || ty.has_param_types_or_consts() => {
Position::ReborrowStable(precedence)
},
ty::Adt(..) => Position::DerefStable(precedence),
};
}
}
@ -952,7 +952,7 @@ fn ty_contains_field(ty: Ty<'_>, name: Symbol) -> bool {
}
}
#[expect(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value, clippy::too_many_lines)]
fn report<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, state: State, data: StateData) {
match state {
State::DerefMethod {

View File

@ -285,7 +285,7 @@ impl<'a> NormalizedPat<'a> {
// TODO: Handle negative integers. They're currently treated as a wild match.
ExprKind::Lit(lit) => match lit.node {
LitKind::Str(sym, _) => Self::LitStr(sym),
LitKind::ByteStr(ref bytes) => Self::LitBytes(&**bytes),
LitKind::ByteStr(ref bytes) => Self::LitBytes(bytes),
LitKind::Byte(val) => Self::LitInt(val.into()),
LitKind::Char(val) => Self::LitInt(val.into()),
LitKind::Int(val, _) => Self::LitInt(val),

View File

@ -55,7 +55,7 @@ pub(crate) fn check<'a>(cx: &LateContext<'a>, ex: &Expr<'a>, arms: &[Arm<'_>], e
cx,
(ex, expr),
(bind_names, matched_vars),
&*snippet_body,
&snippet_body,
&mut applicability,
Some(span),
);
@ -88,7 +88,7 @@ pub(crate) fn check<'a>(cx: &LateContext<'a>, ex: &Expr<'a>, arms: &[Arm<'_>], e
cx,
(ex, expr),
(bind_names, matched_vars),
&*snippet_body,
&snippet_body,
&mut applicability,
None,
);