Skip to content

Commit 0f8eabd

Browse files
committed
Auto merge of rust-lang#13302 - Jarcho:rustup, r=Jarcho
Rustup r? ghost changelog: none
2 parents 30e0b69 + 0196e2d commit 0f8eabd

23 files changed

+31
-25
lines changed

clippy_dev/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(rustc_private)]
12
// warn on lints, that are included in `rust-lang/rust`s bootstrap
23
#![warn(rust_2018_idioms, unused_lifetimes)]
34

clippy_lints/src/casts/fn_to_numeric_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1515
}
1616

1717
match cast_from.kind() {
18-
ty::FnDef(..) | ty::FnPtr(_) => {
18+
ty::FnDef(..) | ty::FnPtr(..) => {
1919
let mut applicability = Applicability::MaybeIncorrect;
2020
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "x", &mut applicability);
2121
let to_nbits = utils::int_ty_to_nbits(cast_to, cx.tcx);

clippy_lints/src/casts/fn_to_numeric_cast_any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1414
_ => { /* continue to checks */ },
1515
}
1616

17-
if let ty::FnDef(..) | ty::FnPtr(_) = cast_from.kind() {
17+
if let ty::FnDef(..) | ty::FnPtr(..) = cast_from.kind() {
1818
let mut applicability = Applicability::MaybeIncorrect;
1919
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "..", &mut applicability);
2020

clippy_lints/src/casts/fn_to_numeric_cast_with_truncation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1414
_ => return,
1515
}
1616
match cast_from.kind() {
17-
ty::FnDef(..) | ty::FnPtr(_) => {
17+
ty::FnDef(..) | ty::FnPtr(..) => {
1818
let mut applicability = Applicability::MaybeIncorrect;
1919
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "x", &mut applicability);
2020

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn fn_sig_opt<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<PolyFnSig<'
236236
// We can't use `Ty::fn_sig` because it automatically performs args, this may result in FNs.
237237
match node_ty.kind() {
238238
ty::FnDef(def_id, _) => Some(cx.tcx.fn_sig(*def_id).instantiate_identity()),
239-
ty::FnPtr(fn_sig) => Some(*fn_sig),
239+
ty::FnPtr(sig_tys, hdr) => Some(sig_tys.with(*hdr)),
240240
_ => None,
241241
}
242242
}

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl TyCoercionStability {
872872
| ty::Pat(..)
873873
| ty::Float(_)
874874
| ty::RawPtr(..)
875-
| ty::FnPtr(_)
875+
| ty::FnPtr(..)
876876
| ty::Str
877877
| ty::Slice(..)
878878
| ty::Adt(..)

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn check_clousure<'tcx>(cx: &LateContext<'tcx>, outer_receiver: Option<&Expr<'tc
158158

159159
cx.tcx.fn_sig(def).skip_binder().skip_binder()
160160
},
161-
ty::FnPtr(sig) => sig.skip_binder(),
161+
ty::FnPtr(sig_tys, hdr) => sig_tys.with(*hdr).skip_binder(),
162162
ty::Closure(_, subs) => cx
163163
.tcx
164164
.signature_unclosure(subs.as_closure().sig(), Safety::Safe)

clippy_lints/src/methods/map_flatten.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn try_get_caller_ty_name_and_method_name(
5858
fn is_map_to_option(cx: &LateContext<'_>, map_arg: &Expr<'_>) -> bool {
5959
let map_closure_ty = cx.typeck_results().expr_ty(map_arg);
6060
match map_closure_ty.kind() {
61-
ty::Closure(_, _) | ty::FnDef(_, _) | ty::FnPtr(_) => {
61+
ty::Closure(_, _) | ty::FnDef(_, _) | ty::FnPtr(..) => {
6262
let map_closure_sig = match map_closure_ty.kind() {
6363
ty::Closure(_, args) => args.as_closure().sig(),
6464
_ => map_closure_ty.fn_sig(cx.tcx),

clippy_lints/src/mixed_read_write_in_expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
166166
ExprKind::Call(func, _) => {
167167
let typ = self.cx.typeck_results().expr_ty(func);
168168
match typ.kind() {
169-
ty::FnDef(..) | ty::FnPtr(_) => {
169+
ty::FnDef(..) | ty::FnPtr(..) => {
170170
let sig = typ.fn_sig(self.cx.tcx);
171171
if self.cx.tcx.instantiate_bound_regions_with_erased(sig).output().kind() == &ty::Never {
172172
self.report_diverging_sub_expr(e);

clippy_lints/src/multiple_unsafe_ops_per_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn collect_unsafe_exprs<'tcx>(
130130
ExprKind::Call(path_expr, _) => {
131131
let sig = match *cx.typeck_results().expr_ty(path_expr).kind() {
132132
ty::FnDef(id, _) => cx.tcx.fn_sig(id).skip_binder(),
133-
ty::FnPtr(sig) => sig,
133+
ty::FnPtr(sig_tys, hdr) => sig_tys.with(hdr),
134134
_ => return Continue(Descend::Yes),
135135
};
136136
if sig.safety() == Safety::Unsafe {

0 commit comments

Comments
 (0)