Skip to content

Commit

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

Successful merges:

 - rust-lang#77239 (Enable building Cargo for aarch64-apple-darwin)
 - rust-lang#77569 (BTreeMap: type-specific variants of node_as_mut and cast_unchecked)
 - rust-lang#77719 (Remove unnecessary rustc_const_stable attributes.)
 - rust-lang#77722 (Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).)
 - rust-lang#77725 (Add regression issue template)
 - rust-lang#77776 ( Give an error when running `x.py test --stage 0 src/test/ui`)
 - rust-lang#77786 (Mention rustdoc in `x.py setup`)
 - rust-lang#77825 (`min_const_generics` diagnostics improvements)
 - rust-lang#77868 (Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component)
 - rust-lang#77884 (Use Option::unwrap_or instead of open-coding it)
 - rust-lang#77886 (Replace trivial bool matches with the `matches!` macro)
 - rust-lang#77892 (Replace absolute paths with relative ones)
 - rust-lang#77895 (Include aarch64-apple-darwin in the dist manifests)
 - rust-lang#77909 (bootstrap: set correct path for the build-manifest binary)

Failed merges:

 - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests)

r? `@ghost`
  • Loading branch information
bors committed Oct 13, 2020
2 parents adef9da + b4a3b56 commit f243a2a
Show file tree
Hide file tree
Showing 107 changed files with 426 additions and 359 deletions.
68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Regression
about: Report something that unexpectedly changed between Rust versions.
labels: C-bug regression-untriaged
---
<!--
Thank you for filing a regression report! 🐛 A regression is something that changed between versions of Rust but was not supposed to.
Please provide a short summary of the regression, along with any information you feel is relevant to replicate it.
-->

### Code

I tried this code:

```rust
<code>
```

I expected to see this happen: *explanation*

Instead, this happened: *explanation*

### Version it worked on

<!--
Provide the most recent version this worked on, for example:
It most recently worked on: Rust 1.47
-->

It most recently worked on: <!-- version -->

### Version with regression

<!--
Provide the version you are using that has the regression.
-->

`rustc --version --verbose`:
```
<version>
```

<!--
Did the compiler crash? If so, please provide a backtrace.
-->

### Backtrace
<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary>Backtrace</summary>
<p>

```
<backtrace>
```

</p>
</details>

<!--
If you know when this regression occurred, please add a line like below, replacing `{channel}` with one of stable, beta, or nightly.
@rustbot modify labels: +regression-from-stable-to-{channel} -regression-untriaged
-->
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,16 @@ jobs:
- name: dist-aarch64-apple
env:
SCRIPT: "./x.py dist --stage 2"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --tools=rls,clippy,rustfmt,analysis,src"
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_beta.app
USE_XCODE_CLANG: 1
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
DIST_REQUIRE_ALL_TOOLS: 1
JEMALLOC_SYS_WITH_LG_PAGE: 14
os: macos-latest
- name: x86_64-msvc-1
env:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2192,9 +2192,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"

