Skip to content

Commit

Permalink
Auto merge of rust-lang#112739 - matthiaskrgr:rollup-8cfggml, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#112352 (Fix documentation build on FreeBSD)
 - rust-lang#112644 (Correct types in method descriptions of `NonZero*` types)
 - rust-lang#112683 (fix ICE on specific malformed asm clobber_abi)
 - rust-lang#112707 ([rustdoc] Fix invalid handling of "going back in history" when "go to only search result" setting is enabled)
 - rust-lang#112719 (Replace fvdl with ffx, allow test without install)
 - rust-lang#112728 (Add `<meta charset="utf-8">` to `-Zdump-mir-spanview` output)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jun 17, 2023
2 parents 7513407 + 981a2a2 commit e1c29d1
Show file tree
Hide file tree
Showing 16 changed files with 355 additions and 287 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_builtin_macros/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,12 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a,
}

let mut new_abis = Vec::new();
loop {
while !p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
match p.parse_str_lit() {
Ok(str_lit) => {
new_abis.push((str_lit.symbol_unescaped, str_lit.span));
}
Err(opt_lit) => {
// If the non-string literal is a closing paren then it's the end of the list and is fine
if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) {
break;
}
let span = opt_lit.map_or(p.token.span, |lit| lit.span);
let mut err =
p.sess.span_diagnostic.struct_span_err(span, "expected string literal");
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_middle/src/mir/spanview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ const ANNOTATION_LEFT_BRACKET: char = '\u{298a}'; // Unicode `Z NOTATION RIGHT B
const ANNOTATION_RIGHT_BRACKET: char = '\u{2989}'; // Unicode `Z NOTATION LEFT BINDING BRACKET`
const NEW_LINE_SPAN: &str = "</span>\n<span class=\"line\">";
const HEADER: &str = r#"<!DOCTYPE html>
<html>
<head>"#;
<html lang="en">
<head>
<meta charset="utf-8">"#;
const START_BODY: &str = r#"</head>
<body>"#;
const FOOTER: &str = r#"</body>
Expand Down
21 changes: 12 additions & 9 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ macro_rules! nonzero_unsigned_operations {
}

/// Adds an unsigned integer to a non-zero value.
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
#[doc = concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")]
///
/// # Examples
///
Expand Down Expand Up @@ -579,7 +579,7 @@ macro_rules! nonzero_signed_operations {

/// Checked absolute value.
/// Checks for overflow and returns [`None`] if
#[doc = concat!("`self == ", stringify!($Int), "::MIN`.")]
#[doc = concat!("`self == ", stringify!($Ty), "::MIN`.")]
/// The result cannot be zero.
///
/// # Example
Expand Down Expand Up @@ -800,7 +800,8 @@ macro_rules! nonzero_signed_operations {
self.get().is_negative()
}

/// Checked negation. Computes `-self`, returning `None` if `self == i32::MIN`.
/// Checked negation. Computes `-self`,
#[doc = concat!("returning `None` if `self == ", stringify!($Ty), "::MIN`.")]
///
/// # Example
///
Expand Down Expand Up @@ -859,8 +860,10 @@ macro_rules! nonzero_signed_operations {
((unsafe { $Ty::new_unchecked(result) }), overflow)
}

/// Saturating negation. Computes `-self`, returning `MAX` if
/// `self == i32::MIN` instead of overflowing.
/// Saturating negation. Computes `-self`,
#[doc = concat!("returning [`", stringify!($Ty), "::MAX`]")]
#[doc = concat!("if `self == ", stringify!($Ty), "::MIN`")]
/// instead of overflowing.
///
/// # Example
///
Expand Down Expand Up @@ -993,7 +996,7 @@ macro_rules! nonzero_unsigned_signed_operations {
}

/// Multiplies two non-zero integers together.
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
#[doc = concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")]
///
/// # Examples
///
Expand Down Expand Up @@ -1102,11 +1105,11 @@ macro_rules! nonzero_unsigned_signed_operations {
#[doc = sign_dependent_expr!{
$signedness ?
if signed {
concat!("Return [`", stringify!($Int), "::MIN`] ",
"or [`", stringify!($Int), "::MAX`] on overflow.")
concat!("Return [`", stringify!($Ty), "::MIN`] ",
"or [`", stringify!($Ty), "::MAX`] on overflow.")
}
if unsigned {
concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")
concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")
}
}]
///
Expand Down
8 changes: 7 additions & 1 deletion library/std/src/os/unix/net/ancillary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ use crate::slice::from_raw_parts;
use crate::sys::net::Socket;

// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
#[cfg(all(doc, not(target_os = "linux"), not(target_os = "android"), not(target_os = "netbsd")))]
#[cfg(all(
doc,
not(target_os = "linux"),
not(target_os = "android"),
not(target_os = "netbsd"),
not(target_os = "freebsd")
))]
#[allow(non_camel_case_types)]
mod libc {
pub use libc::c_int;
Expand Down
Loading

0 comments on commit e1c29d1

Please sign in to comment.