Skip to content

Commit ee3a078

Browse files
committed
Auto merge of #144181 - jieyouxu:rollup-61j2sar, r=jieyouxu
Rollup of 5 pull requests Successful merges: - #143960 (Tidy cleanup 2) - #144149 (docs: update link to RISC-V and Xtensa installation guide) - #144152 (Rename `optional-mingw-check-1` to `optional-pr-check-1`) - #144178 (Fix clippy lints in librustdoc) - #144180 (fix load-bearing typo) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0d95920 + a8daf4c commit ee3a078

33 files changed

+272
-293
lines changed

library/coretests/tests/iter/adapters/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fn test_double_ended_zip() {
273273

274274
#[test]
275275
#[cfg(panic = "unwind")]
276-
/// Regresion test for #137255
276+
/// Regression test for #137255
277277
/// A previous implementation of Zip TrustedRandomAccess specializations tried to do a lot of work
278278
/// to preserve side-effects of equalizing the iterator lengths during backwards iteration.
279279
/// This lead to several cases of unsoundness, twice due to being left in an inconsistent state

src/ci/github-actions/jobs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ try:
172172
optional:
173173
# This job is used just to test optional jobs.
174174
# It will be replaced by tier 2 and tier 3 jobs in the future.
175-
- name: optional-mingw-check-1
175+
- name: optional-pr-check-1
176176
env:
177-
IMAGE: mingw-check-1
177+
IMAGE: pr-check-1
178178
<<: *job-linux-4c
179179

180180
# Main CI jobs that have to be green to merge a commit into master

src/doc/rustc/src/platform-support/xtensa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Xtensa targets that support `std` are documented in the [ESP-IDF platform suppor
2424

2525
## Building the targets
2626

27-
The targets can be built by installing the [Xtensa enabled Rust channel](https://github.com/esp-rs/rust/). See instructions in the [RISC-V and Xtensa Targets section of The Rust on ESP Book](https://docs.esp-rs.org/book/installation/riscv-and-xtensa.html).
27+
The targets can be built by installing the [Xtensa enabled Rust channel](https://github.com/esp-rs/rust/). See instructions in the [RISC-V and Xtensa Targets section of The Rust on ESP Book](https://docs.espressif.com/projects/rust/book/installation/index.html).

src/librustdoc/clean/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ impl Type {
16771677
}
16781678
}
16791679

1680-
pub(crate) fn generics<'a>(&'a self) -> Option<impl Iterator<Item = &'a Type>> {
1680+
pub(crate) fn generics(&self) -> Option<impl Iterator<Item = &Type>> {
16811681
match self {
16821682
Type::Path { path, .. } => path.generics(),
16831683
_ => None,
@@ -2227,7 +2227,7 @@ impl Path {
22272227
self.segments.last().map(|seg| &seg.args)
22282228
}
22292229

2230-
pub(crate) fn generics<'a>(&'a self) -> Option<impl Iterator<Item = &'a Type>> {
2230+
pub(crate) fn generics(&self) -> Option<impl Iterator<Item = &Type>> {
22312231
self.segments.last().and_then(|seg| {
22322232
if let GenericArgs::AngleBracketed { ref args, .. } = seg.args {
22332233
Some(args.iter().filter_map(|arg| match arg {

src/librustdoc/clean/utils.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,11 @@ pub(crate) fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
343343
pub(crate) fn print_const(cx: &DocContext<'_>, n: ty::Const<'_>) -> String {
344344
match n.kind() {
345345
ty::ConstKind::Unevaluated(ty::UnevaluatedConst { def, args: _ }) => {
346-
let s = if let Some(def) = def.as_local() {
346+
if let Some(def) = def.as_local() {
347347
rendered_const(cx.tcx, cx.tcx.hir_body_owned_by(def), def)
348348
} else {
349349
inline::print_inlined_const(cx.tcx, def)
350-
};
351-
352-
s
350+
}
353351
}
354352
// array lengths are obviously usize
355353
ty::ConstKind::Value(cv) if *cv.ty.kind() == ty::Uint(ty::UintTy::Usize) => {

src/librustdoc/doctest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ fn run_test(
632632
// the user to exploit nightly-only features on stable
633633
runner_compiler.env("RUSTC_BOOTSTRAP", "1");
634634
runner_compiler.args(compiler_args);
635-
runner_compiler.args(&["--crate-type=bin", "-o"]).arg(&output_file);
635+
runner_compiler.args(["--crate-type=bin", "-o"]).arg(&output_file);
636636
let mut extern_path = std::ffi::OsString::from(format!(
637637
"--extern=doctest_bundle_{edition}=",
638638
edition = doctest.edition
@@ -657,7 +657,7 @@ fn run_test(
657657
extern_path.push(&output_bundle_file);
658658
runner_compiler.arg(extern_path);
659659
runner_compiler.arg(&runner_input_file);
660-
if std::fs::write(&runner_input_file, &merged_test_code).is_err() {
660+
if std::fs::write(&runner_input_file, merged_test_code).is_err() {
661661
// If we cannot write this file for any reason, we leave. All combined tests will be
662662
// tested as standalone tests.
663663
return Err(TestFailure::CompileError);

src/librustdoc/doctest/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl HirCollector<'_> {
140140
.iter()
141141
.filter(|a| a.has_name(sym::attr))
142142
.flat_map(|a| a.meta_item_list().unwrap_or_default())
143-
.map(|i| pprust::meta_list_item_to_string(i))
143+
.map(pprust::meta_list_item_to_string)
144144
{
145145
// Add the additional attributes to the global_crate_attrs vector
146146
self.collector.global_crate_attrs.push(attr);

src/librustdoc/formats/renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn run_format_inner<'tcx, T: FormatRenderer<'tcx>>(
8181
let _timer =
8282
prof.generic_activity_with_arg("render_mod_item", item.name.unwrap().to_string());
8383

84-
cx.mod_item_in(&item)?;
84+
cx.mod_item_in(item)?;
8585
let (clean::StrippedItem(box clean::ModuleItem(ref module))
8686
| clean::ModuleItem(ref module)) = item.inner.kind
8787
else {
@@ -99,7 +99,7 @@ fn run_format_inner<'tcx, T: FormatRenderer<'tcx>>(
9999
} else if let Some(item_name) = item.name
100100
&& !item.is_extern_crate()
101101
{
102-
prof.generic_activity_with_arg("render_item", item_name.as_str()).run(|| cx.item(&item))?;
102+
prof.generic_activity_with_arg("render_item", item_name.as_str()).run(|| cx.item(item))?;
103103
}
104104
Ok(())
105105
}

src/librustdoc/html/format.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ impl clean::Generics {
114114
let real_params =
115115
fmt::from_fn(|f| real_params.clone().map(|g| g.print(cx)).joined(", ", f));
116116
if f.alternate() {
117-
write!(f, "<{:#}>", real_params)
117+
write!(f, "<{real_params:#}>")
118118
} else {
119-
write!(f, "&lt;{}&gt;", real_params)
119+
write!(f, "&lt;{real_params}&gt;")
120120
}
121121
})
122122
}
@@ -594,7 +594,7 @@ pub(crate) fn href_with_root_path(
594594
}
595595
}
596596
};
597-
let url_parts = make_href(root_path, shortty, url_parts, &fqp, is_remote);
597+
let url_parts = make_href(root_path, shortty, url_parts, fqp, is_remote);
598598
Ok((url_parts, shortty, fqp.clone()))
599599
}
600600

@@ -1115,7 +1115,7 @@ impl clean::Impl {
11151115
{
11161116
let last = ty.last();
11171117
if f.alternate() {
1118-
write!(f, "{}<", last)?;
1118+
write!(f, "{last}<")?;
11191119
self.print_type(inner_type, f, use_absolute, cx)?;
11201120
write!(f, ">")?;
11211121
} else {
@@ -1219,7 +1219,7 @@ pub(crate) fn print_params(params: &[clean::Parameter], cx: &Context<'_>) -> imp
12191219
.map(|param| {
12201220
fmt::from_fn(|f| {
12211221
if let Some(name) = param.name {
1222-
write!(f, "{}: ", name)?;
1222+
write!(f, "{name}: ")?;
12231223
}
12241224
param.type_.print(cx).fmt(f)
12251225
})
@@ -1341,7 +1341,7 @@ impl clean::FnDecl {
13411341
write!(f, "const ")?;
13421342
}
13431343
if let Some(name) = param.name {
1344-
write!(f, "{}: ", name)?;
1344+
write!(f, "{name}: ")?;
13451345
}
13461346
param.type_.print(cx).fmt(f)?;
13471347
}

src/librustdoc/html/highlight.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'a> Iterator for TokenIter<'a> {
547547
fn get_real_ident_class(text: &str, allow_path_keywords: bool) -> Option<Class> {
548548
let ignore: &[&str] =
549549
if allow_path_keywords { &["self", "Self", "super", "crate"] } else { &["self", "Self"] };
550-
if ignore.iter().any(|k| *k == text) {
550+
if ignore.contains(&text) {
551551
return None;
552552
}
553553
Some(match text {
@@ -1159,7 +1159,7 @@ fn string_without_closing_tag<T: Display>(
11591159
return Some("</a>");
11601160
}
11611161
if !open_tag {
1162-
write!(out, "{}", text_s).unwrap();
1162+
out.write_str(&text_s).unwrap();
11631163
return None;
11641164
}
11651165
let klass_s = klass.as_html();

0 commit comments

Comments
 (0)