Skip to content

Commit

Permalink
Auto merge of rust-lang#89968 - JohnTitor:rollup-z51n967, r=JohnTitor
Browse files Browse the repository at this point in the history
Rollup of 7 pull requests

Successful merges:

 - rust-lang#89507 (Add `#[repr(i8)]` to `Ordering`)
 - rust-lang#89849 (CI: Selecting the Xcode version no longer needed with the macos-11 runners.)
 - rust-lang#89886 (Update the wasi-libc built with the wasm32-wasi target)
 - rust-lang#89907 (Remove FIXME since there is nothing to be fixed)
 - rust-lang#89943 (clippy::complexity fixes)
 - rust-lang#89953 (Make Option::as_mut const)
 - rust-lang#89958 (Correct small typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Oct 17, 2021
2 parents 4e89811 + dc2e301 commit 12b5bce
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 43 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
})))
}))
})
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down
1 change: 1 addition & 0 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
3 changes: 2 additions & 1 deletion library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
8 changes: 8 additions & 0 deletions library/core/tests/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand Down
5 changes: 0 additions & 5 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions src/ci/scripts/select-xcode.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 3 additions & 5 deletions src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<_>>()
})
Expand Down
1 change: 0 additions & 1 deletion src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 12b5bce

Please sign in to comment.