Skip to content
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

Rollup of 14 pull requests #55746

Merged
merged 31 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6df57a7
Slight copy-editing for `std::cell::Cell` docs
goffrie Oct 26, 2018
42d3ef7
Remove unused re import in gdb_rust_pretty_printing
KamilaBorowska Oct 28, 2018
20aa751
Choose predicates without inference variables over those with them
Aaron1011 Oct 28, 2018
a7bea73
Don't print opt fuel messages to stdout because it breaks Rustbuild
wesleywiser Oct 24, 2018
dbc3c6e
Make `process_obligations`' computation of `completed` optional.
nnethercote Oct 30, 2018
d22ae75
Fix feature gate only being checked on first repr attr.
bitshifter Oct 30, 2018
84775ed
-C remark: fix incorrect warning about requiring "--debuginfo" instea…
matthiaskrgr Nov 5, 2018
842914e
Add `aarch64-pc-windows-msvc` to deployed targets
alexcrichton Nov 5, 2018
a1c4060
Moved and renamed ui issue tests.
alexreg Nov 5, 2018
22b571d
Add explcit `--error-format` options to tests of print-fuel to sidest…
pnkfelix Nov 6, 2018
66702fc
Run name-anon-globals after LTO passes as well
nikic Nov 2, 2018
2869fda
Update lldb
tromey Nov 1, 2018
46fcf1c
Use trait impl method span when type param mismatch is due to impl Trait
estebank Nov 6, 2018
eca11b9
refactor: use shorthand fields
teresy Nov 6, 2018
ac9d5ec
Rollup merge of #55377 - goffrie:patch-2, r=joshtriplett
kennytm Nov 7, 2018
0156dd2
Rollup merge of #55441 - xfix:patch-12, r=aturon
kennytm Nov 7, 2018
88f214c
Rollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix
kennytm Nov 7, 2018
099c587
Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis
kennytm Nov 7, 2018
d64142b
Rollup merge of #55501 - nnethercote:DoCompleted, r=pnkfelix
kennytm Nov 7, 2018
0708a6a
Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petroche…
kennytm Nov 7, 2018
dfa104e
Rollup merge of #55609 - nikic:fix-51947, r=nagisa
kennytm Nov 7, 2018
8f93a3c
Rollup merge of #55688 - alexreg:move-issue-tests, r=estebank
kennytm Nov 7, 2018
3682d31
Rollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michae…
kennytm Nov 7, 2018
6f10e34
Rollup merge of #55702 - alexcrichton:arm64-msvc-deploy, r=michaelwoe…
kennytm Nov 7, 2018
9dba743
do not print wrapping ranges like normal ranges in diagnostics
RalfJung Nov 3, 2018
b42b9b3
pretty-print scalar range that only has an upper bound
RalfJung Nov 3, 2018
3ec8974
test diagnostics for more ranges
RalfJung Nov 3, 2018
dd9ea2a
Rollup merge of #55728 - tromey:update-lldb, r=alexcrichton
kennytm Nov 7, 2018
e222d1d
Rollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor
kennytm Nov 7, 2018
9d9146a
Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwco
kennytm Nov 7, 2018
4e86576
Rollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk
kennytm Nov 7, 2018
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
1 change: 0 additions & 1 deletion src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# except according to those terms.

