Skip to content

Rollup of 10 pull requests #77903

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

Closed
wants to merge 28 commits into from
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
97beb07
BTreeMap: derive type-specific variants of node_as_mut and cast_unche…
ssomers Oct 3, 2020
e55d27f
Remove unnecessary rustc_const_stable attributes.
m-ou-se Oct 8, 2020
c25f69a
Remove unsafety from unsupported/mutex.rs by using a Cell.
m-ou-se Oct 8, 2020
3d192ac
Remove unsafety from unsupported/rwlosck.rs by using a Cell.
m-ou-se Oct 8, 2020
f4e8842
Apply deny(unsafe_op_in_unsafe_fn) to all of sys/unsupported.
m-ou-se Oct 8, 2020
f1c3edb
Assert state in sys/unsupported's RwLock::write_unlock.
m-ou-se Oct 8, 2020
23c3356
Mention rustdoc in `x.py setup`
jyn514 Oct 10, 2020
d7029cb
`min_const_generics` diagnostics improvements
eopb Oct 11, 2020
eec4436
Make error help clearer
eopb Oct 12, 2020
e62da8f
Remove a little jargon from error
eopb Oct 12, 2020
facb38d
A little rewording
eopb Oct 12, 2020
c16c8ac
Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component
Aaron1011 Oct 12, 2020
79351b1
Bless expected errors
eopb Oct 12, 2020
61e722f
Use Option::unwrap_or instead of open-coding it
LingMan Oct 12, 2020
45a34fc
Include aarch64-apple-darwin in the dist manifests
shepmaster Oct 13, 2020
a0fc455
Replace absolute paths with relative ones
est31 Oct 13, 2020
b26aa5d
Add note about using cells in the locks on the 'unsupported' platform.
m-ou-se Oct 13, 2020
b7080e6
Give an error when running `x.py test --stage 0 src/test/ui`
jyn514 Oct 10, 2020
1a33ac0
Rollup merge of #77569 - ssomers:btree_cleanup_1, r=Mark-Simulacrum
JohnTitor Oct 13, 2020
1d8af29
Rollup merge of #77719 - fusion-engineering-forks:const-new-mutex-att…
JohnTitor Oct 13, 2020
9260b04
Rollup merge of #77722 - fusion-engineering-forks:safe-unsupported-lo…
JohnTitor Oct 13, 2020
7450b7e
Rollup merge of #77776 - jyn514:wrong-way, r=Mark-Simulacrum
JohnTitor Oct 13, 2020
a732d3a
Rollup merge of #77786 - jyn514:rustdoc, r=Mark-Simulacrum
JohnTitor Oct 13, 2020
807b981
Rollup merge of #77825 - ethanboxx:min_const_generics_diagnostic, r=lcnr
JohnTitor Oct 13, 2020
71340d5
Rollup merge of #77868 - Aaron1011:llvm-tools-opt-llc, r=Mark-Simulacrum
JohnTitor Oct 13, 2020
4f70e26
Rollup merge of #77884 - LingMan:ast_pretty_unwrap_or, r=varkor
JohnTitor Oct 13, 2020
9f4c5b3
Rollup merge of #77892 - est31:remove_redundant_absolute_paths, r=lcnr
JohnTitor Oct 13, 2020
02785e9
Rollup merge of #77895 - shepmaster:silicon-manifest, r=pietroalbini
JohnTitor Oct 13, 2020
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
9 changes: 3 additions & 6 deletions compiler/rustc_ast_pretty/src/pp.rs
Original file line number Diff line number Diff line change
@@ -491,12 +491,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) {
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
@@ -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());
}
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
@@ -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>| {
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
@@ -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);

