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 #52088

Merged
merged 31 commits into from
Jul 6, 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
4c6385d
Fix variant background color on hover in search results
GuillaumeGomez Jun 25, 2018
c4f6f90
Update LLVM to bring in a wasm codegen fix
alexcrichton Jul 2, 2018
1eeb5dc
Deduplicate error reports for statics
oli-obk Jul 3, 2018
65ff414
Allow the linker to choose the LTO-plugin (which is useful when using…
michaelwoerister Jul 3, 2018
dd069ea
rust: add initial changes to support powerpc64le musl
mksully22 Jun 18, 2018
6f223cf
Any docs preposition change
bowbahdoe Jul 3, 2018
f96c246
Strenghten synchronization in `Arc::is_unique`
RalfJung Jul 3, 2018
ecaa7bc
Update outdated comment: ByVal -> Scalar.
zachwolfe Jul 3, 2018
1dae60e
Include VS 2017 in error message.
crlf0710 Jul 4, 2018
30063ae
Shorten the line
crlf0710 Jul 4, 2018
6556c84
Add a link to the rustc docs
mark-i-m Jul 4, 2018
0ce0177
Add a punch card to weird expressions test
KamilaBorowska Jul 5, 2018
82a1328
Vertical list of tools to check
oli-obk Jul 5, 2018
f1e3a5a
Only display difference of features, not all features
oli-obk Jul 5, 2018
f352e98
Address review comments
oli-obk Jul 5, 2018
185fb7b
Rollup merge of #51619 - mksully22:ppc64le_rust, r=alexcrichton
kennytm Jul 5, 2018
6650d7f
Rollup merge of #51793 - GuillaumeGomez:search-result-hover, r=QuietM…
kennytm Jul 5, 2018
1568b5e
Rollup merge of #52005 - alexcrichton:update-llvm-for-wasm, r=kennytm
kennytm Jul 5, 2018
a4846ae
Rollup merge of #52016 - oli-obk:dedup_static_errors, r=estebank
kennytm Jul 5, 2018
ffc453a
Rollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=al…
kennytm Jul 5, 2018
7ce7bf0
Rollup merge of #52030 - bowbahdoe:patch-1, r=alexcrichton
kennytm Jul 5, 2018
b87b22e
Rollup merge of #52031 - RalfJung:arc, r=sfackler
kennytm Jul 5, 2018
6d35505
Rollup merge of #52033 - zachrwolfe:outdated_value_comment, r=oli-obk
kennytm Jul 5, 2018
fa7f7ac
Fix typo in cell.rs
d-e-s-o May 20, 2018
23fbfb5
rustc: Update tracking issue for wasm_import_module
alexcrichton Jul 6, 2018
596d1a7
Rollup merge of #52073 - xfix:patch-7, r=oli-obk
kennytm Jul 5, 2018
f1a36fc
Rollup merge of #52080 - oli-obk:dep_dedup_diagnostics, r=kennytm
kennytm Jul 5, 2018
3c21349
Rollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrum
kennytm Jul 6, 2018
20e32ee
Rollup merge of #52063 - mark-i-m:docs_link, r=kennytm
kennytm Jul 6, 2018
1a8011f
Rollup merge of #52093 - alexcrichton:update-issue, r=kennytm
kennytm Jul 6, 2018
e6ddbab
Rollup merge of #52096 - d-e-s-o:fix-typo, r=sfackler
kennytm Jul 6, 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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ variety of channels on Mozilla's IRC network, irc.mozilla.org. The
most popular channel is [#rust], a venue for general discussion about
Rust. And a good place to ask for help would be [#rust-beginners].

Also, the [rustc guide] might be a good place to start if you want to
find out how various parts of the compiler work.
The [rustc guide] might be a good place to start if you want to find out how
various parts of the compiler work.

Also, you may find the [rustdocs for the compiler itself][rustdocs] useful.

[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/

## License
[license]: #license
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

#![deny(warnings)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]

#[macro_use]
extern crate build_helper;
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ impl Step for Openssl {
"powerpc-unknown-netbsd" => "BSD-generic32",
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"powerpc64le-unknown-linux-musl" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc-unknown-linux-gnu" => "linux-sparcv9",
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
Expand Down
28 changes: 22 additions & 6 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::env;
use std::iter;
use std::path::PathBuf;
use std::process::{Command, exit};
use std::collections::HashSet;

use Mode;
use Compiler;
Expand Down Expand Up @@ -122,8 +123,13 @@ impl Step for ToolBuild {
let mut duplicates = Vec::new();
let is_expected = compile::stream_cargo(builder, &mut cargo, &mut |msg| {
// Only care about big things like the RLS/Cargo for now
if tool != "rls" && tool != "cargo" && tool != "clippy-driver" {
return
match tool {
| "rls"
| "cargo"
| "clippy-driver"
=> {}

_ => return,
}
let (id, features, filenames) = match msg {
compile::CargoMessage::CompilerArtifact {
Expand Down Expand Up @@ -182,12 +188,22 @@ impl Step for ToolBuild {
typically means that something was recompiled because \
a transitive dependency has different features activated \
than in a previous build:\n");
println!("the following dependencies are duplicated although they \
have the same features enabled:");
for (id, cur, prev) in duplicates.drain_filter(|(_, cur, prev)| cur.2 == prev.2) {
println!(" {}", id);
// same features
println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
}
println!("the following dependencies have different features:");
for (id, cur, prev) in duplicates {
println!(" {}", id);
println!(" `{}` enabled features {:?} at {:?}",
cur.0, cur.2, cur.1);
println!(" `{}` enabled features {:?} at {:?}",
prev.0, prev.2, prev.1);
let cur_features: HashSet<_> = cur.2.into_iter().collect();
let prev_features: HashSet<_> = prev.2.into_iter().collect();
println!(" `{}` additionally enabled features {:?} at {:?}",
cur.0, &cur_features - &prev_features, cur.1);
println!(" `{}` additionally enabled features {:?} at {:?}",
prev.0, &prev_features - &cur_features, prev.1);
}
println!("");
panic!("tools should not compile multiple copies of the same crate");
Expand Down
13 changes: 7 additions & 6 deletions src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,14 @@ impl<T: ?Sized> Arc<T> {
// holder.
//
// The acquire label here ensures a happens-before relationship with any
// writes to `strong` prior to decrements of the `weak` count (via drop,
// which uses Release).
// writes to `strong` (in particular in `Weak::upgrade`) prior to decrements
// of the `weak` count (via `Weak::drop`, which uses release). If the upgraded
// weak ref was never dropped, the CAS here will fail so we do not care to synchronize.
if self.inner().weak.compare_exchange(1, usize::MAX, Acquire, Relaxed).is_ok() {
// Due to the previous acquire read, this will observe any writes to
// `strong` that were due to upgrading weak pointers; only strong
// clones remain, which require that the strong count is > 1 anyway.
let unique = self.inner().strong.load(Relaxed) == 1;
// This needs to be an `Acquire` to synchronize with the decrement of the `strong`
// counter in `drop` -- the only access that happens when any but the last reference
// is being dropped.
let unique = self.inner().strong.load(Acquire) == 1;

// The release write here synchronizes with a read in `downgrade`,
// effectively preventing the above read of `strong` from happening
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl Any+Send+Sync {
///
/// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
/// noting that the hashes and ordering will vary between Rust releases. Beware
/// of relying on them outside of your code!
/// of relying on them inside of your code!
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct TypeId {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use hir::def_id::DefId;

use super::{EvalResult, Pointer, PointerArithmetic, Allocation};

/// Represents a constant value in Rust. ByVal and ScalarPair are optimizations which
/// Represents a constant value in Rust. Scalar and ScalarPair are optimizations which
/// matches Value's optimizations for easy conversions between these two types
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
pub enum ConstValue<'tcx> {
Expand Down Expand Up @@ -72,7 +72,7 @@ impl<'tcx> ConstValue<'tcx> {
/// A `Value` represents a single self-contained Rust value.
///
/// A `Value` can either refer to a block of memory inside an allocation (`ByRef`) or to a primitve
/// value held directly, outside of any allocation (`ByVal`). For `ByRef`-values, we remember
/// value held directly, outside of any allocation (`Scalar`). For `ByRef`-values, we remember
/// whether the pointer is supposed to be aligned or not (also see Place).
///
/// For optimization of a few very common cases, there is also a representation for a pair of
Expand Down
4 changes: 3 additions & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ pub enum Lto {
#[derive(Clone, PartialEq, Hash)]
pub enum CrossLangLto {
LinkerPlugin(PathBuf),
LinkerPluginAuto,
NoLink,
Disabled
}
Expand All @@ -106,6 +107,7 @@ impl CrossLangLto {
pub fn embed_bitcode(&self) -> bool {
match *self {
CrossLangLto::LinkerPlugin(_) |
CrossLangLto::LinkerPluginAuto |
CrossLangLto::NoLink => true,
CrossLangLto::Disabled => false,
}
Expand Down Expand Up @@ -1020,7 +1022,7 @@ macro_rules! options {
let mut bool_arg = None;
if parse_opt_bool(&mut bool_arg, v) {
*slot = if bool_arg.unwrap() {
CrossLangLto::NoLink
CrossLangLto::LinkerPluginAuto
} else {
CrossLangLto::Disabled
};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,8 @@ fn link_natively(sess: &Session,
if sess.target.target.options.is_like_msvc && linker_not_found {
sess.note_without_error("the msvc targets depend on the msvc linker \
but `link.exe` was not found");
sess.note_without_error("please ensure that VS 2013 or VS 2015 was installed \
with the Visual C++ option");
sess.note_without_error("please ensure that VS 2013, VS 2015 or VS 2017 \
was installed with the Visual C++ option");
}
sess.abort_if_errors();
}
Expand Down
61 changes: 36 additions & 25 deletions src/librustc_codegen_llvm/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,38 @@ impl<'a> GccLinker<'a> {
self.hinted_static = false;
}
}

fn push_cross_lang_lto_args(&mut self, plugin_path: Option<&OsStr>) {
if let Some(plugin_path) = plugin_path {
let mut arg = OsString::from("-plugin=");
arg.push(plugin_path);
self.linker_arg(&arg);
}

let opt_level = match self.sess.opts.optimize {
config::OptLevel::No => "O0",
config::OptLevel::Less => "O1",
config::OptLevel::Default => "O2",
config::OptLevel::Aggressive => "O3",
config::OptLevel::Size => "Os",
config::OptLevel::SizeMin => "Oz",
};

self.linker_arg(&format!("-plugin-opt={}", opt_level));
self.linker_arg(&format!("-plugin-opt=mcpu={}", self.sess.target_cpu()));

match self.sess.opts.cg.lto {
config::Lto::Thin |
config::Lto::ThinLocal => {
self.linker_arg(&format!("-plugin-opt=thin"));
}
config::Lto::Fat |
config::Lto::Yes |
config::Lto::No => {
// default to regular LTO
}
}
}
}

impl<'a> Linker for GccLinker<'a> {
Expand Down Expand Up @@ -443,32 +475,11 @@ impl<'a> Linker for GccLinker<'a> {
CrossLangLto::NoLink => {
// Nothing to do
}
CrossLangLto::LinkerPluginAuto => {
self.push_cross_lang_lto_args(None);
}
CrossLangLto::LinkerPlugin(ref path) => {
self.linker_arg(&format!("-plugin={}", path.display()));

let opt_level = match self.sess.opts.optimize {
config::OptLevel::No => "O0",
config::OptLevel::Less => "O1",
config::OptLevel::Default => "O2",
config::OptLevel::Aggressive => "O3",
config::OptLevel::Size => "Os",
config::OptLevel::SizeMin => "Oz",
};

self.linker_arg(&format!("-plugin-opt={}", opt_level));
self.linker_arg(&format!("-plugin-opt=mcpu={}", self.sess.target_cpu()));

match self.sess.opts.cg.lto {
config::Lto::Thin |
config::Lto::ThinLocal => {
self.linker_arg(&format!("-plugin-opt=thin"));
}
config::Lto::Fat |
config::Lto::Yes |
config::Lto::No => {
// default to regular LTO
}
}
self.push_cross_lang_lto_args(Some(path.as_os_str()));
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions src/librustc_mir/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,8 @@ fn collect_items_rec<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
};
let param_env = ty::ParamEnv::reveal_all();

match tcx.const_eval(param_env.and(cid)) {
Ok(val) => collect_const(tcx, val, instance.substs, &mut neighbors),
Err(err) => {
let span = tcx.def_span(def_id);
err.report_as_error(
tcx.at(span),
"could not evaluate static initializer",
);
}
if let Ok(val) = tcx.const_eval(param_env.and(cid)) {
collect_const(tcx, val, instance.substs, &mut neighbors);
}
}
MonoItem::Fn(instance) => {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ supported_targets! {
("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
Expand Down
35 changes: 35 additions & 0 deletions src/librustc_target/spec/powerpc64le_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use spec::{LinkerFlavor, Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::linux_musl_base::opts();
base.cpu = "ppc64le".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);

// see #36994
base.exe_allocation_crate = None;

Ok(Target {
llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
target_os: "linux".to_string(),
target_env: "musl".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pre {

.content .highlighted {
color: #eee !important;
background-color: #333;
background-color: #616161;
}
.content .highlighted a, .content .highlighted span { color: #eee !important; }
.content .highlighted.trait { background-color: #013191; }
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ declare_features! (
(active, wasm_custom_section, "1.26.0", Some(51088), None),

// The #![wasm_import_module] attribute
(active, wasm_import_module, "1.26.0", Some(51088), None),
(active, wasm_import_module, "1.26.0", Some(52090), None),

// Allows keywords to be escaped for use as identifiers
(active, raw_identifiers, "1.26.0", Some(48589), None),
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/issue-14227.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ extern {
static CRASH: () = symbol;
//~^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static
//~^^^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static

fn main() {}
2 changes: 0 additions & 2 deletions src/test/compile-fail/issue-28324.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ extern {
pub static BAZ: u32 = *&error_message_count;
//~^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static
//~^^^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static

fn main() {}
13 changes: 13 additions & 0 deletions src/test/run-pass/weird-exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

// compile-flags: -Z borrowck=compare

#![recursion_limit = "128"]

use std::cell::Cell;
use std::mem::swap;

Expand Down Expand Up @@ -121,6 +123,16 @@ fn special_characters() {
assert!(!val);
}

fn punch_card() -> impl std::fmt::Debug {
..=..=.. .. .. .. .. .. .. .. .. .. .. ..=.. ..
..=.. ..=.. .. .. .. .. .. .. .. .. ..=..=..=..
..=.. ..=.. ..=.. ..=.. .. ..=..=.. .. ..=.. ..
..=..=.. .. ..=.. ..=.. ..=.. .. .. .. ..=.. ..
..=.. ..=.. ..=.. ..=.. .. ..=.. .. .. ..=.. ..
..=.. ..=.. ..=.. ..=.. .. .. ..=.. .. ..=.. ..
..=.. ..=.. .. ..=..=.. ..=..=.. .. .. ..=.. ..
}

pub fn main() {
strange();
funny();
Expand All @@ -135,4 +147,5 @@ pub fn main() {
fishy();
union();
special_characters();
punch_card();
}
1 change: 0 additions & 1 deletion src/test/ui/const-eval/index_out_of_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

static FOO: i32 = [][0];
//~^ ERROR E0080
//~| ERROR E0080

fn main() {
let array = [std::env::args().len()];
Expand Down
Loading