Auto merge of #110839 - jyn514:rollup-uikilwm, r=jyn514

Rollup of 9 pull requests

Successful merges:

 - #108416 (black_box doc corrections for clarification - Issue #107957)
 - #109379 (Replace `yes` command by `while-echo` in test `tests/ui/process/process-sigpipe.rs`)
 - #110266 (Update documentation wording on path 'try_exists' functions)
 - #110329 (Improve tests for #110138)
 - #110418 (Spelling rustdoc)
 - #110587 (Fix `std` compilation error for wasi+atomics)
 - #110594 (`rustc --help` add `--cfg` SPEC declaration.)
 - #110792 (Use the standard macOS CI runner)
 - #110817 (Add regression tests for const-generic inherent associated types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-04-26 07:43:17 +00:00
commit ae3ab14faa
17 changed files with 117 additions and 41 deletions

View File

@ -326,7 +326,7 @@ jobs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
DIST_REQUIRE_ALL_TOOLS: 1
os: macos-12-xl
os: macos-latest
- name: dist-apple-various
env:
SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
@ -337,7 +337,7 @@ jobs:
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-12-xl
os: macos-latest
- name: dist-x86_64-apple-alt
env:
SCRIPT: "./x.py dist bootstrap --include-default-paths"
@ -348,7 +348,7 @@ jobs:
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-12-xl
os: macos-latest
- name: x86_64-apple-1
env:
SCRIPT: "./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps"
@ -359,7 +359,7 @@ jobs:
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-12-xl
os: macos-latest
- name: x86_64-apple-2
env:
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
@ -370,7 +370,7 @@ jobs:
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-12-xl
os: macos-latest
- name: dist-aarch64-apple
env:
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
@ -385,7 +385,7 @@ jobs:
NO_OVERFLOW_CHECKS: 1
DIST_REQUIRE_ALL_TOOLS: 1
JEMALLOC_SYS_WITH_LG_PAGE: 14
os: macos-12-xl
os: macos-latest
- name: x86_64-msvc-1
env:
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"

View File

