Skip to content

Commit ab37a83

Browse files
committed
Auto merge of rust-lang#102558 - matthiaskrgr:rollup-0odec1c, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#102195 (Improve the COPYRIGHT file) - rust-lang#102313 (Update docs so that deprecated method points to relevant method) - rust-lang#102353 (Allow passing rustix_use_libc cfg using RUSTFLAGS) - rust-lang#102405 (Remove a FIXME whose code got moved away in rust-lang#62883.) - rust-lang#102525 (rustdoc: remove orphaned link on array bracket) - rust-lang#102557 (fix issue with x.py setup running into explicit panic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents b34cff1 + c6d4421 commit ab37a83

File tree

10 files changed

+328
-174
lines changed

10 files changed

+328
-174
lines changed

Diff for: COPYRIGHT

+271-161
Large diffs are not rendered by default.

Diff for: library/core/src/result.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2066,9 +2066,6 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
20662066
/// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16.
20672067
#[inline]
20682068
fn from_iter<I: IntoIterator<Item = Result<A, E>>>(iter: I) -> Result<V, E> {
2069-
// FIXME(#11084): This could be replaced with Iterator::scan when this
2070-
// performance bug is closed.
2071-
20722069
iter::try_process(iter.into_iter(), |i| i.collect())
20732070
}
20742071
}

Diff for: library/std/src/thread/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ pub fn panicking() -> bool {
779779
panicking::panicking()
780780
}
781781

782+
/// Use [`sleep`].
783+
///
782784
/// Puts the current thread to sleep for at least the specified amount of time.
783785
///
784786
/// The thread may sleep longer than the duration specified due to scheduling

Diff for: src/bootstrap/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
229229
// FIXME: Used by proc-macro2, but we should not be triggering on external dependencies.
230230
(Some(Mode::Rustc), "span_locations", None),
231231
(Some(Mode::ToolRustc), "span_locations", None),
232+
// Can be passed in RUSTFLAGS to prevent direct syscalls in rustix.
233+
(None, "rustix_use_libc", None),
232234
];
233235

234236
/// A structure representing a Rust compiler.
@@ -654,8 +656,6 @@ impl Build {
654656
job::setup(self);
655657
}
656658

657-
// Download rustfmt early so that it can be used in rust-analyzer configs.
658-
let _ = &builder::Builder::new(&self).initial_rustfmt();
659659
self.maybe_update_submodules();
660660

661661
if let Subcommand::Format { check, paths } = &self.config.cmd {
@@ -670,6 +670,9 @@ impl Build {
670670
return setup::setup(&self.config, *profile);
671671
}
672672

673+
// Download rustfmt early so that it can be used in rust-analyzer configs.
674+
let _ = &builder::Builder::new(&self).initial_rustfmt();
675+
673676
{
674677
let builder = builder::Builder::new(&self);
675678
if let Some(path) = builder.paths.get(0) {

Diff for: src/librustdoc/html/format.rs

+18-8
Original file line numberDiff line numberDiff line change
@@ -1010,15 +1010,25 @@ fn fmt_type<'cx>(
10101010
write!(f, "]")
10111011
}
10121012
},
1013-
clean::Array(ref t, ref n) => {
1014-
primitive_link(f, PrimitiveType::Array, "[", cx)?;
1015-
fmt::Display::fmt(&t.print(cx), f)?;
1016-
if f.alternate() {
1017-
primitive_link(f, PrimitiveType::Array, &format!("; {}]", n), cx)
1018-
} else {
1019-
primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(n)), cx)
1013+
clean::Array(ref t, ref n) => match **t {
1014+
clean::Generic(name) if !f.alternate() => primitive_link(
1015+
f,
1016+
PrimitiveType::Array,
1017+
&format!("[{name}; {n}]", n = Escape(n)),
1018+
cx,
1019+
),
1020+
_ => {
1021+
write!(f, "[")?;
1022+
fmt::Display::fmt(&t.print(cx), f)?;
1023+
if f.alternate() {
1024+
write!(f, "; {n}")?;
1025+
} else {
1026+
write!(f, "; ")?;
1027+
primitive_link(f, PrimitiveType::Array, &format!("{n}", n = Escape(n)), cx)?;
1028+
}
1029+
write!(f, "]")
10201030
}
1021-
}
1031+
},
10221032
clean::RawPointer(m, ref t) => {
10231033
let m = match m {
10241034
hir::Mutability::Mut => "mut",

Diff for: src/test/rustdoc/array-links.link_box_generic.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<code>pub fn delta&lt;T&gt;() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;<a class="primitive" href="{{channel}}/core/primitive.array.html">[T; 1]</a>&gt;</code>

Diff for: src/test/rustdoc/array-links.link_box_u32.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<code>pub fn gamma() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;[<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]&gt;</code>

Diff for: src/test/rustdoc/array-links.link_slice_generic.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="{{channel}}/core/primitive.array.html">[T; 1]</a></code>

Diff for: src/test/rustdoc/array-links.link_slice_u32.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]</code>

Diff for: src/test/rustdoc/array-links.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#![crate_name = "foo"]
2+
#![no_std]
3+
4+
pub struct MyBox<T: ?Sized>(*const T);
5+
6+
// @has 'foo/fn.alpha.html'
7+
// @snapshot link_slice_u32 - '//pre[@class="rust fn"]/code'
8+
pub fn alpha() -> &'static [u32; 1] {
9+
loop {}
10+
}
11+
12+
// @has 'foo/fn.beta.html'
13+
// @snapshot link_slice_generic - '//pre[@class="rust fn"]/code'
14+
pub fn beta<T>() -> &'static [T; 1] {
15+
loop {}
16+
}
17+
18+
// @has 'foo/fn.gamma.html'
19+
// @snapshot link_box_u32 - '//pre[@class="rust fn"]/code'
20+
pub fn gamma() -> MyBox<[u32; 1]> {
21+
loop {}
22+
}
23+
24+
// @has 'foo/fn.delta.html'
25+
// @snapshot link_box_generic - '//pre[@class="rust fn"]/code'
26+
pub fn delta<T>() -> MyBox<[T; 1]> {
27+
loop {}
28+
}

0 commit comments

Comments
 (0)