Skip to content

Commit b794b8e

Browse files
committed
Auto merge of #13086 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents ef3cfaa + 3b1266c commit b794b8e

24 files changed

+70
-64
lines changed

clippy_lints/src/assigning_clones.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for AssigningClones {
9494
},
9595
_ => return,
9696
}
97-
&& let Ok(Some(resolved_fn)) = Instance::resolve(cx.tcx, cx.param_env, fn_id, fn_gen_args)
97+
&& let Ok(Some(resolved_fn)) = Instance::try_resolve(cx.tcx, cx.param_env, fn_id, fn_gen_args)
9898
// TODO: This check currently bails if the local variable has no initializer.
9999
// That is overly conservative - the lint should fire even if there was no initializer,
100100
// but the variable has been initialized before `lhs` was evaluated.

clippy_lints/src/doc/mod.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ use clippy_utils::ty::is_type_diagnostic_item;
66
use clippy_utils::visitors::Visitable;
77
use clippy_utils::{in_constant, is_entrypoint_fn, is_trait_impl_item, method_chain_args};
88
use pulldown_cmark::Event::{
9-
Code, End, FootnoteReference, HardBreak, Html, Rule, SoftBreak, Start, TaskListMarker, Text,
9+
Code, DisplayMath, End, FootnoteReference, HardBreak, Html, InlineHtml, InlineMath, Rule, SoftBreak, Start,
10+
TaskListMarker, Text,
1011
};
1112
use pulldown_cmark::Tag::{BlockQuote, CodeBlock, FootnoteDefinition, Heading, Item, Link, Paragraph};
12-
use pulldown_cmark::{BrokenLink, CodeBlockKind, CowStr, Options};
13+
use pulldown_cmark::{BrokenLink, CodeBlockKind, CowStr, Options, TagEnd};
1314
use rustc_ast::ast::Attribute;
1415
use rustc_data_structures::fx::FxHashSet;
1516
use rustc_hir::intravisit::{self, Visitor};
@@ -659,7 +660,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
659660

