Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #95745

Merged
merged 13 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/core/src/panic/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ impl<'a> Location<'a> {
#[stable(feature = "track_caller", since = "1.46.0")]
#[rustc_const_unstable(feature = "const_caller_location", issue = "76156")]
#[track_caller]
#[inline]
pub const fn caller() -> &'static Location<'static> {
crate::intrinsics::caller_location()
}
Expand Down
3 changes: 1 addition & 2 deletions library/std/src/io/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ impl Stdin {
/// # Examples
///
/// ```no_run
/// #![feature(stdin_forwarders)]
/// use std::io;
///
/// let lines = io::stdin().lines();
Expand All @@ -403,7 +402,7 @@ impl Stdin {
/// }
/// ```
#[must_use = "`self` will be dropped if the result is not used"]
#[unstable(feature = "stdin_forwarders", issue = "87096")]
#[stable(feature = "stdin_forwarders", since = "1.62.0")]
pub fn lines(self) -> Lines<StdinLock<'static>> {
self.lock().lines()
}
Expand Down
8 changes: 7 additions & 1 deletion library/std/src/sys/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ impl Thread {
// pthread wrapper only appeared in glibc 2.12, so we use syscall
// directly.
unsafe {
libc::prctl(PR_SET_NAME, name.as_ptr() as libc::c_ulong, 0, 0, 0);
libc::prctl(
PR_SET_NAME,
name.as_ptr(),
0 as libc::c_ulong,
0 as libc::c_ulong,
0 as libc::c_ulong,
);
}
}

Expand Down
7 changes: 4 additions & 3 deletions library/test/src/formatters/terse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ use crate::{
types::TestDesc,
};

// insert a '\n' after 100 tests in quiet mode
const QUIET_MODE_MAX_COLUMN: usize = 100;
// We insert a '\n' when the output hits 100 columns in quiet mode. 88 test
// result chars leaves 12 chars for a progress count like " 11704/12853".
const QUIET_MODE_MAX_COLUMN: usize = 88;

pub(crate) struct TerseFormatter<T> {
out: OutputLocation<T>,
Expand Down Expand Up @@ -65,7 +66,7 @@ impl<T: Write> TerseFormatter<T> {
) -> io::Result<()> {
self.write_pretty(result, color)?;
if self.test_count % QUIET_MODE_MAX_COLUMN == QUIET_MODE_MAX_COLUMN - 1 {
// we insert a new line every 100 dots in order to flush the
// We insert a new line regularly in order to flush the
// screen when dealing with line-buffered output (e.g., piping to
// `stamp` in the rust CI).
let out = format!(" {}/{}\n", self.test_count + 1, self.total_test_count);
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ fn document_item_info(
) {
let item_infos = short_item_info(item, cx, parent);
if !item_infos.is_empty() {
w.write_str("<div class=\"item-info\">");
w.write_str("<span class=\"item-info\">");
for info in item_infos {
w.write_str(&info);
}
w.write_str("</div>");
w.write_str("</span>");
}
}

Expand Down Expand Up @@ -1772,7 +1772,7 @@ pub(crate) fn render_impl_summary(
let is_trait = i.inner_impl().trait_.is_some();
if is_trait {
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
write!(w, "<div class=\"item-info\">{}</div>", portability);
write!(w, "<span class=\"item-info\">{}</span>", portability);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ h2.location a {
border: none;
}

.item-info {
display: block;
}

.content .item-info code {
font-size: 0.875rem;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

pub struct Unstable {
// @has stability/struct.Unstable.html \
// '//div[@class="item-info"]//div[@class="stab unstable"]' \
// '//span[@class="item-info"]//div[@class="stab unstable"]' \
// 'This is a nightly-only experimental API'
// @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0
pub foo: u32,
Expand Down