Skip to content

Commit af204b1

Browse files
committed
Auto merge of #55171 - kennytm:rollup, r=kennytm
Rollup of 18 pull requests Successful merges: - #54646 (improve documentation on std::thread::sleep) - #54933 (Cleanup the rest of codegen_llvm) - #54964 (Run both lldb and gdb tests) - #55016 (Deduplicate some code and compile-time values around vtables) - #55031 (Improve verify_llvm_ir config option) - #55050 (doc std::fmt: the Python inspiration is already mentioned in precedin…) - #55077 (rustdoc: Use dyn keyword when rendering dynamic traits) - #55080 (Detect if access to localStorage is forbidden by the user's browser) - #55090 (regression test for move out of borrow via pattern) - #55102 (resolve: Do not skip extern prelude during speculative resolution) - #55104 (Add test for #34229) - #55111 ([Rustc Book] Explain --cfg's arguments) - #55122 (Cleanup mir/borrowck) - #55127 (Remove HybridBitSet::dummy) - #55128 (Fix LLVMRustInlineAsmVerify return type mismatch) - #55142 (miri: layout should not affect CTFE checks (outside of validation)) - #55151 (Cleanup nll) - #55161 ([librustdoc] Disable spellcheck for search field)
2 parents f7eb7fb + 1c09006 commit af204b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+740
-547
lines changed

src/bootstrap/bin/rustc.rs

-4
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ fn main() {
287287
cmd.arg("--cfg").arg("parallel_queries");
288288
}
289289