660661
while let Some((event, range)) = events.next() {
661662
match event {
662-
Html(tag) => {
663+
Html(tag) | InlineHtml(tag) => {
663664
if tag.starts_with("<code") {
664665
code_level += 1;
665666
} else if tag.starts_with("</code") {
@@ -670,11 +671,11 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
670671
blockquote_level -= 1;
671672
}
672673
},
673-
Start(BlockQuote) => {
674+
Start(BlockQuote(_)) => {
674675
blockquote_level += 1;
675676
containers.push(Container::Blockquote);
676677
},
677-
End(BlockQuote) => {
678+
End(TagEnd::BlockQuote) => {
678679
blockquote_level -= 1;
679680
containers.pop();
680681
},
@@ -699,15 +700,15 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
699700
}
700701
}
701702
},
702-
End(CodeBlock(_)) => {
703+
End(TagEnd::CodeBlock) => {
703704
in_code = false;
704705
is_rust = false;
705706
ignore = false;
706707
},
707-
Start(Link(_, url, _)) => in_link = Some(url),
708-
End(Link(..)) => in_link = None,
709-
Start(Heading(_, _, _) | Paragraph | Item) => {
710-
if let Start(Heading(_, _, _)) = event {
708+
Start(Link { dest_url, .. }) => in_link = Some(dest_url),
709+
End(TagEnd::Link) => in_link = None,
710+
Start(Heading { .. } | Paragraph | Item) => {
711+
if let Start(Heading { .. }) = event {
711712
in_heading = true;
712713
}
713714
if let Start(Item) = event {
@@ -720,11 +721,11 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
720721
ticks_unbalanced = false;
721722
paragraph_range = range;
722723
},
723-
End(Heading(_, _, _) | Paragraph | Item) => {
724-
if let End(Heading(_, _, _)) = event {
724+
End(TagEnd::Heading(_) | TagEnd::Paragraph | TagEnd::Item) => {
725+
if let End(TagEnd::Heading(_)) = event {
725726
in_heading = false;
726727
}
727-
if let End(Item) = event {
728+
if let End(TagEnd::Item) = event {
728729
containers.pop();
729730
}
730731
if ticks_unbalanced && let Some(span) = fragments.span(cx, paragraph_range.clone()) {
@@ -746,8 +747,9 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
746747
text_to_check = Vec::new();
747748
},
748749
Start(FootnoteDefinition(..)) => in_footnote_definition = true,
749-
End(FootnoteDefinition(..)) => in_footnote_definition = false,
750-
Start(_tag) | End(_tag) => (), // We don't care about other tags
750+
End(TagEnd::FootnoteDefinition) => in_footnote_definition = false,
751+
Start(_) | End(_) // We don't care about other tags
752+
| TaskListMarker(_) | Code(_) | Rule | InlineMath(..) | DisplayMath(..) => (),
751753
SoftBreak | HardBreak => {
752754
if !containers.is_empty()
753755
&& let Some((next_event, next_range)) = events.peek()
@@ -766,7 +768,6 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
766768
);
767769
}
768770
},
769-
TaskListMarker(_) | Code(_) | Rule => (),
770771
FootnoteReference(text) | Text(text) => {
771772
paragraph_range.end = range.end;
772773
let range_ = range.clone();

clippy_lints/src/empty_with_brackets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare_clippy_lint! {
1616
/// and it may be desirable to do so consistently for style.
1717
///
1818
/// However, removing the brackets also introduces a public constant named after the struct,
19-
/// so this is not just a syntactic simplification but an an API change, and adding them back
19+
/// so this is not just a syntactic simplification but an API change, and adding them back
2020
/// is a *breaking* API change.
2121
///
2222
/// ### Example
@@ -44,7 +44,7 @@ declare_clippy_lint! {
4444
/// and it may be desirable to do so consistently for style.
4545
///
4646
/// However, removing the brackets also introduces a public constant named after the variant,
47-
/// so this is not just a syntactic simplification but an an API change, and adding them back
47+
/// so this is not just a syntactic simplification but an API change, and adding them back
4848
/// is a *breaking* API change.
4949
///
5050
/// ### Example

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_middle::ty::{
1515
use rustc_session::declare_lint_pass;
1616
use rustc_span::symbol::sym;
1717
use rustc_target::spec::abi::Abi;
18-
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
18+
use rustc_trait_selection::error_reporting::traits::InferCtxtExt as _;
1919

2020
declare_clippy_lint! {
2121
/// ### What it does

clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::ty::{self, AliasTy, ClauseKind, PredicateKind};
99
use rustc_session::declare_lint_pass;
1010
use rustc_span::def_id::LocalDefId;
1111
use rustc_span::{sym, Span};
12-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
12+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt;
1313
use rustc_trait_selection::traits::{self, FulfillmentError, ObligationCtxt};
1414

1515
declare_clippy_lint! {

clippy_lints/src/implied_bounds_in_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn collect_supertrait_bounds<'tcx>(cx: &LateContext<'tcx>, bounds: GenericBounds
246246
&& let [.., path] = poly_trait.trait_ref.path.segments
247247
&& poly_trait.bound_generic_params.is_empty()
248248
&& let Some(trait_def_id) = path.res.opt_def_id()
249-
&& let predicates = cx.tcx.super_predicates_of(trait_def_id).predicates
249+
&& let predicates = cx.tcx.explicit_super_predicates_of(trait_def_id).predicates
250250
// If the trait has no supertrait, there is no need to collect anything from that bound
251251
&& !predicates.is_empty()
252252
{

clippy_lints/src/methods/type_id_on_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn is_subtrait_of_any(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
2424
cx.tcx.is_diagnostic_item(sym::Any, tr.def_id)
2525
|| cx
2626
.tcx
27-
.super_predicates_of(tr.def_id)
27+
.explicit_super_predicates_of(tr.def_id)
2828
.predicates
2929
.iter()
3030
.any(|(clause, _)| {

clippy_lints/src/needless_maybe_sized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn path_to_sized_bound(cx: &LateContext<'_>, trait_bound: &PolyTraitRef<'_>) ->
9191
return true;
9292
}
9393

94-
for &(predicate, _) in cx.tcx.super_predicates_of(trait_def_id).predicates {
94+
for &(predicate, _) in cx.tcx.explicit_super_predicates_of(trait_def_id).predicates {
9595
if let ClauseKind::Trait(trait_predicate) = predicate.kind().skip_binder()
9696
&& trait_predicate.polarity == PredicatePolarity::Positive
9797
&& !path.contains(&trait_predicate.def_id())

clippy_lints/src/non_copy_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'tcx> NonCopyConst<'tcx> {
258258
// e.g. implementing `has_frozen_variant` described above, and not running this function
259259
// when the type doesn't have any frozen variants would be the 'correct' way for the 2nd
260260
// case (that actually removes another suboptimal behavior (I won't say 'false positive') where,
261-
// similar to 2., but with the a frozen variant) (e.g. borrowing
261+
// similar to 2., but with a frozen variant) (e.g. borrowing
262262
// `borrow_interior_mutable_const::enums::AssocConsts::TO_BE_FROZEN_VARIANT`).
263263
// I chose this way because unfrozen enums as assoc consts are rare (or, hopefully, none).
264264
matches!(err, ErrorHandled::TooGeneric(..))
@@ -293,7 +293,7 @@ impl<'tcx> NonCopyConst<'tcx> {
293293
ct: ty::UnevaluatedConst<'tcx>,
294294
span: Span,
295295
) -> EvalToValTreeResult<'tcx> {
296-
match ty::Instance::resolve(tcx, param_env, ct.def, ct.args) {
296+
match ty::Instance::try_resolve(tcx, param_env, ct.def, ct.args) {
297297
Ok(Some(instance)) => {
298298
let cid = GlobalId {
299299
instance,

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ fn ident_difference_expr_with_base_location(
549549
| (Assign(_, _, _), Assign(_, _, _))
550550
| (TryBlock(_), TryBlock(_))
551551
| (Await(_, _), Await(_, _))
552-
| (Gen(_, _, _), Gen(_, _, _))
552+
| (Gen(_, _, _, _), Gen(_, _, _, _))
553553
| (Block(_, _), Block(_, _))
554554
| (Closure(_), Closure(_))
555555
| (Match(_, _, _), Match(_, _, _))

0 commit comments

Comments
 (0)