@ -1400,7 +1400,8 @@ The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE
pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
vec![
opt::flag_s("h", "help", "Display this message"),
opt::multi_s("", "cfg", "Configure the compilation environment", "SPEC"),
opt::multi_s("", "cfg", "Configure the compilation environment.
SPEC supports the syntax `NAME[=\"VALUE\"]`.", "SPEC"),
opt::multi("", "check-cfg", "Provide list of valid cfg options for checking", "SPEC"),
opt::multi_s(
"L",

View File

@ -217,17 +217,14 @@ pub fn spin_loop() {
/// Note however, that `black_box` is only (and can only be) provided on a "best-effort" basis. The
/// extent to which it can block optimisations may vary depending upon the platform and code-gen
/// backend used. Programs cannot rely on `black_box` for *correctness*, beyond it behaving as the
/// identity function.
/// identity function. As such, it **must not be relied upon to control critical program behavior.**
/// This _immediately_ precludes any direct use of this function for cryptographic or security
/// purposes.
///
/// [`std::convert::identity`]: crate::convert::identity
///
/// # When is this useful?
///
/// First and foremost: `black_box` does _not_ guarantee any exact behavior and, in some cases, may
/// do nothing at all. As such, it **must not be relied upon to control critical program behavior.**
/// This _immediately_ precludes any direct use of this function for cryptographic or security
/// purposes.
///
/// While not suitable in those mission-critical cases, `black_box`'s functionality can generally be
/// relied upon for benchmarking, and should be used there. It will try to ensure that the
/// compiler doesn't optimize away part of the intended test code based on context. For

View File

@ -2515,9 +2515,10 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
/// This function will traverse symbolic links to query information about the
/// destination file. In case of broken symbolic links this will return `Ok(false)`.
///
/// As opposed to the [`Path::exists`] method, this one doesn't silently ignore errors
/// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
/// denied on some of the parent directories.)
/// As opposed to the [`Path::exists`] method, this will only return `Ok(true)` or `Ok(false)`
/// if the path was _verified_ to exist or not exist. If its existence can neither be confirmed
/// nor denied, an `Err(_)` will be propagated instead. This can be the case if e.g. listing
/// permission is denied on one of the parent directories.
///
/// Note that while this avoids some pitfalls of the `exists()` method, it still can not
/// prevent time-of-check to time-of-use (TOCTOU) bugs. You should only use it in scenarios

View File

@ -2844,9 +2844,11 @@ impl Path {
/// This function will traverse symbolic links to query information about the
/// destination file. In case of broken symbolic links this will return `Ok(false)`.
///
/// As opposed to the [`exists()`] method, this one doesn't silently ignore errors
/// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
/// denied on some of the parent directories.)
/// [`Path::exists()`] only checks whether or not a path was both found and readable. By
/// contrast, `try_exists` will return `Ok(true)` or `Ok(false)`, respectively, if the path
/// was _verified_ to exist or not exist. If its existence can neither be confirmed nor
/// denied, it will propagate an `Err(_)` instead. This can be the case if e.g. listing
/// permission is denied on one of the parent directories.
///
/// Note that while this avoids some pitfalls of the `exists()` method, it still can not
/// prevent time-of-check to time-of-use (TOCTOU) bugs. You should only use it in scenarios

View File

@ -32,8 +32,6 @@ pub mod io;
#[path = "../unsupported/locks/mod.rs"]
pub mod locks;
pub mod net;
#[path = "../unsupported/once.rs"]
pub mod once;
pub mod os;
#[path = "../unix/os_str.rs"]
pub mod os_str;
@ -51,6 +49,13 @@ pub mod thread_local_dtor;
pub mod thread_local_key;
pub mod time;
cfg_if::cfg_if! {
if #[cfg(not(target_feature = "atomics"))] {
#[path = "../unsupported/once.rs"]
pub mod once;
}
}
#[path = "../unsupported/common.rs"]
#[deny(unsafe_op_in_unsafe_fn)]
#[allow(unused)]

View File

@ -82,7 +82,7 @@ x--expand-yaml-anchors--remove:
<<: *base-job
- &job-macos-xl
os: macos-12-xl
os: macos-latest # We use the standard runner for now
<<: *base-job
- &job-windows-8c

View File

@ -43,7 +43,7 @@ including automatic and blanket implementations that `rustdoc` knows about.
Subheadings, variants, fields, and many other things in this documentation
are anchors and can be clicked on and deep-linked to,
which is a great way to communicate exactly what you're talking about.
The typograpical character "§" appears next to lines with anchors on them
The typographical character "§" appears next to lines with anchors on them
when hovered or given keyboard focus.
## The Navigation Bar

View File

@ -13,15 +13,15 @@ If you know of other great resources, please submit a pull request!
## Community
- [API Guidelines]
- [Github tagged RFCs]
- [Github tagged issues]
- [GitHub tagged RFCs]
- [GitHub tagged issues]
- [RFC (stalled) front page styleguide]
- [Guide on how to write documentation for a Rust crate]
[API Guidelines]: https://rust-lang.github.io/api-guidelines/documentation.html
[Github tagged RFCs]: https://github.com/rust-lang/rfcs/issues?q=label%3AT-rustdoc
[Github tagged issues]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AT-rustdoc
[GitHub tagged RFCs]: https://github.com/rust-lang/rfcs/issues?q=label%3AT-rustdoc
[GitHub tagged issues]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AT-rustdoc
[Guide on how to write documentation for a Rust crate]: https://blog.guillaume-gomez.fr/articles/2020-03-12+Guide+on+how+to+write+documentation+for+a+Rust+crate
[Learn Rust]: https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments
[RFC 1574: More API Documentation Conventions]: https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html

View File

@ -0,0 +1,6 @@
//! Should not be inlined
/// Should not be inlined
pub enum O {
L = -1,
}

View File

@ -0,0 +1,10 @@
// Regression Test for https://github.com/rust-lang/rust/issues/110138
// aux-build: enum_with_discriminant.rs
#[doc(inline)]
pub extern crate enum_with_discriminant;
// @!has '$.index[*][?(@.docs == "Should not be inlined")]'
// @is '$.index[*][?(@.name == "enum_with_discriminant")].kind' '"extern_crate"'
// @set enum_with_discriminant = '$.index[*][?(@.name == "enum_with_discriminant")].id'
// @is '$.index[*][?(@.name == "doc_inline_external_crate")].inner.items[*]' $enum_with_discriminant

View File

@ -0,0 +1,10 @@
// aux-build: enum_with_discriminant.rs
extern crate enum_with_discriminant;
#[doc(inline)]
pub use enum_with_discriminant::*;
// @!has '$.index[*][?(@.docs == "Should not be inlined")]'
// @set use = '$.index[*][?(@.inner.name == "enum_with_discriminant")].id'
// @is '$.index[*][?(@.name == "extern_crate_glob")].inner.items[*]' $use

View File

@ -1,3 +0,0 @@
pub enum O {
L = -1,
}

View File

@ -1,8 +0,0 @@
// check-pass
// aux-build: inner-crate-enum.rs
// compile-flags:-Z unstable-options --output-format json
#[doc(inline)]
pub extern crate inner_crate_enum;
fn main() {}

View File

@ -0,0 +1,23 @@
// Regression test for issue #109759.
// check-pass
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
struct Foo;
struct Bar<const X: usize>([(); X]);
impl<const X: usize> Bar<X> {
pub fn new() -> Self {
Self([(); X])
}
}
impl Foo {
type Bar<const X: usize> = Bar<X>;
}
fn main() {
let _ = Foo::Bar::<10>::new();
}

View File

@ -0,0 +1,28 @@
// check-pass
#![feature(inherent_associated_types, generic_const_exprs)]
#![allow(incomplete_features)]
struct Parent<const O: usize>;
impl<const O: usize> Parent<O> {
type Mapping<const I: usize> = Store<{ O + I }>
where
[(); O + I]:
;
}
struct Store<const N: usize>;
impl<const N: usize> Store<N> {
const REIFIED: usize = N;
fn reify() -> usize {
N
}
}
fn main() {
let _ = Parent::<2>::Mapping::<{ 12 * 2 }>::REIFIED;
let _ = Parent::<1>::Mapping::<{ 2 * 5 }>::reify();
}

View File

@ -8,14 +8,14 @@
// libstd ignores SIGPIPE, and other libraries may set signal masks.
// Make sure that these behaviors don't get inherited to children
// spawned via std::process, since they're needed for traditional UNIX
// filter behavior. This test checks that `yes | head` terminates
// filter behavior.
// This test checks that `while echo y ; do : ; done | head` terminates
// (instead of running forever), and that it does not print an error
// message about a broken pipe.
// ignore-emscripten no threads support
// ignore-vxworks no 'sh'
// ignore-fuchsia no 'sh'
// ignore-nto no 'yes'
use std::process;
use std::thread;
@ -27,7 +27,11 @@ fn main() {
thread::sleep_ms(5000);
process::exit(1);
});
let output = process::Command::new("sh").arg("-c").arg("yes | head").output().unwrap();
let output = process::Command::new("sh")
.arg("-c")
.arg("while echo y ; do : ; done | head")
.output()
.unwrap();
assert!(output.status.success());
assert!(output.stderr.len() == 0);
}