Skip to content

Commit 1b8637e

Browse files
committed
Auto merge of rust-lang#3014 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 0866cd6 + f7f7d54 commit 1b8637e

35 files changed

+45
-52
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ fn in_postfix_position<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> boo
800800
&& parent.span.ctxt() == e.span.ctxt()
801801
{
802802
match parent.kind {
803-
ExprKind::Call(child, _) | ExprKind::MethodCall(_, child, _, _) | ExprKind::Index(child, _)
803+
ExprKind::Call(child, _) | ExprKind::MethodCall(_, child, _, _) | ExprKind::Index(child, _, _)
804804
if child.hir_id == e.hir_id => true,
805805
ExprKind::Field(_, _) | ExprKind::Match(_, _, MatchSource::TryDesugar | MatchSource::AwaitDesugar) => true,
806806
_ => false,

clippy_lints/src/doc.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_ast::token::CommentKind;
1616
use rustc_data_structures::fx::FxHashSet;
1717
use rustc_data_structures::sync::Lrc;
1818
use rustc_errors::emitter::EmitterWriter;
19-
use rustc_errors::{Applicability, Handler, SuggestionStyle, TerminalUrl};
19+
use rustc_errors::{Applicability, Handler, SuggestionStyle};
2020
use rustc_hir as hir;
2121
use rustc_hir::intravisit::{self, Visitor};
2222
use rustc_hir::{AnonConst, Expr};
@@ -718,16 +718,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
718718
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
719719
let emitter = EmitterWriter::new(
720720
Box::new(io::sink()),
721-
None,
722-
None,
723721
fallback_bundle,
724-
false,
725-
false,
726-
false,
727-
None,
728-
false,
729-
false,
730-
TerminalUrl::No,
731722
);
732723
let handler = Handler::with_emitter(Box::new(emitter)).disable_warnings();
733724
let sess = ParseSess::with_span_handler(handler, sm);

clippy_lints/src/functions/must_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn is_mutated_static(e: &hir::Expr<'_>) -> bool {
221221
match e.kind {
222222
Path(QPath::Resolved(_, path)) => !matches!(path.res, Res::Local(_)),
223223
Path(_) => true,
224-
Field(inner, _) | Index(inner, _) => is_mutated_static(inner),
224+
Field(inner, _) | Index(inner, _, _) => is_mutated_static(inner),
225225
_ => false,
226226
}
227227
}

clippy_lints/src/index_refutable_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
254254
// Checking for slice indexing
255255
let parent_id = map.parent_id(expr.hir_id);
256256
if let Some(hir::Node::Expr(parent_expr)) = map.find(parent_id);
257-
if let hir::ExprKind::Index(_, index_expr) = parent_expr.kind;
257+
if let hir::ExprKind::Index(_, index_expr, _) = parent_expr.kind;
258258
if let Some(Constant::Int(index_value)) = constant(cx, cx.typeck_results(), index_expr);
259259
if let Ok(index_value) = index_value.try_into();
260260
if index_value < max_suggested_slice;

clippy_lints/src/indexing_slicing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
103103
return;
104104
}
105105

106-
if let ExprKind::Index(array, index) = &expr.kind {
106+
if let ExprKind::Index(array, index, _) = &expr.kind {
107107
let note = "the suggestion might not be applicable in constant blocks";
108108
let ty = cx.typeck_results().expr_ty(array).peel_refs();
109109
if let Some(range) = higher::Range::hir(index) {

clippy_lints/src/loops/manual_memcpy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ pub(super) fn check<'tcx>(
6060
o.and_then(|(lhs, rhs)| {
6161
let rhs = fetch_cloned_expr(rhs);
6262
if_chain! {
63-
if let ExprKind::Index(base_left, idx_left) = lhs.kind;
64-
if let ExprKind::Index(base_right, idx_right) = rhs.kind;
63+
if let ExprKind::Index(base_left, idx_left, _) = lhs.kind;
64+
if let ExprKind::Index(base_right, idx_right, _) = rhs.kind;
6565
if let Some(ty) = get_slice_like_element_ty(cx, cx.typeck_results().expr_ty(base_left));
6666
if get_slice_like_element_ty(cx, cx.typeck_results().expr_ty(base_right)).is_some();
6767
if let Some((start_left, offset_left)) = get_details_from_idx(cx, idx_left, &starts);

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
319319

320320
if_chain! {
321321
// an index op
322-
if let ExprKind::Index(seqexpr, idx) = expr.kind;
322+
if let ExprKind::Index(seqexpr, idx, _) = expr.kind;
323323
if !self.check(idx, seqexpr, expr);
324324
then {
325325
return;

clippy_lints/src/loops/never_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn never_loop_expr<'tcx>(
162162
ExprKind::Binary(_, e1, e2)
163163
| ExprKind::Assign(e1, e2, _)
164164
| ExprKind::AssignOp(_, e1, e2)
165-
| ExprKind::Index(e1, e2) => never_loop_expr_all(cx, &mut [e1, e2].iter().copied(), ignore_ids, main_loop_id),
165+
| ExprKind::Index(e1, e2, _) => never_loop_expr_all(cx, &mut [e1, e2].iter().copied(), ignore_ids, main_loop_id),
166166
ExprKind::Loop(b, _, _, _) => {
167167
// Break can come from the inner loop so remove them.
168168
absorb_break(never_loop_block(cx, b, ignore_ids, main_loop_id))

clippy_lints/src/loops/while_let_on_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn try_parse_iter_expr(cx: &LateContext<'_>, mut e: &Expr<'_>) -> Option<IterExp
113113

114114
// Shouldn't have side effects, but there's no way to trace which field is used. So forget which fields have
115115
// already been seen.
116-
ExprKind::Index(base, idx) if !idx.can_have_side_effects() => {
116+
ExprKind::Index(base, idx, _) if !idx.can_have_side_effects() => {
117117
can_move = false;
118118
fields.clear();
119119
e = base;

clippy_lints/src/manual_strip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn find_stripping<'tcx>(
204204
if_chain! {
205205
if is_ref_str(self.cx, ex);
206206
let unref = peel_ref(ex);
207-
if let ExprKind::Index(indexed, index) = &unref.kind;
207+
if let ExprKind::Index(indexed, index, _) = &unref.kind;
208208
if let Some(higher::Range { start, end, .. }) = higher::Range::hir(index);
209209
if let ExprKind::Path(path) = &indexed.kind;
210210
if self.cx.qpath_res(path, ex.hir_id) == self.target;

0 commit comments

Comments
 (0)