Skip to content

Commit

Permalink
Auto merge of rust-lang#75070 - Manishearth:rollup-2kgcaw5, r=Manishe…
Browse files Browse the repository at this point in the history
…arth

Rollup of 5 pull requests

Successful merges:

 - rust-lang#74980 (pprust: adjust mixed comment printing and add regression test for rust-lang#74745)
 - rust-lang#75009 (Document the discrepancy in the mask type for _mm_shuffle_ps)
 - rust-lang#75031 (Do not trigger `unused_{braces,parens}` lints with `yield`)
 - rust-lang#75059 (fix typos)
 - rust-lang#75064 (compiletest: Support ignoring tests requiring missing LLVM components)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Aug 2, 2020
2 parents f042d74 + 0bf2dcf commit 81e754c
Show file tree
Hide file tree
Showing 45 changed files with 191 additions and 56 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ impl<T: ?Sized> Unpin for Rc<T> {}
///
/// - This function is safe for any argument if `T` is sized, and
/// - if `T` is unsized, the pointer must have appropriate pointer metadata
/// aquired from the real instance that you are getting this offset for.
/// acquired from the real instance that you are getting this offset for.
unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
// Align the unsized value to the end of the `RcBox`.
// Because it is ?Sized, it will always be the last field in memory.
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ impl<T: ?Sized> Unpin for Arc<T> {}
///
/// - This function is safe for any argument if `T` is sized, and
/// - if `T` is unsized, the pointer must have appropriate pointer metadata
/// aquired from the real instance that you are getting this offset for.
/// acquired from the real instance that you are getting this offset for.
unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
// Align the unsized value to the end of the `ArcInner`.
// Because it is `?Sized`, it will always be the last field in memory.
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/tests/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn box_clone_and_clone_from_equivalence() {
/// This test might give a false positive in case the box realocates, but the alocator keeps the
/// original pointer.
///
/// On the other hand it won't give a false negative, if it fails than the memory was definitly not
/// On the other hand it won't give a false negative, if it fails than the memory was definitely not
/// reused
#[test]
fn box_clone_from_ptr_stability() {
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ unsafe impl AllocRef for System {
ReallocPlacement::MayMove if layout.size() == 0 => {
let new_layout =
// SAFETY: The new size and layout alignement guarantees
// are transfered to the caller (they come from parameters).
// are transferred to the caller (they come from parameters).
//
// See the preconditions for `Layout::from_size_align` to
// see what must be checked.
Expand Down Expand Up @@ -254,7 +254,7 @@ unsafe impl AllocRef for System {
//
// See `GlobalAlloc::realloc` for more informations about the
// guarantees expected by this method. `ptr`, `layout` and
// `new_size` are parameters and the responsability for their
// `new_size` are parameters and the responsibility for their
// correctness is left to the caller.
//
// `realloc` probably checks for `new_size < size` or something
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ mod self_upper_keyword {}
///
/// let r1 = &FOO as *const _;
/// let r2 = &FOO as *const _;
/// // With a strictly read-only static, references will have the same adress
/// // With a strictly read-only static, references will have the same address
/// assert_eq!(r1, r2);
/// // A static item can be used just like a variable in many cases
/// println!("{:?}", FOO);
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
// see the changes to drop the `Waiter` struct correctly.
// * There is one place where the two atomics `Once.state_and_queue` and
// `Waiter.signaled` come together, and might be reordered by the compiler or
// processor. Because both use Aquire ordering such a reordering is not
// processor. Because both use Acquire ordering such a reordering is not
// allowed, so no need for SeqCst.

use crate::cell::Cell;
Expand Down
2 changes: 1 addition & 1 deletion library/stdarch
30 changes: 15 additions & 15 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1158,13 +1158,19 @@ impl Step for Compiletest {
cmd.arg("--quiet");
}

let mut llvm_components_passed = false;
let mut copts_passed = false;
if builder.config.llvm_enabled() {
let llvm_config = builder.ensure(native::Llvm { target: builder.config.build });
if !builder.config.dry_run {
let llvm_version = output(Command::new(&llvm_config).arg("--version"));
let llvm_components = output(Command::new(&llvm_config).arg("--components"));
// Remove trailing newline from llvm-config output.
let llvm_version = llvm_version.trim_end();
cmd.arg("--llvm-version").arg(llvm_version);
cmd.arg("--llvm-version")
.arg(llvm_version.trim())
.arg("--llvm-components")
.arg(llvm_components.trim());
llvm_components_passed = true;
}
if !builder.is_rust_llvm(target) {
cmd.arg("--system-llvm");
Expand All @@ -1182,15 +1188,13 @@ impl Step for Compiletest {
// Only pass correct values for these flags for the `run-make` suite as it
// requires that a C++ compiler was configured which isn't always the case.
if !builder.config.dry_run && suite == "run-make-fulldeps" {
let llvm_components = output(Command::new(&llvm_config).arg("--components"));
cmd.arg("--cc")
.arg(builder.cc(target))
.arg("--cxx")
.arg(builder.cxx(target).unwrap())
.arg("--cflags")
.arg(builder.cflags(target, GitRepo::Rustc).join(" "))
.arg("--llvm-components")
.arg(llvm_components.trim());
.arg(builder.cflags(target, GitRepo::Rustc).join(" "));
copts_passed = true;
if let Some(ar) = builder.ar(target) {
cmd.arg("--ar").arg(ar);
}
Expand Down Expand Up @@ -1220,15 +1224,11 @@ impl Step for Compiletest {
}
}

if suite != "run-make-fulldeps" {
cmd.arg("--cc")
.arg("")
.arg("--cxx")
.arg("")
.arg("--cflags")
.arg("")
.arg("--llvm-components")
.arg("");
if !llvm_components_passed {
cmd.arg("--llvm-components").arg("");
}
if !copts_passed {
cmd.arg("--cc").arg("").arg("--cxx").arg("").arg("--cflags").arg("");
}

if builder.remote_tested(target) {
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_ast_pretty/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
fn print_comment(&mut self, cmnt: &comments::Comment) {
match cmnt.style {
comments::Mixed => {
self.zerobreak();
if !self.is_beginning_of_line() {
self.zerobreak();
}
if let Some((last, lines)) = cmnt.lines.split_last() {
self.ibox(0);

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
return self.unify_const_variable(!a_is_expected, vid, a);
}
(ty::ConstKind::Unevaluated(..), _) if self.tcx.lazy_normalization() => {
// FIXME(#59490): Need to remove the leak check to accomodate
// FIXME(#59490): Need to remove the leak check to accommodate
// escaping bound variables here.
if !a.has_escaping_bound_vars() && !b.has_escaping_bound_vars() {
relation.const_equate_obligation(a, b);
}
return Ok(b);
}
(_, ty::ConstKind::Unevaluated(..)) if self.tcx.lazy_normalization() => {
// FIXME(#59490): Need to remove the leak check to accomodate
// FIXME(#59490): Need to remove the leak check to accommodate
// escaping bound variables here.
if !a.has_escaping_bound_vars() && !b.has_escaping_bound_vars() {
relation.const_equate_obligation(a, b);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
}
}
if let (Some(ident), true) = (override_error_code, fn_returns.is_empty()) {
// Provide a more targetted error code and description.
// Provide a more targeted error code and description.
err.code(rustc_errors::error_code!(E0772));
err.set_primary_message(&format!(
"{} has {} but calling `{}` introduces an implicit `'static` lifetime \
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ trait UnusedDelimLint {
lhs_needs_parens
|| (followed_by_block
&& match inner.kind {
ExprKind::Ret(_) | ExprKind::Break(..) => true,
ExprKind::Ret(_) | ExprKind::Break(..) | ExprKind::Yield(..) => true,
_ => parser::contains_exterior_struct_lit(&inner),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl<'a, 'tcx> SpecializedEncoder<Span> for EncodeContext<'a, 'tcx> {
// real code should never need to care about this.
//
// 2. Using `Span::def_site` or `Span::mixed_site` will not
// include any hygiene information associated with the defintion
// include any hygiene information associated with the definition
// site. This means that a proc-macro cannot emit a `$crate`
// identifier which resolves to one of its dependencies,
// which also should never come up in practice.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_middle/ty/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ struct OpaqueTypeExpander<'tcx> {
found_recursion: bool,
/// Whether or not to check for recursive opaque types.
/// This is `true` when we're explicitly checking for opaque type
/// recursion, and 'false' otherwise to avoid unecessary work.
/// recursion, and 'false' otherwise to avoid unnecessary work.
check_recursion: bool,
tcx: TyCtxt<'tcx>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/promote_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl<'tcx> Validator<'_, 'tcx> {
// The `is_empty` predicate is introduced to exclude the case
// where the projection operations are [ .field, * ].
// The reason is because promotion will be illegal if field
// accesses preceed the dereferencing.
// accesses precede the dereferencing.
// Discussion can be found at
// https://github.com/rust-lang/rust/pull/74945#discussion_r463063247
// There may be opportunity for generalization, but this needs to be
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir_build/thir/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ crate enum PatKind<'tcx> {
var: hir::HirId,
ty: Ty<'tcx>,
subpattern: Option<Pat<'tcx>>,
/// Is this the leftmost occurance of the binding, i.e., is `var` the
/// Is this the leftmost occurrence of the binding, i.e., is `var` the
/// `HirId` of this pattern?
is_primary: bool,
},
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
}

// `-Z instrument-coverage` implies:
// * `-Z symbol-mangling-version=v0` - to ensure consistent and reversable name mangling.
// * `-Z symbol-mangling-version=v0` - to ensure consistent and reversible name mangling.
// Note, LLVM coverage tools can analyze coverage over multiple runs, including some
// changes to source code; so mangled names must be consistent across compilations.
// * `-C link-dead-code` - so unexecuted code is still counted as zero, rather than be
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_session/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl GatedSpans {

#[derive(Default)]
pub struct SymbolGallery {
/// All symbols occurred and their first occurrance span.
/// All symbols occurred and their first occurrence span.
pub symbols: Lock<BTreeMap<Symbol, Span>>,
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_span/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ impl UseSpecializedDecodable for ExpnId {}

#[derive(Default)]
pub struct HygieneEncodeContext {
/// All `SyntaxContexts` for which we have writen `SyntaxContextData` into crate metadata.
/// All `SyntaxContexts` for which we have written `SyntaxContextData` into crate metadata.
/// This is `None` after we finish encoding `SyntaxContexts`, to ensure
/// that we don't accidentally try to encode any more `SyntaxContexts`
serialized_ctxts: Lock<FxHashSet<SyntaxContext>>,
Expand Down Expand Up @@ -961,7 +961,7 @@ pub struct HygieneDecodeContext {
// Maps serialized `SyntaxContext` ids to a `SyntaxContext` in the current
// global `HygieneData`. When we deserialize a `SyntaxContext`, we need to create
// a new id in the global `HygieneData`. This map tracks the ID we end up picking,
// so that multiple occurences of the same serialized id are decoded to the same
// so that multiple occurrences of the same serialized id are decoded to the same
// `SyntaxContext`
remapped_ctxts: Lock<Vec<Option<SyntaxContext>>>,
// The same as `remapepd_ctxts`, but for `ExpnId`s
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
//
// Both of these trigger a special `CoerceUnsized`-related error (E0376)
//
// We can take advantage of this fact to avoid performing unecessary work.
// We can take advantage of this fact to avoid performing unnecessary work.
// If either `source` or `target` is a type variable, then any applicable impl
// would need to be generic over the self-type (`impl<T> CoerceUnsized<SomeType> for T`)
// or generic over the `CoerceUnsized` type parameter (`impl<T> CoerceUnsized<T> for
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/aarch64-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// assembly-output: emit-asm
// compile-flags: -O
// compile-flags: --target aarch64-unknown-linux-gnu
// needs-llvm-components: aarch64

#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/aarch64-types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// no-system-llvm
// assembly-output: emit-asm
// compile-flags: --target aarch64-unknown-linux-gnu
// needs-llvm-components: aarch64

#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/arm-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// compile-flags: -O
// compile-flags: --target armv7-unknown-linux-gnueabihf
// compile-flags: -C target-feature=+neon
// needs-llvm-components: arm

#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/arm-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// assembly-output: emit-asm
// compile-flags: --target armv7-unknown-linux-gnueabihf
// compile-flags: -C target-feature=+neon
// needs-llvm-components: arm

#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/hexagon-types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// no-system-llvm
// assembly-output: emit-asm
// compile-flags: --target hexagon-unknown-linux-musl
// needs-llvm-components: hexagon

#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/nvptx-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// assembly-output: emit-asm
// compile-flags: --target nvptx64-nvidia-cuda
// compile-flags: --crate-type cdylib
// needs-llvm-components: nvptx

#![feature(no_core, lang_items, rustc_attrs)]
#![no_core]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/riscv-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// compile-flags: -O
// compile-flags: --target riscv64gc-unknown-linux-gnu
// compile-flags: -C target-feature=+f
// needs-llvm-components: riscv

#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
Expand Down
1 change: 1 addition & 0 deletions src/test/assembly/asm/riscv-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//[riscv64] compile-flags: --target riscv64imac-unknown-none-elf
//[riscv32] compile-flags: --target riscv32imac-unknown-none-elf
// compile-flags: -C target-feature=+d
// needs-llvm-components: riscv

#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
Expand Down
8 changes: 6 additions & 2 deletions src/test/codegen/abi-efiapi.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Checks if the correct annotation for the efiapi ABI is passed to llvm.

// revisions:x86_64 i686 arm

// revisions:x86_64 i686 aarch64 arm riscv
// min-llvm-version: 9.0
// needs-llvm-components: aarch64 arm riscv

//[x86_64] compile-flags: --target x86_64-unknown-uefi
//[i686] compile-flags: --target i686-unknown-linux-musl
//[aarch64] compile-flags: --target aarch64-unknown-none
//[arm] compile-flags: --target armv7r-none-eabi
//[riscv] compile-flags: --target riscv64gc-unknown-none-elf
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
Expand All @@ -22,6 +24,8 @@ trait Copy { }

//x86_64: define win64cc void @has_efiapi
//i686: define void @has_efiapi
//aarch64: define void @has_efiapi
//arm: define void @has_efiapi
//riscv: define void @has_efiapi
#[no_mangle]
pub extern "efiapi" fn has_efiapi() {}
1 change: 1 addition & 0 deletions src/test/codegen/avr/avr-func-addrspace.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// compile-flags: -O --target=avr-unknown-unknown --crate-type=rlib
// needs-llvm-components: avr

// This test validates that function pointers can be stored in global variables
// and called upon. It ensures that Rust emits function pointers in the correct
Expand Down
2 changes: 0 additions & 2 deletions src/test/pretty/block-comment-wchar.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,13 @@
*/



/* */

/*
Hello from offset 6
Space 6+2: compare A
Ogham Space Mark 6+2: compare B
*/

/* */

/*
Expand Down
5 changes: 5 additions & 0 deletions src/test/pretty/issue-74745.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// ignore-tidy-trailing-newlines
// pretty-compare-only

/*
*/
2 changes: 1 addition & 1 deletion src/test/ui/consts/const_in_pattern/warn_corner_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// const-evaluator computes a value that *does* meet the conditions for
// structural-match, but the const expression itself has abstractions (like
// calls to const functions) that may fit better with a type-based analysis
// rather than a committment to a specific value.
// rather than a commitment to a specific value.

#![warn(indirect_structural_match)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-73976-polymorphic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This test is from #73976. We previously did not check if a type is monomorphized
// before calculating its type id, which leads to the bizzare behaviour below that
// before calculating its type id, which leads to the bizarre behaviour below that
// TypeId of a generic type does not match itself.
//
// This test case should either run-pass or be rejected at compile time.
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-37131.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// compile-flags: --target=thumbv6m-none-eabi
// ignore-arm
// needs-llvm-components: arm

// error-pattern:target may not be installed
fn main() { }
Loading

0 comments on commit 81e754c

Please sign in to comment.