Fix dogfood fallout

This commit is contained in:
Philipp Krones 2023-09-25 10:31:51 +02:00
parent 5eb7604482
commit 903add0c11
No known key found for this signature in database
GPG Key ID: 1CA0DF2AF59D68A5
3 changed files with 4 additions and 3 deletions

View File

@ -459,7 +459,7 @@ struct Fragments<'a> {
impl Fragments<'_> {
fn span(self, cx: &LateContext<'_>, range: Range<usize>) -> Option<Span> {
source_span_for_markdown_range(cx.tcx, &self.doc, &range, &self.fragments)
source_span_for_markdown_range(cx.tcx, self.doc, &range, self.fragments)
}
}
@ -513,6 +513,7 @@ fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[
const RUST_CODE: &[&str] = &["rust", "no_run", "should_panic", "compile_fail"];
#[allow(clippy::too_many_lines)] // Only a big match statement
fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize>)>>(
cx: &LateContext<'_>,
valid_idents: &FxHashSet<String>,

View File

@ -93,7 +93,7 @@ impl EarlyLintPass for RawStrings {
diag.span_suggestion(
start,
"use a string literal instead",
format!("\"{}\"", str),
format!("\"{str}\""),
Applicability::MachineApplicable,
);
} else {

View File

@ -207,7 +207,7 @@ fn path_segment_certainty(
// Checking `res_generics_def_id(..)` before calling `generics_of` avoids an ICE.
if cx.tcx.res_generics_def_id(path_segment.res).is_some() {
let generics = cx.tcx.generics_of(def_id);
let count = generics.params.len() - generics.host_effect_index.is_some() as usize;
let count = generics.params.len() - usize::from(generics.host_effect_index.is_some());
let lhs = if (parent_certainty.is_certain() || generics.parent_count == 0) && count == 0 {
Certainty::Certain(None)
} else {