diff options
| author | bors <bors@rust-lang.org> | 2021-10-17 06:27:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-17 06:27:08 +0000 |
| commit | 12b5bce0d7b124393d11459557415d37aef13d6a (patch) | |
| tree | dfb87b6fd94362db0807a2a64991a7d714312f78 | |
| parent | 4e89811b46323f432544f9c4006e40d5e5d7663f (diff) | |
| parent | dc2e301eb9b263bbf68c37ac5ce00caa20601458 (diff) | |
Auto merge of #89968 - JohnTitor:rollup-z51n967, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #89507 (Add `#[repr(i8)]` to `Ordering`) - #89849 (CI: Selecting the Xcode version no longer needed with the macos-11 runners.) - #89886 (Update the wasi-libc built with the wasm32-wasi target) - #89907 (Remove FIXME since there is nothing to be fixed) - #89943 (clippy::complexity fixes) - #89953 (Make Option::as_mut const) - #89958 (Correct small typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
| -rw-r--r-- | .github/workflows/ci.yml | 10 | ||||
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/config.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/allocation.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 2 | ||||
| -rw-r--r-- | library/core/src/cmp.rs | 1 | ||||
| -rw-r--r-- | library/core/src/option.rs | 3 | ||||
| -rw-r--r-- | library/core/tests/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/tests/option.rs | 8 | ||||
| -rwxr-xr-x | src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh | 2 | ||||
| -rw-r--r-- | src/ci/github-actions/ci.yml | 5 | ||||
| -rwxr-xr-x | src/ci/scripts/select-xcode.sh | 13 | ||||
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs | 1 |
15 files changed, 23 insertions, 43 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78ff874e755..d921286ba34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,9 +92,6 @@ jobs: - name: install sccache run: src/ci/scripts/install-sccache.sh if: success() && !env.SKIP_JOB - - name: select Xcode - run: src/ci/scripts/select-xcode.sh - if: success() && !env.SKIP_JOB - name: install clang run: src/ci/scripts/install-clang.sh if: success() && !env.SKIP_JOB @@ -322,7 +319,6 @@ jobs: SCRIPT: "./x.py dist --stage 2" RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 - SELECT_XCODE: /Applications/Xcode_12.2.app USE_XCODE_CLANG: 1 MACOSX_DEPLOYMENT_TARGET: 11.0 MACOSX_STD_DEPLOYMENT_TARGET: 11.0 @@ -467,9 +463,6 @@ jobs: - name: install sccache run: src/ci/scripts/install-sccache.sh if: success() && !env.SKIP_JOB - - name: select Xcode - run: src/ci/scripts/select-xcode.sh - if: success() && !env.SKIP_JOB - name: install clang run: src/ci/scripts/install-clang.sh if: success() && !env.SKIP_JOB @@ -580,9 +573,6 @@ jobs: - name: install sccache run: src/ci/scripts/install-sccache.sh if: success() && !env.SKIP_JOB - - name: select Xcode - run: src/ci/scripts/select-xcode.sh - if: success() && !env.SKIP_JOB - name: install clang run: src/ci/scripts/install-clang.sh if: success() && !env.SKIP_JOB diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 8d7f2b65c5a..719caaabbbf 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -802,7 +802,7 @@ impl IntType { /// Valid repr contents: any of the primitive integral type names (see /// `int_type_of_word`, below) to specify enum discriminant type; `C`, to use /// the same discriminant size that the corresponding C enum would or C -/// structure layout, `packed` to remove padding, and `transparent` to elegate representation +/// structure layout, `packed` to remove padding, and `transparent` to delegate representation /// concerns to the only non-ZST field. pub fn find_repr_attrs(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> { use ReprAttr::*; diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 38c099fa4f5..1b123520961 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -171,7 +171,7 @@ fn get_features( } if let Some(allowed) = sess.opts.debugging_opts.allow_features.as_ref() { - if allowed.iter().find(|&f| name.as_str() == *f).is_none() { + if allowed.iter().all(|f| name.as_str() != *f) { struct_span_err!( span_handler, mi.span(), diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs index b6358f99294..a36c9b6ed73 100644 --- a/compiler/rustc_middle/src/mir/interpret/allocation.rs +++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs @@ -1004,13 +1004,13 @@ impl<Tag: Copy, Extra> Allocation<Tag, Extra> { /// Checks that a range of bytes is initialized. If not, returns the `InvalidUninitBytes` /// error which will report the first range of bytes which is uninitialized. fn check_init(&self, range: AllocRange) -> AllocResult { - self.is_init(range).or_else(|idx_range| { - Err(AllocError::InvalidUninitBytes(Some(UninitBytesAccess { + self.is_init(range).map_err(|idx_range| { + AllocError::InvalidUninitBytes(Some(UninitBytesAccess { access_offset: range.start, access_size: range.size, uninit_offset: idx_range.start, uninit_size: idx_range.end - idx_range.start, // `Size` subtraction - }))) + })) }) } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index e3970038a33..05675e086d7 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1837,7 +1837,7 @@ crate fn show_candidates( .skip(1) .all(|(_, descr, _)| descr == descr_first) { - format!("{}", descr_first) + descr_first.to_string() } else { "item".to_string() }; diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 5ac9fdec0cf..7456f886ea5 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -323,6 +323,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> { /// ``` #[derive(Clone, Copy, PartialEq, Debug, Hash)] #[stable(feature = "rust1", since = "1.0.0")] +#[repr(i8)] pub enum Ordering { /// An ordering where a compared value is less than another. #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 401267f5613..88505832158 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -646,7 +646,8 @@ impl<T> Option<T> { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub fn as_mut(&mut self) -> Option<&mut T> { + #[rustc_const_unstable(feature = "const_option", issue = "67441")] + pub const fn as_mut(&mut self) -> Option<&mut T> { match *self { Some(ref mut x) => Some(x), None => None, diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 3608853dce4..cf669163d3e 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -10,6 +10,7 @@ #![feature(const_assume)] #![feature(const_cell_into_inner)] #![feature(const_maybe_uninit_assume_init)] +#![cfg_attr(bootstrap, feature(const_panic))] #![feature(const_ptr_read)] #![feature(const_ptr_write)] #![feature(const_ptr_offset)] diff --git a/library/core/tests/option.rs b/library/core/tests/option.rs index 8995f96b123..c9508c14525 100644 --- a/library/core/tests/option.rs +++ b/library/core/tests/option.rs @@ -380,6 +380,14 @@ const fn option_const_mut() { let _take = option.take(); let _replace = option.replace(42); + + { + let as_mut = option.as_mut(); + match as_mut { + Some(v) => *v = 32, + None => unreachable!(), + } + } } #[test] diff --git a/src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh b/src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh index 82d0f7dc471..9bd56394eaf 100755 --- a/src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh +++ b/src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh @@ -10,7 +10,7 @@ export PATH=`pwd`/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04/bin:$PATH git clone https://github.com/WebAssembly/wasi-libc cd wasi-libc -git reset --hard 58795582905e08fa7748846c1971b4ab911d1e16 +git reset --hard ad5133410f66b93a2381db5b542aad5e0964db96 make -j$(nproc) INSTALL_DIR=/wasm32-wasi install cd .. diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index c9f8692d418..eb16cf3c762 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -153,10 +153,6 @@ x--expand-yaml-anchors--remove: run: src/ci/scripts/install-sccache.sh <<: *step - - name: select Xcode - run: src/ci/scripts/select-xcode.sh - <<: *step - - name: install clang run: src/ci/scripts/install-clang.sh <<: *step @@ -498,7 +494,6 @@ jobs: --set rust.jemalloc --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 - SELECT_XCODE: /Applications/Xcode_12.2.app USE_XCODE_CLANG: 1 MACOSX_DEPLOYMENT_TARGET: 11.0 MACOSX_STD_DEPLOYMENT_TARGET: 11.0 diff --git a/src/ci/scripts/select-xcode.sh b/src/ci/scripts/select-xcode.sh deleted file mode 100755 index 3b9c77d42ba..00000000000 --- a/src/ci/scripts/select-xcode.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# This script selects the Xcode instance to use. - -set -euo pipefail -IFS=$'\n\t' - -source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" - -if isMacOS; then - if [[ -s "${SELECT_XCODE-}" ]]; then - sudo xcode-select -s "${SELECT_XCODE}" - fi -fi diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 9f2e282fce1..c46439b8510 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -765,7 +765,7 @@ crate fn find_testable_code<T: doctest::Tester>( // If there are characters between the preceding line ending and // this code block, `str::lines` will return an additional line, // which we subtract here. - if nb_lines != 0 && !&doc[prev_offset..offset.start].ends_with("\n") { + if nb_lines != 0 && !&doc[prev_offset..offset.start].ends_with('\n') { nb_lines -= 1; } let line = tests.get_line() + nb_lines + 1; diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 36b1a14f6c1..b13ab64011d 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -113,11 +113,9 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { .unwrap_or(&[]) .iter() .filter_map(|attr| { - Some( - Cfg::parse(attr.meta_item()?) - .map_err(|e| self.cx.sess().diagnostic().span_err(e.span, e.msg)) - .ok()?, - ) + Cfg::parse(attr.meta_item()?) + .map_err(|e| self.cx.sess().diagnostic().span_err(e.span, e.msg)) + .ok() }) .collect::<Vec<_>>() }) diff --git a/src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs b/src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs index 3ad56aebc21..e58bba64058 100644 --- a/src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs +++ b/src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs @@ -11,7 +11,6 @@ impl Struct { pub const AssocConst: Self::AssocTy = 42; //~^ ERROR ambiguous associated type //~| HELP use fully-qualified syntax - // FIXME: for some reason, the error is shown twice with rustdoc but only once with rustc //~| ERROR ambiguous associated type //~| HELP use fully-qualified syntax } |
