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 13 pull requests #87689

Merged
merged 61 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d67f1a4
Update log to 0.4.14
jyn514 May 2, 2021
e243be6
Allow formatting `Anonymous{Struct, Union}` declarations
jedel1043 May 17, 2021
58c63cf
Add support for using qualified paths with structs in expression and …
rylev Dec 10, 2020
1e2258f
Use `AttrVec` for `Arm`, `FieldDef`, and `Variant`
JohnTitor Jun 16, 2021
2608f2c
fix(rustfmt): load nested out-of-line mods correctly
calebcartwright Jun 18, 2021
a26237e
Remove `Ipv4Addr::is_ietf_protocol_assignment`
CDirkx Jun 18, 2021
71f01d1
Delete spaces
Jun 21, 2021
d13020c
Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
JohnTitor Jun 21, 2021
0b8a26f
Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Ma…
JohnTitor Jun 21, 2021
5d85130
Partially stabilize `const_slice_first_last`
jhpratt Jun 24, 2021
33acc96
Document rustfmt on nightly-rustc
jyn514 Jun 30, 2021
c93cb40
Move `os_str_bytes` to `sys::unix` and reuse it on other platforms.
CDirkx Jun 21, 2021
f2c0f29
Change env var getters to error recoverably
inquisitivecrystal Jun 9, 2021
d26e01e
Add test to prevent regression
inquisitivecrystal Jun 9, 2021
a12107a
Make `getenv` return an Option instead of a Result
inquisitivecrystal Jun 24, 2021
d9752c7
Improve env var getter docs
inquisitivecrystal Jul 6, 2021
a674ae6
Add documentation for `Ipv6MulticastScope`
CDirkx Jul 7, 2021
abf449f
Rework SESSION_GLOBALS API to prevent overwriting it
GuillaumeGomez May 5, 2021
277feac
Use LocalExpnId where possible.
cjgillot Jun 25, 2021
8f3844f
refactor adding rustc and std into extended builds
pietroalbini Jul 19, 2021
0c8baa7
refactor gating of dist docs
pietroalbini Jul 19, 2021
7167f8b
change output of dist cargo and clippy to be consistent with other tools
pietroalbini Jul 19, 2021
e60b348
refactor gating of tools
pietroalbini Jul 19, 2021
82faa9c
refactor gating of demangler
pietroalbini Jul 19, 2021
f4c6d8f
refactor gating of mingw
pietroalbini Jul 19, 2021
2cfac3f
don't build extra tools if build.tools is explicitly an empty list
pietroalbini Jul 23, 2021
c15e248
refactor extended tarball generaton to use the new ensure_if_default
pietroalbini Jul 23, 2021
bfd479d
Merge pull request #4920 from calebcartwright/subtree-sync
calebcartwright Jul 26, 2021
75765f6
Allow `--edition 2021` to be passed to rustfmt
PatchMixolydic May 22, 2021
1ca3798
Improve pasta copyability of `merge_imports` deprecation message
casey May 10, 2021
486e774
Adjusting help message (#4865)
murchu27 Jun 11, 2021
e634a6f
Updating outdated links (#4869)
murchu27 Jun 16, 2021
b305d62
fix: correct arm leading pipe check (#4880)
calebcartwright Jun 24, 2021
19733f1
Change line endings from CRLF to LF
Jun 25, 2021
2cf280e
docs: clarify match_arm_blocks config documentation
calebcartwright Jul 5, 2021
4c2959f
fix a bunch of clippy warnings
matthiaskrgr Jul 18, 2021
d42be80
chore: disable clippy::matches_like_macro lint
calebcartwright Jul 18, 2021
0832137
fix link in Contributing.md
ebobrow Jul 19, 2021
4236289
chore: bump toolchain
calebcartwright Jul 26, 2021
102a06b
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-r…
calebcartwright Jul 26, 2021
661f461
Update mdbook.
ehuss Jul 27, 2021
69f712c
set all of the optional tools as DEFAULT = true
pietroalbini Jul 28, 2021
377b4ce
Remove unused field `Session.system_library_path`
Aaron1011 Jul 29, 2021
8d2bb93
Consistent spelling of "adapter" in the standard library
steffahn Jul 30, 2021
12017f9
Update compiler_builtins to fix i128 shift/mul on thumbv6m
Amanieu Jul 30, 2021
9a2e3f3
Recommend `swap_remove` in `Vec::remove` docs
Flying-Toast Jul 30, 2021
6aaa832
mark a UB doctest as no_run
RalfJung Jul 31, 2021
9854d30
Update const_slice_first_last_not_mut stable version.
m-ou-se Aug 1, 2021
016612d
Rollup merge of #86183 - inquisitivecrystal:env-nul, r=m-ou-se
JohnTitor Aug 2, 2021
a03d6da
Rollup merge of #86439 - CDirkx:ip-protocol-assignment, r=m-ou-se
JohnTitor Aug 2, 2021
1176d30
Rollup merge of #86509 - CDirkx:os_str, r=m-ou-se
JohnTitor Aug 2, 2021
77d5683
Rollup merge of #86593 - jhpratt:stabilize-const_slice_first_last, r=…
JohnTitor Aug 2, 2021
f386ae3
Rollup merge of #86936 - CDirkx:ipv6-multicast, r=JohnTitor
JohnTitor Aug 2, 2021
46f01ca
Rollup merge of #87282 - pietroalbini:refactor-extended, r=Mark-Simul…
JohnTitor Aug 2, 2021
e95b0ff
Rollup merge of #87468 - calebcartwright:update-rustfmt, r=Mark-Simul…
JohnTitor Aug 2, 2021
0d747d0
Rollup merge of #87504 - ehuss:update-mdbook, r=Mark-Simulacrum
JohnTitor Aug 2, 2021
5cf6566
Rollup merge of #87608 - Aaron1011:remove-system-library, r=Mark-Simu…
JohnTitor Aug 2, 2021
87c1436
Rollup merge of #87629 - steffahn:consistent_adapter_spelling, r=m-ou-se
JohnTitor Aug 2, 2021
e924e76
Rollup merge of #87633 - Amanieu:fix-86063, r=Mark-Simulacrum
JohnTitor Aug 2, 2021
0c9b35b
Rollup merge of #87644 - Flying-Toast:vec-remove-note, r=the8472
JohnTitor Aug 2, 2021
0851841
Rollup merge of #87653 - RalfJung:dont-run-ub, r=kennytm
JohnTitor Aug 2, 2021
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
12 changes: 6 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.47"
version = "0.1.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd4ed89e0a5c3e50b15c0045fbe1ff8567b703bc07544faf935ddff0aaa7b65f"
checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
dependencies = [
"cc",
"rustc-std-workspace-core",
Expand Down Expand Up @@ -1495,9 +1495,9 @@ dependencies = [

[[package]]
name = "handlebars"
version = "3.4.0"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5deefd4816fb852b1ff3cb48f6c41da67be2d0e1d20b26a7a3b076da11f064b1"
checksum = "72a0ffab8c36d0436114310c7e10b59b3307e650ddfabf6d006028e29a70c6e6"
dependencies = [
"log",
"pest",
Expand Down Expand Up @@ -2100,9 +2100,9 @@ dependencies = [

[[package]]
name = "mdbook"
version = "0.4.7"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28f6a882f3880ec68e96f60d6b543c34941e2f307ad10e2992e4db9acfe96529"
checksum = "4ee73932975c44c485e541416d7c30abb31a053af7e49682f6e856f1e4d6ab2a"
dependencies = [
"ammonia",
"anyhow",
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ pub struct Session {
/// exist under `std`. For example, wrote `str::from_utf8` instead of `std::str::from_utf8`.
pub confused_type_with_std_module: Lock<FxHashMap<Span, Span>>,

/// Path for libraries that will take preference over libraries shipped by Rust.
/// Used by windows-gnu targets to priortize system mingw-w64 libraries.
pub system_library_path: OneThread<RefCell<Option<Option<PathBuf>>>>,

/// Tracks the current behavior of the CTFE engine when an error occurs.
/// Options range from returning the error without a backtrace to returning an error
/// and immediately printing the backtrace to stderr.
Expand Down Expand Up @@ -1375,7 +1371,6 @@ pub fn build_session(
driver_lint_caps,
trait_methods_not_found: Lock::new(Default::default()),
confused_type_with_std_module: Lock::new(Default::default()),
system_library_path: OneThread::new(RefCell::new(Default::default())),
ctfe_backtrace,
miri_unleashed_features: Lock::new(Default::default()),
asm_arch,
Expand Down
6 changes: 6 additions & 0 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,12 @@ impl<T, A: Allocator> Vec<T, A> {
/// Removes and returns the element at position `index` within the vector,
/// shifting all elements after it to the left.
///
/// Note: Because this shifts over the remaining elements, it has a
/// worst-case performance of O(n). If you don't need the order of elements
/// to be preserved, use [`swap_remove`] instead.
///
/// [`swap_remove`]: Vec::swap_remove
///
/// # Panics
///
/// Panics if `index` is out of bounds.
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/alloc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ pub unsafe trait Allocator {
Ok(new_ptr)
}

/// Creates a "by reference" adaptor for this instance of `Allocator`.
/// Creates a "by reference" adapter for this instance of `Allocator`.
///
/// The returned adaptor also implements `Allocator` and will simply borrow this.
/// The returned adapter also implements `Allocator` and will simply borrow this.
#[inline(always)]
fn by_ref(&self) -> &Self
where
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ pub trait Iterator {
/// more idiomatic to use a `for` loop, but `for_each` may be more legible
/// when processing items at the end of longer iterator chains. In some
/// cases `for_each` may also be faster than a loop, because it will use
/// internal iteration on adaptors like `Chain`.
/// internal iteration on adapters like `Chain`.
///
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
///
Expand Down Expand Up @@ -1293,7 +1293,7 @@ pub trait Iterator {
Take::new(self, n)
}

/// An iterator adaptor similar to [`fold`] that holds internal state and
/// An iterator adapter similar to [`fold`] that holds internal state and
/// produces a new iterator.
///
/// [`fold`]: Iterator::fold
Expand Down Expand Up @@ -1604,7 +1604,7 @@ pub trait Iterator {

/// Borrows an iterator, rather than consuming it.
///
/// This is useful to allow applying iterator adaptors while still
/// This is useful to allow applying iterator adapters while still
/// retaining ownership of the original iterator.
///
/// # Examples
Expand Down
8 changes: 7 additions & 1 deletion library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,14 @@ impl<T: ?Sized> NonNull<T> {
///
/// let mut x = 0u32;
/// let ptr = unsafe { NonNull::new_unchecked(&mut x as *mut _) };
/// ```
///
/// *Incorrect* usage of this function:
///
/// ```rust,no_run
/// use std::ptr::NonNull;
///
/// // NEVER DO THAT!!!
/// // NEVER DO THAT!!! This is undefined behavior. ⚠️
/// let ptr = unsafe { NonNull::<u32>::new_unchecked(std::ptr::null_mut()) };
/// ```
#[stable(feature = "nonnull", since = "1.25.0")]
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<T> [T] {
/// assert_eq!(None, w.first());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn first(&self) -> Option<&T> {
if let [first, ..] = self { Some(first) } else { None }
Expand Down Expand Up @@ -177,7 +177,7 @@ impl<T> [T] {
/// }
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn split_first(&self) -> Option<(&T, &[T])> {
if let [first, tail @ ..] = self { Some((first, tail)) } else { None }
Expand Down Expand Up @@ -217,7 +217,7 @@ impl<T> [T] {
/// }
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn split_last(&self) -> Option<(&T, &[T])> {
if let [init @ .., last] = self { Some((last, init)) } else { None }
Expand Down Expand Up @@ -256,7 +256,7 @@ impl<T> [T] {
/// assert_eq!(None, w.last());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn last(&self) -> Option<&T> {
if let [.., last] = self { Some(last) } else { None }
Expand Down
2 changes: 1 addition & 1 deletion library/core/tests/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use core::cell::Cell;

/// An iterator that panics whenever `next` or next_back` is called
/// after `None` has already been returned. This does not violate
/// `Iterator`'s contract. Used to test that iterator adaptors don't
/// `Iterator`'s contract. Used to test that iterator adapters don't
/// poll their inner iterators after exhausting them.
pub struct NonFused<I> {
iter: I,
Expand Down
26 changes: 9 additions & 17 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,9 @@ impl fmt::Debug for VarsOs {
///
/// # Errors
///
/// Errors if the environment variable is not present.
/// Errors if the environment variable is not valid Unicode. If this is not desired, consider using
/// [`var_os`].
///
/// # Panics
///
/// This function may panic if `key` is empty, contains an ASCII equals sign
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
/// character.
/// Returns `[None]` if the environment variable isn't set.
/// Returns `[None]` if the environment variable is not valid Unicode. If this is not
/// desired, consider using [`var_os`].
///
/// # Examples
///
Expand All @@ -219,18 +213,17 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
}

/// Fetches the environment variable `key` from the current process, returning
/// [`None`] if the variable isn't set.
///
/// # Panics
///
/// This function may panic if `key` is empty, contains an ASCII equals sign
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
/// character.
/// [`None`] if the variable isn't set or there's another error.
///
/// Note that the method will not check if the environment variable
/// is valid Unicode. If you want to have an error on invalid UTF-8,
/// use the [`var`] function instead.
///
/// # Errors
///
/// Returns `[None]` if the variable isn't set.
/// May return `[None]` if the variable value contains the NUL character.
///
/// # Examples
///
/// ```
Expand All @@ -249,7 +242,6 @@ pub fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString> {

fn _var_os(key: &OsStr) -> Option<OsString> {
os_imp::getenv(key)
.unwrap_or_else(|e| panic!("failed to get environment variable `{:?}`: {}", key, e))
}

/// The error type for operations interacting with environment variables.
Expand Down
24 changes: 12 additions & 12 deletions library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,9 @@ pub trait Read {
default_read_exact(self, buf)
}

/// Creates a "by reference" adaptor for this instance of `Read`.
/// Creates a "by reference" adapter for this instance of `Read`.
///
/// The returned adaptor also implements `Read` and will simply borrow this
/// The returned adapter also implements `Read` and will simply borrow this
/// current reader.
///
/// # Examples
Expand Down Expand Up @@ -889,7 +889,7 @@ pub trait Read {
Bytes { inner: self }
}

/// Creates an adaptor which will chain this stream with another.
/// Creates an adapter which will chain this stream with another.
///
/// The returned `Read` instance will first read all bytes from this object
/// until EOF is encountered. Afterwards the output is equivalent to the
Expand Down Expand Up @@ -927,7 +927,7 @@ pub trait Read {
Chain { first: self, second: next, done_first: false }
}

/// Creates an adaptor which will read at most `limit` bytes from it.
/// Creates an adapter which will read at most `limit` bytes from it.
///
/// This function returns a new instance of `Read` which will read at most
/// `limit` bytes, after which it will always return EOF ([`Ok(0)`]). Any
Expand Down Expand Up @@ -1326,7 +1326,7 @@ impl Initializer {
/// * The [`write`] method will attempt to write some data into the object,
/// returning how many bytes were successfully written.
///
/// * The [`flush`] method is useful for adaptors and explicit buffers
/// * The [`flush`] method is useful for adapters and explicit buffers
/// themselves for ensuring that all buffered data has been pushed out to the
/// 'true sink'.
///
Expand Down Expand Up @@ -1646,12 +1646,12 @@ pub trait Write {
fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> Result<()> {
// Create a shim which translates a Write to a fmt::Write and saves
// off I/O errors. instead of discarding them
struct Adaptor<'a, T: ?Sized + 'a> {
struct Adapter<'a, T: ?Sized + 'a> {
inner: &'a mut T,
error: Result<()>,
}

impl<T: Write + ?Sized> fmt::Write for Adaptor<'_, T> {
impl<T: Write + ?Sized> fmt::Write for Adapter<'_, T> {
fn write_str(&mut self, s: &str) -> fmt::Result {
match self.inner.write_all(s.as_bytes()) {
Ok(()) => Ok(()),
Expand All @@ -1663,7 +1663,7 @@ pub trait Write {
}
}

let mut output = Adaptor { inner: self, error: Ok(()) };
let mut output = Adapter { inner: self, error: Ok(()) };
match fmt::write(&mut output, fmt) {
Ok(()) => Ok(()),
Err(..) => {
Expand All @@ -1677,9 +1677,9 @@ pub trait Write {
}
}

/// Creates a "by reference" adaptor for this instance of `Write`.
/// Creates a "by reference" adapter for this instance of `Write`.
///
/// The returned adaptor also implements `Write` and will simply borrow this
/// The returned adapter also implements `Write` and will simply borrow this
/// current writer.
///
/// # Examples
Expand Down Expand Up @@ -2263,7 +2263,7 @@ pub trait BufRead: Read {
}
}

/// Adaptor to chain together two readers.
/// Adapter to chain together two readers.
///
/// This struct is generally created by calling [`chain`] on a reader.
/// Please see the documentation of [`chain`] for more details.
Expand Down Expand Up @@ -2414,7 +2414,7 @@ impl<T, U> SizeHint for Chain<T, U> {
}
}

/// Reader adaptor which limits the bytes read from an underlying reader.
/// Reader adapter which limits the bytes read from an underlying reader.
///
/// This struct is generally created by calling [`take`] on a reader.
/// Please see the documentation of [`take`] for more details.
Expand Down
Loading