290-
if env::var_os("RUSTC_VERIFY_LLVM_IR").is_some() {
291-
cmd.arg("-Z").arg("verify-llvm-ir");
292-
}
293-
294290
if env::var_os("RUSTC_DENY_WARNINGS").is_some() && env::var_os("RUSTC_EXTERNAL_TOOL").is_none()
295291
{
296292
cmd.arg("-Dwarnings");

src/bootstrap/builder.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,6 @@ impl<'a> Builder<'a> {
10001000
cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
10011001
}
10021002

1003-
if self.config.rust_verify_llvm_ir {
1004-
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
1005-
}
1006-
10071003
cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
10081004

10091005
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.

src/bootstrap/compile.rs

+3
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ pub fn rustc_cargo_env(builder: &Builder, cargo: &mut Command) {
569569
if builder.config.rustc_parallel_queries {
570570
cargo.env("RUSTC_PARALLEL_QUERIES", "1");
571571
}
572+
if builder.config.rust_verify_llvm_ir {
573+
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
574+
}
572575
}
573576

574577
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/bootstrap/test.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,7 @@ default_test!(Incremental {
812812

813813
default_test!(Debuginfo {
814814
path: "src/test/debuginfo",
815-
// What this runs varies depending on the native platform being apple
816-
mode: "debuginfo-XXX",
815+
mode: "debuginfo",
817816
suite: "debuginfo"
818817
});
819818

@@ -950,18 +949,11 @@ impl Step for Compiletest {
950949
return;
951950
}
952951

953-
if mode == "debuginfo-XXX" {
954-
return if builder.config.build.contains("apple") {
955-
builder.ensure(Compiletest {
956-
mode: "debuginfo-lldb",
957-
..self
958-
});
959-
} else {
960-
builder.ensure(Compiletest {
961-
mode: "debuginfo-gdb",
962-
..self
963-
});
964-
};
952+
if mode == "debuginfo" {
953+
return builder.ensure(Compiletest {
954+
mode: "debuginfo-both",
955+
..self
956+
});
965957
}
966958

967959
builder.ensure(dist::DebuggerScripts {

src/ci/run.sh

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
6161
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
6262
elif [ "$DEPLOY_ALT" != "" ]; then
6363
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions"
64+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
6465
fi
6566
else
6667
# We almost always want debug assertions enabled, but sometimes this takes too
@@ -74,6 +75,8 @@ else
7475
if [ "$NO_LLVM_ASSERTIONS" = "" ]; then
7576
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions"
7677
fi
78+
79+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
7780
fi
7881

7982
if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ]; then

src/doc/rustc/src/command-line-arguments.md

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ This flag will print out help information for `rustc`.
1010

1111
This flag can turn on or off various `#[cfg]` settings.
1212

13+
The value can either be a single identifier or two identifiers separated by `=`.
14+
15+
For examples, `--cfg 'verbose'` or `--cfg 'feature="serde"'`. These correspond
16+
to `#[cfg(verbose)]` and `#[cfg(feature = "serde")]` respectively.
17+
1318
## `-L`: add a directory to the library search path
1419

1520
When looking for external crates, a directory passed to this flag will be searched.

src/liballoc/fmt.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@
335335
//!
336336
//! Each argument being formatted can be transformed by a number of formatting
337337
//! parameters (corresponding to `format_spec` in the syntax above). These
338-
//! parameters affect the string representation of what's being formatted. This
339-
//! syntax draws heavily from Python's, so it may seem a bit familiar.
338+
//! parameters affect the string representation of what's being formatted.
340339
//!
341340
//! ## Fill/Alignment
342341
//!

src/librustc/build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::env;
12+
1113
fn main() {
1214
println!("cargo:rerun-if-changed=build.rs");
1315
println!("cargo:rerun-if-env-changed=CFG_LIBDIR_RELATIVE");
1416
println!("cargo:rerun-if-env-changed=CFG_COMPILER_HOST_TRIPLE");
17+
println!("cargo:rerun-if-env-changed=RUSTC_VERIFY_LLVM_IR");
18+
19+
if env::var_os("RUSTC_VERIFY_LLVM_IR").is_some() {
20+
println!("cargo:rustc-cfg=always_verify_llvm_ir");
21+
}
1522
}

src/librustc/session/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ impl Session {
525525
}
526526
pub fn verify_llvm_ir(&self) -> bool {
527527
self.opts.debugging_opts.verify_llvm_ir
528+
|| cfg!(always_verify_llvm_ir)
528529
}
529530
pub fn borrowck_stats(&self) -> bool {
530531
self.opts.debugging_opts.borrowck_stats

src/librustc/ty/query/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,16 @@ define_queries! { <'tcx>
369369
-> Lrc<specialization_graph::Graph>,
370370
[] fn is_object_safe: ObjectSafety(DefId) -> bool,
371371

372-
// Get the ParameterEnvironment for a given item; this environment
373-
// will be in "user-facing" mode, meaning that it is suitabe for
374-
// type-checking etc, and it does not normalize specializable
375-
// associated types. This is almost always what you want,
376-
// unless you are doing MIR optimizations, in which case you
377-
// might want to use `reveal_all()` method to change modes.
372+
/// Get the ParameterEnvironment for a given item; this environment
373+
/// will be in "user-facing" mode, meaning that it is suitabe for
374+
/// type-checking etc, and it does not normalize specializable
375+
/// associated types. This is almost always what you want,
376+
/// unless you are doing MIR optimizations, in which case you
377+
/// might want to use `reveal_all()` method to change modes.
378378
[] fn param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>,
379379

380-
// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
381-
// `ty.is_copy()`, etc, since that will prune the environment where possible.
380+
/// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
381+
/// `ty.is_copy()`, etc, since that will prune the environment where possible.
382382
[] fn is_copy_raw: is_copy_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
383383
[] fn is_sized_raw: is_sized_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
384384
[] fn is_freeze_raw: is_freeze_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,

src/librustc_codegen_llvm/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ impl Builder<'a, 'll, 'tcx> {
756756
// Ask LLVM to verify that the constraints are well-formed.
757757
let constraints_ok = llvm::LLVMRustInlineAsmVerify(fty, cons);
758758
debug!("Constraint verification result: {:?}", constraints_ok);
759-
if constraints_ok == llvm::True {
759+
if constraints_ok {
760760
let v = llvm::LLVMRustInlineAsm(
761761
fty, asm, cons, volatile, alignstack, dia);
762762
Some(self.call(v, inputs, None))

src/librustc_codegen_llvm/debuginfo/create_scope_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct MirDebugScope<'ll> {
3737

3838
impl MirDebugScope<'ll> {
3939
pub fn is_valid(&self) -> bool {
40-
!self.scope_metadata.is_none()
40+
self.scope_metadata.is_some()
4141
}
4242
}
4343

0 commit comments

Comments
 (0)