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 10 pull requests #64510

Merged
merged 35 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
88e7556
Fix build script sanitizer check.
ehuss Sep 14, 2019
b609547
std: always depend on backtrace, but only enable its features on demand
RalfJung Sep 14, 2019
dac0a15
rename the crate, not the feature
RalfJung Sep 14, 2019
ee83402
when BUILD_MANIFEST_DISABLE_SIGNING is set, we don't need gpg-passwor…
RalfJung Sep 14, 2019
766c4a5
build-manifest: when Miri tests are not passing, do not add Miri comp…
RalfJung Sep 14, 2019
6137691
const interning: move mutability computation into intern_shallow, and…
RalfJung Aug 27, 2019
7b8693e
all memory behind a constant must be immutable
RalfJung Aug 27, 2019
75c82b4
drop redundant ParamEnv, and avoid constructing InternVisitor without…
RalfJung Aug 27, 2019
b1d4d2b
relocations -> allocations
RalfJung Aug 27, 2019
14e3506
note a FIXME
RalfJung Aug 27, 2019
3424811
assert that nobody asks for mutable constants
RalfJung Aug 28, 2019
224e2e5
explain ty == None
RalfJung Aug 28, 2019
5462ecb
update intern classification comment
RalfJung Aug 28, 2019
5355a16
use println!()
Sep 13, 2019
a678e31
Hide diagnostics emitted during --cfg parsing
Mark-Simulacrum Sep 14, 2019
bb22986
Don't print the "total" `-Ztime-passes` output if `--prints=...` is a…
nnethercote Sep 16, 2019
163892c
Use `Symbol` in two more functions.
nnethercote Sep 16, 2019
d3d7b58
ci: ensure all tool maintainers are assignable on issues
pietroalbini Sep 3, 2019
eb97b1b
ci: rename Gankro to Gankra in toolstate
pietroalbini Sep 3, 2019
f968c1a
ci: address publish_toolstate review comments
pietroalbini Sep 4, 2019
f2576c8
ci: convert maintainer list in publish_toolstate to a set
pietroalbini Sep 4, 2019
ce451b9
ci: remove projektir from toolstate notifications
pietroalbini Sep 9, 2019
49854c4
avoid #[cfg] in favor of cfg!
RalfJung Sep 16, 2019
d5fe583
Const-stabilize `Vec::new`.
Centril Aug 29, 2019
9b3e11f
Const-stabilize `String::new`.
Centril Aug 29, 2019
f432d50
Rollup merge of #63955 - RalfJung:intern, r=oli-obk
Centril Sep 16, 2019
be327a8
Rollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton
Centril Sep 16, 2019
63bc6ae
Rollup merge of #64119 - pietroalbini:validate-toolstate-maintainers,…
Centril Sep 16, 2019
2a6a342
Rollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton
Centril Sep 16, 2019
f0320e5
Rollup merge of #64446 - ehuss:fix-sanitizer-build, r=alexcrichton
Centril Sep 16, 2019
7975973
Rollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini
Centril Sep 16, 2019
75db571
Rollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebank
Centril Sep 16, 2019
acbbcda
Rollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov
Centril Sep 16, 2019
d8ecf45
Rollup merge of #64499 - nnethercote:use-Symbol-in-two-more-functions…
Centril Sep 16, 2019
f4ff418
Rollup merge of #64504 - guanqun:use-println-without-empty-str, r=jon…
Centril Sep 16, 2019
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
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ dependencies = [
name = "build-manifest"
version = "0.1.0"
dependencies = [
"reqwest",
"serde",
"serde_json",
"toml",
]

Expand Down
14 changes: 10 additions & 4 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,8 @@ impl Step for HashSign {
}

fn run(self, builder: &Builder<'_>) {
// This gets called by `promote-release`
// (https://github.com/rust-lang/rust-central-station/tree/master/promote-release).
let mut cmd = builder.tool_cmd(Tool::BuildManifest);
if builder.config.dry_run {
return;
Expand All @@ -2010,10 +2012,14 @@ impl Step for HashSign {
let addr = builder.config.dist_upload_addr.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
});
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
});
let pass = t!(fs::read_to_string(&file));
let pass = if env::var("BUILD_MANIFEST_DISABLE_SIGNING").is_err() {
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
});
t!(fs::read_to_string(&file))
} else {
String::new()
};

let today = output(Command::new("date").arg("+%Y-%m-%d"));

Expand Down
7 changes: 7 additions & 0 deletions src/ci/azure-pipelines/steps/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,15 @@ steps:
git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
cd rust-toolstate
python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
# Only check maintainers if this build is supposed to publish toolstate.
# Builds that are not supposed to publish don't have the access token.
if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py"
fi
cd ..
rm -rf rust-toolstate
env:
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check'))
displayName: Verify the publish_toolstate script works

Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
#![feature(allocator_internals)]
#![feature(on_unimplemented)]
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
#![cfg_attr(bootstrap, feature(const_vec_new))]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
#![feature(alloc_layout_extra)]
Expand Down
27 changes: 26 additions & 1 deletion src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,38 @@ impl<T, A: Alloc> RawVec<T, A> {
}