[[package]]
name = "openssl-src"
version = "111.10.2+1.1.1g"
version = "111.12.0+1.1.1h"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70"
checksum = "858a4132194f8570a7ee9eb8629e85b23cbc4565f2d4a162e87556e5956abf61"
dependencies = [
"cc",
]
Expand Down
19 changes: 5 additions & 14 deletions compiler/rustc_ast_pretty/src/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,11 @@ pub enum Token {

impl Token {
crate fn is_eof(&self) -> bool {
match *self {
Token::Eof => true,
_ => false,
}
matches!(self, Token::Eof)
}

pub fn is_hardbreak_tok(&self) -> bool {
match *self {
Token::Break(BreakToken { offset: 0, blank_space: bs }) if bs == SIZE_INFINITY => true,
_ => false,
}
matches!(self, Token::Break(BreakToken { offset: 0, blank_space: SIZE_INFINITY }))
}
}

Expand Down Expand Up @@ -491,12 +485,9 @@ impl Printer {
}

fn get_top(&mut self) -> PrintStackElem {
match self.print_stack.last() {
Some(el) => *el,
None => {
PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
}
}
*self.print_stack.last().unwrap_or({
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
})
}

fn print_begin(&mut self, b: BeginToken, l: isize) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ unsafe fn configure_llvm(sess: &Session) {

llvm::LLVMInitializePasses();

::rustc_llvm::initialize_available_targets();
rustc_llvm::initialize_available_targets();

llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
// necessary. There's already optimizations in place to avoid sending work
// back to the coordinator if LTO isn't requested.
return thread::spawn(move || {
let max_workers = ::num_cpus::get();
let max_workers = num_cpus::get();
let mut worker_id_counter = 0;
let mut free_worker_ids = Vec::new();
let mut get_worker_id = |free_worker_ids: &mut Vec<usize>| {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
total_codegen_time.into_inner(),
);

::rustc_incremental::assert_module_sources::assert_module_sources(tcx);
rustc_incremental::assert_module_sources::assert_module_sources(tcx);

symbol_names_test::report_symbol_names(tcx);

Expand Down Expand Up @@ -754,8 +754,8 @@ impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B> {
}

fn finalize_tcx(tcx: TyCtxt<'_>) {
tcx.sess.time("assert_dep_graph", || ::rustc_incremental::assert_dep_graph(tcx));
tcx.sess.time("serialize_dep_graph", || ::rustc_incremental::save_dep_graph(tcx));
tcx.sess.time("assert_dep_graph", || rustc_incremental::assert_dep_graph(tcx));
tcx.sess.time("serialize_dep_graph", || rustc_incremental::save_dep_graph(tcx));

// We assume that no queries are run past here. If there are new queries
// after this point, they'll show up as "<unknown>" in self-profiling data.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<'tcx, T> CodegenMethods<'tcx> for T where
}

pub trait HasCodegen<'tcx>:
Backend<'tcx> + ::std::ops::Deref<Target = <Self as HasCodegen<'tcx>>::CodegenCx>
Backend<'tcx> + std::ops::Deref<Target = <Self as HasCodegen<'tcx>>::CodegenCx>
{
type CodegenCx: CodegenMethods<'tcx>
+ BackendTypes<
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_data_structures/src/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Fingerprint {
}
}

impl ::std::fmt::Display for Fingerprint {
fn fmt(&self, formatter: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for Fingerprint {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "{:x}-{:x}", self.0, self.1)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub enum ProcessResult<O, E> {
struct ObligationTreeId(usize);

type ObligationTreeIdGenerator =
::std::iter::Map<::std::ops::RangeFrom<usize>, fn(usize) -> ObligationTreeId>;
std::iter::Map<std::ops::RangeFrom<usize>, fn(usize) -> ObligationTreeId>;

pub struct ObligationForest<O: ForestObligation> {
/// The list of obligations. In between calls to `process_obligations`,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_data_structures/src/sorted_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<K: Ord, V> SortedMap<K, V> {

/// Iterate over elements, sorted by key
#[inline]
pub fn iter(&self) -> ::std::slice::Iter<'_, (K, V)> {
pub fn iter(&self) -> std::slice::Iter<'_, (K, V)> {
self.data.iter()
}

Expand Down Expand Up @@ -134,7 +134,7 @@ impl<K: Ord, V> SortedMap<K, V> {
R: RangeBounds<K>,
{
let (start, end) = self.range_slice_indices(range);
self.data.splice(start..end, ::std::iter::empty());
self.data.splice(start..end, std::iter::empty());
}

/// Mutate all keys with the given function `f`. This mutation must not
Expand Down Expand Up @@ -241,7 +241,7 @@ impl<K: Ord, V> SortedMap<K, V> {

impl<K: Ord, V> IntoIterator for SortedMap<K, V> {
type Item = (K, V);
type IntoIter = ::std::vec::IntoIter<(K, V)>;
type IntoIter = std::vec::IntoIter<(K, V)>;

fn into_iter(self) -> Self::IntoIter {
self.data.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/stable_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct StableHasher {
}

impl ::std::fmt::Debug for StableHasher {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.state)
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl DefKey {

let DisambiguatedDefPathData { ref data, disambiguator } = self.disambiguated_data;

::std::mem::discriminant(data).hash(&mut hasher);
std::mem::discriminant(data).hash(&mut hasher);
if let Some(name) = data.get_opt_name() {
// Get a stable hash by considering the symbol chars rather than
// the symbol index.
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_infer/src/infer/nll_relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ where
// been fully instantiated and hence the set of scopes we have
// doesn't matter -- just to be sure, put an empty vector
// in there.
let old_a_scopes = ::std::mem::take(pair.vid_scopes(self));
let old_a_scopes = std::mem::take(pair.vid_scopes(self));

// Relate the generalized kind to the original one.
let result = pair.relate_generalized_ty(self, generalized_ty);
Expand Down Expand Up @@ -680,7 +680,7 @@ where
// itself occurs. Note that `'b` and `'c` must both
// include P. At the point, the call works because of
// subtyping (i.e., `&'b u32 <: &{P} u32`).
let variance = ::std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);
let variance = std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);

self.relate(a.skip_binder(), b.skip_binder())?;

Expand Down Expand Up @@ -709,7 +709,7 @@ where
// Reset ambient variance to contravariance. See the
// covariant case above for an explanation.
let variance =
::std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);

self.relate(a.skip_binder(), b.skip_binder())?;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/outlives/obligations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {

/// Trait queries just want to pass back type obligations "as is"
pub fn take_registered_region_obligations(&self) -> Vec<(hir::HirId, RegionObligation<'tcx>)> {
::std::mem::take(&mut self.inner.borrow_mut().region_obligations)
std::mem::take(&mut self.inner.borrow_mut().region_obligations)
}

/// Process the region obligations that must be proven (during
Expand Down
22 changes: 8 additions & 14 deletions compiler/rustc_middle/src/ich/impls_syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::ich::StableHashingContext;

use rustc_ast as ast;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::SourceFile;
use rustc_span::{BytePos, NormalizedPos, SourceFile};

use smallvec::SmallVec;

Expand Down Expand Up @@ -102,34 +102,28 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
}
}

fn stable_byte_pos(pos: ::rustc_span::BytePos, source_file_start: ::rustc_span::BytePos) -> u32 {
fn stable_byte_pos(pos: BytePos, source_file_start: BytePos) -> u32 {
pos.0 - source_file_start.0
}

fn stable_multibyte_char(
mbc: ::rustc_span::MultiByteChar,
source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) {
let ::rustc_span::MultiByteChar { pos, bytes } = mbc;
fn stable_multibyte_char(mbc: rustc_span::MultiByteChar, source_file_start: BytePos) -> (u32, u32) {
let rustc_span::MultiByteChar { pos, bytes } = mbc;

(pos.0 - source_file_start.0, bytes as u32)
}

fn stable_non_narrow_char(
swc: ::rustc_span::NonNarrowChar,
source_file_start: ::rustc_span::BytePos,
swc: rustc_span::NonNarrowChar,
source_file_start: BytePos,
) -> (u32, u32) {
let pos = swc.pos();
let width = swc.width();

(pos.0 - source_file_start.0, width as u32)
}

fn stable_normalized_pos(
np: ::rustc_span::NormalizedPos,
source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) {
let ::rustc_span::NormalizedPos { pos, diff } = np;
fn stable_normalized_pos(np: NormalizedPos, source_file_start: BytePos) -> (u32, u32) {
let NormalizedPos { pos, diff } = np;

(pos.0 - source_file_start.0, diff)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct Allocation<Tag = (), Extra = ()> {
pub extra: Extra,
}

pub trait AllocationExtra<Tag>: ::std::fmt::Debug + Clone {
pub trait AllocationExtra<Tag>: std::fmt::Debug + Clone {
// There is no constructor in here because the constructor's type depends
// on `MemoryKind`, and making things sufficiently generic leads to painful
// inference failure.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'tcx> ConstValue<'tcx> {

pub fn try_to_str_slice(&self) -> Option<&'tcx str> {
if let ConstValue::Slice { data, start, end } = *self {
::std::str::from_utf8(data.inspect_with_uninit_and_ptr_outside_interpreter(start..end))
std::str::from_utf8(data.inspect_with_uninit_and_ptr_outside_interpreter(start..end))
.ok()
} else {
None
Expand Down Expand Up @@ -465,7 +465,7 @@ impl<'tcx, Tag> Scalar<Tag> {

pub fn to_char(self) -> InterpResult<'tcx, char> {
let val = self.to_u32()?;
match ::std::char::from_u32(val) {
match std::char::from_u32(val) {
Some(c) => Ok(c),
None => throw_ub!(InvalidChar(val)),
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ mod binding_form_impl {
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for super::BindingForm<'tcx> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
use super::BindingForm::*;
::std::mem::discriminant(self).hash_stable(hcx, hasher);
std::mem::discriminant(self).hash_stable(hcx, hasher);

match self {
Var(binding) => binding.hash_stable(hcx, hasher),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ impl<'tcx, T: HasTyCtxt<'tcx>> HasTyCtxt<'tcx> for LayoutCx<'tcx, T> {
}
}

pub type TyAndLayout<'tcx> = ::rustc_target::abi::TyAndLayout<'tcx, Ty<'tcx>>;
pub type TyAndLayout<'tcx> = rustc_target::abi::TyAndLayout<'tcx, Ty<'tcx>>;

impl<'tcx> LayoutOf for LayoutCx<'tcx, TyCtxt<'tcx>> {
type Ty = Ty<'tcx>;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<'tcx> TyCtxt<'tcx> {
{
debug!(
"normalize_erasing_regions::<{}>(value={:?}, param_env={:?})",
::std::any::type_name::<T>(),
std::any::type_name::<T>(),
value,
param_env,
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ pub trait PrettyPrinter<'tcx>:
// relocations (we have an active `str` reference here). We don't use this
// result to affect interpreter execution.
let slice = data.inspect_with_uninit_and_ptr_outside_interpreter(start..end);
let s = ::std::str::from_utf8(slice).expect("non utf8 str from miri");
let s = std::str::from_utf8(slice).expect("non utf8 str from miri");
p!(write("{:?}", s));
Ok(self)
}
Expand Down
Loading

0 comments on commit f243a2a

Please sign in to comment.