import gdb
import re
import sys
import debugger_pretty_printers_common as rustpp

Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ impl String {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
match str::from_utf8(&vec) {
Ok(..) => Ok(String { vec: vec }),
Ok(..) => Ok(String { vec }),
Err(e) => {
Err(FromUtf8Error {
bytes: vec,
Expand Down
9 changes: 5 additions & 4 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ use ptr;
///
/// # Examples
///
/// Here you can see how using `Cell<T>` allows to use mutable field inside
/// immutable struct (which is also called 'interior mutability').
/// In this example, you can see that `Cell<T>` enables mutation inside an
/// immutable struct. In other words, it enables "interior mutability".
///
/// ```
/// use std::cell::Cell;
Expand All @@ -225,10 +225,11 @@ use ptr;
///
/// let new_value = 100;
///
/// // ERROR, because my_struct is immutable
/// // ERROR: `my_struct` is immutable
/// // my_struct.regular_field = new_value;
///
/// // WORKS, although `my_struct` is immutable, field `special_field` is mutable because it is Cell
/// // WORKS: although `my_struct` is immutable, `special_field` is a `Cell`,
/// // which can always be mutated
/// my_struct.special_field.set(new_value);
/// assert_eq!(my_struct.special_field.get(), new_value);
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/libpanic_unwind/dwarf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct Unaligned<T>(T);

impl DwarfReader {
pub fn new(ptr: *const u8) -> DwarfReader {
DwarfReader { ptr: ptr }
DwarfReader { ptr }
}

// DWARF streams are packed, so e.g. a u32 would not necessarily be aligned
Expand Down
2 changes: 1 addition & 1 deletion src/libpanic_unwind/seh64_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct PanicData {
}

pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
let panic_ctx = Box::new(PanicData { data: data });
let panic_ctx = Box::new(PanicData { data });
let params = [Box::into_raw(panic_ctx) as c::ULONG_PTR];
c::RaiseException(RUST_PANIC,
c::EXCEPTION_NONCONTINUABLE,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct OpportunisticTypeResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {

impl<'a, 'gcx, 'tcx> OpportunisticTypeResolver<'a, 'gcx, 'tcx> {
pub fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> Self {
OpportunisticTypeResolver { infcx: infcx }
OpportunisticTypeResolver { infcx }
}
}

Expand Down Expand Up @@ -54,7 +54,7 @@ pub struct OpportunisticTypeAndRegionResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {

impl<'a, 'gcx, 'tcx> OpportunisticTypeAndRegionResolver<'a, 'gcx, 'tcx> {
pub fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> Self {
OpportunisticTypeAndRegionResolver { infcx: infcx }
OpportunisticTypeAndRegionResolver { infcx }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/type_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
// Hack: we only need this so that `types_escaping_snapshot`
// can see what has been unified; see the Delegate impl for
// more details.
self.values.record(Instantiate { vid: vid });
self.values.record(Instantiate { vid });
}

/// Creates a new type variable.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/unify_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl UnifyValue for RegionVidKey {
value2.min_vid
};

Ok(RegionVidKey { min_vid: min_vid })
Ok(RegionVidKey { min_vid })
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl<'a, 'tcx> Index<'tcx> {
/// Cross-references the feature names of unstable APIs with enabled
/// features and possibly prints errors.
pub fn check_unstable_api_usage<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let mut checker = Checker { tcx: tcx };
let mut checker = Checker { tcx };
tcx.hir.krate().visit_all_item_likes(&mut checker.as_deep_visitor());
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
use mir::TerminatorKind::*;

let kind = match self.kind {
Goto { target } => Goto { target: target },
Goto { target } => Goto { target },
SwitchInt {
ref discr,
switch_ty,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/tcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum PlaceTy<'tcx> {

impl<'a, 'gcx, 'tcx> PlaceTy<'tcx> {
pub fn from_ty(ty: Ty<'tcx>) -> PlaceTy<'tcx> {
PlaceTy::Ty { ty: ty }
PlaceTy::Ty { ty }
}

pub fn to_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx> {
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,7 @@ pub fn build_session_options_and_crate_config(
if !cg.remark.is_empty() && debuginfo == DebugInfo::None {
early_warn(
error_format,
"-C remark will not show source locations without \
--debuginfo",
"-C remark requires \"-C debuginfo=n\" to show source locations",
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ impl Session {
let fuel = self.optimization_fuel_limit.get();
ret = fuel != 0;
if fuel == 0 && !self.out_of_fuel.get() {
println!("optimization-fuel-exhausted: {}", msg());
eprintln!("optimization-fuel-exhausted: {}", msg());
self.out_of_fuel.set(true);
} else if fuel > 0 {
self.optimization_fuel_limit.set(fuel - 1);
Expand Down
42 changes: 33 additions & 9 deletions src/librustc/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,27 +447,51 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
ty::RegionKind::ReLateBound(_, _),
) => {}

(ty::RegionKind::ReLateBound(_, _), _) => {
(ty::RegionKind::ReLateBound(_, _), _) |
(_, ty::RegionKind::ReVar(_)) => {
// One of these is true:
// The new predicate has a HRTB in a spot where the old
// predicate does not (if they both had a HRTB, the previous
// match arm would have executed).
// match arm would have executed). A HRBT is a 'stricter'
// bound than anything else, so we want to keep the newer
// predicate (with the HRBT) in place of the old predicate.
//
// The means we want to remove the older predicate from
// user_computed_preds, since having both it and the new
// OR
//
// The old predicate has a region variable where the new
// predicate has some other kind of region. An region
// variable isn't something we can actually display to a user,
// so we choose ther new predicate (which doesn't have a region
// varaible).
//
// In both cases, we want to remove the old predicate,
// from user_computed_preds, and replace it with the new
// one. Having both the old and the new
// predicate in a ParamEnv would confuse SelectionContext
//
// We're currently in the predicate passed to 'retain',
// so we return 'false' to remove the old predicate from
// user_computed_preds
return false;
}
(_, ty::RegionKind::ReLateBound(_, _)) => {
// This is the opposite situation as the previous arm - the
// old predicate has a HRTB lifetime in a place where the
// new predicate does not. We want to leave the old
(_, ty::RegionKind::ReLateBound(_, _)) |
(ty::RegionKind::ReVar(_), _) => {
// This is the opposite situation as the previous arm.
// One of these is true:
//
// The old predicate has a HRTB lifetime in a place where the
// new predicate does not.
//
// OR
//
// The new predicate has a region variable where the old
// predicate has some other type of region.
//
// We want to leave the old
// predicate in user_computed_preds, and skip adding
// new_pred to user_computed_params.
should_add_new = false
}
},
_ => {}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/librustc/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use infer::InferCtxt;
use mir::interpret::{GlobalId, ErrorHandled};
use ty::{self, Ty, TypeFoldable, ToPolyTraitRef, ToPredicate};
use ty::error::ExpectedFound;
use rustc_data_structures::obligation_forest::{Error, ForestObligation, ObligationForest};
use rustc_data_structures::obligation_forest::{ObligationProcessor, ProcessResult};
use rustc_data_structures::obligation_forest::{DoCompleted, Error, ForestObligation};
use rustc_data_structures::obligation_forest::{ObligationForest, ObligationProcessor};
use rustc_data_structures::obligation_forest::{ProcessResult};
use std::marker::PhantomData;
use hir::def_id::DefId;

Expand Down Expand Up @@ -98,7 +99,7 @@ impl<'a, 'gcx, 'tcx> FulfillmentContext<'tcx> {
let outcome = self.predicates.process_obligations(&mut FulfillProcessor {
selcx,
register_region_obligations: self.register_region_obligations
});
}, DoCompleted::No);
debug!("select: outcome={:#?}", outcome);

// FIXME: if we kept the original cache key, we could mark projection
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ fn project_and_unify_type<'cx, 'gcx, 'tcx>(
},
Err(err) => {
debug!("project_and_unify_type: equating types encountered error {:?}", err);
Err(MismatchedProjectionTypes { err: err })
Err(MismatchedProjectionTypes { err })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
_ => bug!(),
};

Ok(VtableBuiltinData { nested: nested })
Ok(VtableBuiltinData { nested })
}

///////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct Match<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {

impl<'a, 'gcx, 'tcx> Match<'a, 'gcx, 'tcx> {
pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Match<'a, 'gcx, 'tcx> {
Match { tcx: tcx }
Match { tcx }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
}

fn has_type_flags(&self, flags: TypeFlags) -> bool {
self.visit_with(&mut HasTypeFlagsVisitor { flags: flags })
self.visit_with(&mut HasTypeFlagsVisitor { flags })
}
fn has_projections(&self) -> bool {
self.has_type_flags(TypeFlags::HAS_PROJECTION)
Expand Down
7 changes: 7 additions & 0 deletions src/librustc_codegen_llvm/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ fn run_pass_manager(cgcx: &CodegenContext,
}
});

// We always generate bitcode through ThinLTOBuffers,
// which do not support anonymous globals
if config.bitcode_needed() {
let pass = llvm::LLVMRustFindAndCreatePass("name-anon-globals\0".as_ptr() as *const _);
llvm::LLVMRustAddPass(pm, pass.unwrap());
}

if config.verify_llvm_ir {
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
llvm::LLVMRustAddPass(pm, pass.unwrap());
Expand Down
8 changes: 6 additions & 2 deletions src/librustc_codegen_llvm/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ impl ModuleConfig {
self.merge_functions = sess.opts.optimize == config::OptLevel::Default ||
sess.opts.optimize == config::OptLevel::Aggressive;
}

pub fn bitcode_needed(&self) -> bool {
self.emit_bc || self.obj_is_bitcode
|| self.emit_bc_compressed || self.embed_bitcode
}
}

/// Assembler name and command used by codegen when no_integrated_as is enabled
Expand Down Expand Up @@ -564,8 +569,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
// Some options cause LLVM bitcode to be emitted, which uses ThinLTOBuffers, so we need
// to make sure we run LLVM's NameAnonGlobals pass when emitting bitcode; otherwise
// we'll get errors in LLVM.
let using_thin_buffers = config.emit_bc || config.obj_is_bitcode
|| config.emit_bc_compressed || config.embed_bitcode;
let using_thin_buffers = config.bitcode_needed();
let mut have_name_anon_globals_pass = false;
if !config.no_prepopulate_passes {
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl ObjectFile {
pub fn new(llmb: &'static mut MemoryBuffer) -> Option<ObjectFile> {
unsafe {
let llof = LLVMCreateObjectFile(llmb)?;
Some(ObjectFile { llof: llof })
Some(ObjectFile { llof })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/mir/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ pub fn cleanup_kinds<'a, 'tcx>(mir: &mir::Mir<'tcx>) -> IndexVec<mir::BasicBlock
funclet, succ, kind);
match kind {
CleanupKind::NotCleanup => {
result[succ] = CleanupKind::Internal { funclet: funclet };
result[succ] = CleanupKind::Internal { funclet };
}
CleanupKind::Funclet => {
if funclet != succ {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_utils/symbol_names_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
}

tcx.dep_graph.with_ignore(|| {
let mut visitor = SymbolNamesTest { tcx: tcx };
let mut visitor = SymbolNamesTest { tcx };
tcx.hir.krate().visit_all_item_likes(&mut visitor);
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ cfg_if! {
unsafe { libc::close(fd); }
Err(err)
} else {
Ok(Lock { fd: fd })
Ok(Lock { fd })
}
}
}
Expand Down
Loading