impl<T> RawVec<T, Global> {
/// HACK(Centril): This exists because `#[unstable]` `const fn`s needn't conform
/// to `min_const_fn` and so they cannot be called in `min_const_fn`s either.
///
/// If you change `RawVec<T>::new` or dependencies, please take care to not
/// introduce anything that would truly violate `min_const_fn`.
///
/// NOTE: We could avoid this hack and check conformance with some
/// `#[rustc_force_min_const_fn]` attribute which requires conformance
/// with `min_const_fn` but does not necessarily allow calling it in
/// `stable(...) const fn` / user code not enabling `foo` when
/// `#[rustc_const_unstable(feature = "foo", ..)]` is present.
pub const NEW: Self = Self::new();

/// Creates the biggest possible `RawVec` (on the system heap)
/// without allocating. If `T` has positive size, then this makes a
/// `RawVec` with capacity `0`. If `T` is zero-sized, then it makes a
/// `RawVec` with capacity `usize::MAX`. Useful for implementing
/// delayed allocation.
pub const fn new() -> Self {
Self::new_in(Global)
// FIXME(Centril): Reintegrate this with `fn new_in` when we can.

// `!0` is `usize::MAX`. This branch should be stripped at compile time.
// FIXME(mark-i-m): use this line when `if`s are allowed in `const`:
//let cap = if mem::size_of::<T>() == 0 { !0 } else { 0 };

// `Unique::empty()` doubles as "unallocated" and "zero-sized allocation".
RawVec {
ptr: Unique::empty(),
// FIXME(mark-i-m): use `cap` when ifs are allowed in const
cap: [0, !0][(mem::size_of::<T>() == 0) as usize],
a: Global,
}
}

/// Creates a `RawVec` (on the system heap) with exactly the
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl String {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_string_new")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_string_new"))]
pub const fn new() -> String {
String { vec: Vec::new() }
}
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ impl<T> Vec<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_new")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_vec_new"))]
pub const fn new() -> Vec<T> {
Vec {
buf: RawVec::new(),
buf: RawVec::NEW,
len: 0,
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::session::{early_error, early_warn, Session};
use crate::session::search_paths::SearchPath;

use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;

use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
use rustc_target::spec::{Target, TargetTriple};
Expand All @@ -19,6 +20,7 @@ use syntax::parse::{ParseSess, new_parser_from_source_str};
use syntax::parse::token;
use syntax::symbol::{sym, Symbol};
use syntax::feature_gate::UnstableFeatures;
use syntax::source_map::SourceMap;

use errors::emitter::HumanReadableErrorType;
use errors::{ColorConfig, FatalError, Handler};
Expand Down Expand Up @@ -1850,11 +1852,20 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
opts
}

struct NullEmitter;

impl errors::emitter::Emitter for NullEmitter {
fn emit_diagnostic(&mut self, _: &errors::DiagnosticBuilder<'_>) {}
}

// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`.
pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String>)> {
syntax::with_default_globals(move || {
let cfg = cfgspecs.into_iter().map(|s| {
let sess = ParseSess::new(FilePathMapping::empty());

let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let handler = Handler::with_emitter(false, None, Box::new(NullEmitter));
let sess = ParseSess::with_span_handler(handler, cm);
let filename = FileName::cfg_spec_source_code(&s);
let mut parser = new_parser_from_source_str(&sess, filename, s.to_string());

Expand Down
1 change: 1 addition & 0 deletions src/librustc_asan/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use build_helper::sanitizer_lib_boilerplate;
use cmake::Config;

fn main() {
println!("cargo:rerun-if-env-changed=RUSTC_BUILD_SANITIZERS");
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,21 @@ impl CodegenBackend for LlvmCodegenBackend {
for &(name, _) in back::write::RELOC_MODEL_ARGS.iter() {
println!(" {}", name);
}
println!("");
println!();
}
PrintRequest::CodeModels => {
println!("Available code models:");
for &(name, _) in back::write::CODE_GEN_MODEL_ARGS.iter(){
println!(" {}", name);
}
println!("");
println!();
}
PrintRequest::TlsModels => {
println!("Available TLS models:");
for &(name, _) in back::write::TLS_MODEL_ARGS.iter(){
println!(" {}", name);
}
println!("");
println!();
}
req => llvm_util::print(req, sess),
}
Expand Down
5 changes: 4 additions & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ pub struct TimePassesCallbacks {

impl Callbacks for TimePassesCallbacks {
fn config(&mut self, config: &mut interface::Config) {
// If a --prints=... option has been given, we don't print the "total"
// time because it will mess up the --prints output. See #64339.
self.time_passes =
config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time;
config.opts.prints.is_empty() &&
(config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_lsan/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use build_helper::sanitizer_lib_boilerplate;
use cmake::Config;

fn main() {
println!("cargo:rerun-if-env-changed=RUSTC_BUILD_SANITIZERS");
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
return;
}
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_mir/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ fn eval_body_using_ecx<'mir, 'tcx>(
ecx: &mut CompileTimeEvalContext<'mir, 'tcx>,
cid: GlobalId<'tcx>,
body: &'mir mir::Body<'tcx>,
param_env: ty::ParamEnv<'tcx>,
) -> InterpResult<'tcx, MPlaceTy<'tcx>> {
debug!("eval_body_using_ecx: {:?}, {:?}", cid, param_env);
debug!("eval_body_using_ecx: {:?}, {:?}", cid, ecx.param_env);
let tcx = ecx.tcx.tcx;
let layout = ecx.layout_of(body.return_ty().subst(tcx, cid.instance.substs))?;
assert!(!layout.is_unsized());
Expand All @@ -162,7 +161,6 @@ fn eval_body_using_ecx<'mir, 'tcx>(
ecx,
cid.instance.def_id(),
ret,
param_env,
)?;

debug!("eval_body_using_ecx done: {:?}", *ret);
Expand Down Expand Up @@ -658,7 +656,7 @@ pub fn const_eval_raw_provider<'tcx>(

let res = ecx.load_mir(cid.instance.def, cid.promoted);
res.and_then(
|body| eval_body_using_ecx(&mut ecx, cid, body, key.param_env)
|body| eval_body_using_ecx(&mut ecx, cid, body)
).and_then(|place| {
Ok(RawConst {
alloc_id: place.ptr.assert_ptr().alloc_id,
Expand Down
Loading