@@ -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.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/traits/mod.rs
Original file line number Diff line number Diff line change
@@ -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<
4 changes: 2 additions & 2 deletions compiler/rustc_data_structures/src/fingerprint.rs
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -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`,
6 changes: 3 additions & 3 deletions compiler/rustc_data_structures/src/sorted_map.rs
Original file line number Diff line number Diff line change
@@ -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()
}

@@ -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
@@ -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()
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/stable_hasher.rs
Original file line number Diff line number Diff line change
@@ -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)
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/definitions.rs
Original file line number Diff line number Diff line change
@@ -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.
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
@@ -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);
@@ -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())?;

@@ -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())?;

2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/outlives/obligations.rs
Original file line number Diff line number Diff line change
@@ -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
22 changes: 8 additions & 14 deletions compiler/rustc_middle/src/ich/impls_syntax.rs
Original file line number Diff line number Diff line change
@@ -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;

@@ -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)
}
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/interpret/value.rs
Original file line number Diff line number Diff line change
@@ -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
@@ -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)),
}
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
@@ -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),
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
@@ -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>;
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
@@ -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,
);
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
@@ -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)
}
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/query/on_disk_cache.rs
Original file line number Diff line number Diff line change
@@ -543,7 +543,7 @@ impl<'a, 'tcx> DecoderWithPosition for CacheDecoder<'a, 'tcx> {
// tag matches and the correct amount of bytes was read.
fn decode_tagged<D, T, V>(decoder: &mut D, expected_tag: T) -> Result<V, D::Error>
where
T: Decodable<D> + Eq + ::std::fmt::Debug,
T: Decodable<D> + Eq + std::fmt::Debug,
V: Decodable<D>,
D: DecoderWithPosition,
{
@@ -1023,7 +1023,7 @@ where
let _timer = tcx
.sess
.prof
.extra_verbose_generic_activity("encode_query_results_for", ::std::any::type_name::<Q>());
.extra_verbose_generic_activity("encode_query_results_for", std::any::type_name::<Q>());

let state = Q::query_state(tcx);
assert!(state.all_inactive());
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/util.rs
Original file line number Diff line number Diff line change
@@ -646,8 +646,8 @@ impl<'tcx> ty::TyS<'tcx> {
}
ty::Char => Some(std::char::MAX as u128),
ty::Float(fty) => Some(match fty {
ast::FloatTy::F32 => ::rustc_apfloat::ieee::Single::INFINITY.to_bits(),
ast::FloatTy::F64 => ::rustc_apfloat::ieee::Double::INFINITY.to_bits(),
ast::FloatTy::F32 => rustc_apfloat::ieee::Single::INFINITY.to_bits(),
ast::FloatTy::F64 => rustc_apfloat::ieee::Double::INFINITY.to_bits(),
}),
_ => None,
};
7 changes: 4 additions & 3 deletions compiler/rustc_mir/src/interpret/machine.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
//! interpreting common C functions leak into CTFE.

use std::borrow::{Borrow, Cow};
use std::fmt::Debug;
use std::hash::Hash;

use rustc_middle::mir;
@@ -79,19 +80,19 @@ pub trait AllocMap<K: Hash + Eq, V> {
/// and some use case dependent behaviour can instead be applied.
pub trait Machine<'mir, 'tcx>: Sized {
/// Additional memory kinds a machine wishes to distinguish from the builtin ones
type MemoryKind: ::std::fmt::Debug + ::std::fmt::Display + MayLeak + Eq + 'static;
type MemoryKind: Debug + std::fmt::Display + MayLeak + Eq + 'static;

/// Tag tracked alongside every pointer. This is used to implement "Stacked Borrows"
/// <https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html>.
/// The `default()` is used for pointers to consts, statics, vtables and functions.
/// The `Debug` formatting is used for displaying pointers; we cannot use `Display`
/// as `()` does not implement that, but it should be "nice" output.
type PointerTag: ::std::fmt::Debug + Copy + Eq + Hash + 'static;
type PointerTag: Debug + Copy + Eq + Hash + 'static;

/// Machines can define extra (non-instance) things that represent values of function pointers.
/// For example, Miri uses this to return a function pointer from `dlsym`
/// that can later be called to execute the right thing.
type ExtraFnVal: ::std::fmt::Debug + Copy;
type ExtraFnVal: Debug + Copy;

/// Extra data stored in every call frame.
type FrameExtra;
6 changes: 3 additions & 3 deletions compiler/rustc_mir/src/interpret/operand.rs
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ impl<Tag: Copy> std::fmt::Display for ImmTy<'tcx, Tag> {
}
}

impl<'tcx, Tag> ::std::ops::Deref for ImmTy<'tcx, Tag> {
impl<'tcx, Tag> std::ops::Deref for ImmTy<'tcx, Tag> {
type Target = Immediate<Tag>;
#[inline(always)]
fn deref(&self) -> &Immediate<Tag> {
@@ -156,7 +156,7 @@ pub struct OpTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

impl<'tcx, Tag> ::std::ops::Deref for OpTy<'tcx, Tag> {
impl<'tcx, Tag> std::ops::Deref for OpTy<'tcx, Tag> {
type Target = Operand<Tag>;
#[inline(always)]
fn deref(&self) -> &Operand<Tag> {
@@ -340,7 +340,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
pub fn read_str(&self, mplace: MPlaceTy<'tcx, M::PointerTag>) -> InterpResult<'tcx, &str> {
let len = mplace.len(self)?;
let bytes = self.memory.read_bytes(mplace.ptr, Size::from_bytes(len))?;
let str = ::std::str::from_utf8(bytes).map_err(|err| err_ub!(InvalidStr(err)))?;
let str = std::str::from_utf8(bytes).map_err(|err| err_ub!(InvalidStr(err)))?;
Ok(str)
}

Loading