Skip to content

Rollup of 10 pull requests #73504

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

Merged
merged 47 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a6127e3
Merge pull request #1 from rust-lang/master
richkadel May 22, 2020
d1c275b
linker: MSVC supports linking static libraries as a whole archive
petrochenkov May 30, 2020
d139a72
Merge pull request #2 from rust-lang/master
richkadel Jun 10, 2020
d40e624
compiletest: Add directives to detect sanitizer support
tmiasko Jun 5, 2020
0687b78
Speed up bootstrap a little.
ehuss Jun 13, 2020
607e851
Switch bootstrap metadata to --no-deps.
ehuss Jun 14, 2020
5393a29
Move convert_place_derefs_to_mutable out from check/method/confirm.rs
nbdd0121 May 16, 2020
fb0793c
Add some comments to librustc_typeck/check/callee.rs
nbdd0121 Jun 14, 2020
c2b920f
Show suite paths (`src/test/ui/...`) in help output.
ehuss Jun 14, 2020
f17fd7b
Add some doc comments regarding PathSet.
ehuss Jun 15, 2020
8121d2e
Fix up autoderef when performing mutable auto borrow
nbdd0121 Jun 14, 2020
4710f85
Add ui tests for issue 68590 and 72225
nbdd0121 Jun 14, 2020
d6156e8
Change how compiler-builtins gets many CGUs
alexcrichton Jun 8, 2020
e390acd
Use expr_ty_adjusted in convert_place_op_to_mutable
nbdd0121 Jun 15, 2020
8e7606f
bootstrap/install.rs: support a nonexistent `prefix` in `x.py install`
nodakai Jun 14, 2020
5cedf5d
Refactor usage of Needs in typeck
nbdd0121 Jun 15, 2020
395256a
Merge pull request #3 from rust-lang/master
richkadel Jun 15, 2020
5068ae1
[WIP] injects llvm intrinsic instrprof.increment for coverage reports
richkadel Jun 4, 2020
088037a
explained lang_item function body (count_code_region)
richkadel Jun 5, 2020
2c5c2a6
removed experiments for cleaner github PR
richkadel Jun 5, 2020
d2cd59a
Add case for count_code_region() extern lang_item
richkadel Jun 5, 2020
e4df7e7
Update src/libcore/intrinsics.rs
richkadel Jun 5, 2020
7e49a9e
moved to post_borrowck_cleanup & used MirPatch
richkadel Jun 8, 2020
46ebd57
moved instrument_coverage pass, optimized scalar, added FIXME
richkadel Jun 8, 2020
20aba8f
added test, Operand::const_from_scalar, require_lang_item, & comments
richkadel Jun 10, 2020
163e585
updated mir-opt test due to other recent changes to MIR
richkadel Jun 10, 2020
98685a4
Add new `fn_span` to TerminatorKind::Call instance
richkadel Jun 16, 2020
93022be
bootstrap: read config from $RUST_BOOTSTRAP_CONFIG
davidtwco Jun 13, 2020
a19dfb5
Create new E0763 error code for unterminated byte constant
GuillaumeGomez Jun 12, 2020
bad252c
Update ui tests
GuillaumeGomez Jun 12, 2020
f0a4233
memory access sanity checks: abort instead of panic
RalfJung Jun 6, 2020
81c7ebd
we can enable one more codegen test in debug mode now
RalfJung Jun 6, 2020
2b7d858
Add some comments related to place op typeck
nbdd0121 Jun 16, 2020
1db44af
Ensure profiling runtime for -Zinstrument-coverage
richkadel Jun 17, 2020
c338729
Update src/libcore/intrinsics.rs
richkadel Jun 17, 2020
b9f0304
temporarily enable mac and windows tests on bors try
richkadel Jun 17, 2020
36c9014
removed try config to test mac & windows (passed)
richkadel Jun 17, 2020
70622db
Rollup merge of #72280 - nbdd0121:typeck, r=nikomatsakis
RalfJung Jun 19, 2020
7cc4518
Rollup merge of #72785 - petrochenkov:wholemsvc, r=matthewjasper
RalfJung Jun 19, 2020
1dc6c3c
Rollup merge of #73011 - richkadel:llvm-count-from-mir-pass, r=tmandry
RalfJung Jun 19, 2020
0851036
Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakis
RalfJung Jun 19, 2020
125c196
Rollup merge of #73054 - RalfJung:dont-panic, r=Mark-Simulacrum
RalfJung Jun 19, 2020
1e31a7c
Rollup merge of #73136 - alexcrichton:thinlto-compiler-builtins, r=Ma…
RalfJung Jun 19, 2020
45aa36b
Rollup merge of #73280 - GuillaumeGomez:add-e0763, r=petrochenkov
RalfJung Jun 19, 2020
0404788
Rollup merge of #73317 - davidtwco:bootstrap-config-env-var, r=Mark-S…
RalfJung Jun 19, 2020
a59d164
Rollup merge of #73350 - nodakai:install-rs-support-nonexistent-prefi…
RalfJung Jun 19, 2020
61c8925
Rollup merge of #73352 - ehuss:bootstrap-metadata, r=Mark-Simulacrum
RalfJung Jun 19, 2020
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
4 changes: 1 addition & 3 deletions src/test/codegen/sanitizer-memory-track-orgins.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Verifies that MemorySanitizer track-origins level can be controlled
// with -Zsanitizer-memory-track-origins option.
//
// needs-sanitizer-support
// only-linux
// only-x86_64
// needs-sanitizer-memory
// revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO
//
//[MSAN-0] compile-flags: -Zsanitizer=memory
Expand Down
6 changes: 2 additions & 4 deletions src/test/codegen/sanitizer-no-sanitize-inlining.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Verifies that no_sanitize attribute prevents inlining when
// given sanitizer is enabled, but has no effect on inlining otherwise.
//
// needs-sanitizer-support
// only-x86_64
//
// needs-sanitizer-address
// needs-sanitizer-leak
// revisions: ASAN LSAN
//
//[ASAN] compile-flags: -Zsanitizer=address -C opt-level=3 -Z mir-opt-level=3
//[LSAN] compile-flags: -Zsanitizer=leak -C opt-level=3 -Z mir-opt-level=3

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/sanitizer-no-sanitize.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Verifies that no_sanitze attribute can be used to
// selectively disable sanitizer instrumentation.
//
// needs-sanitizer-support
// needs-sanitizer-address
// compile-flags: -Zsanitizer=address

#![crate_type="lib"]
Expand Down
5 changes: 2 additions & 3 deletions src/test/codegen/sanitizer-recover.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Verifies that AddressSanitizer and MemorySanitizer
// recovery mode can be enabled with -Zsanitizer-recover.
//
// needs-sanitizer-support
// only-linux
// only-x86_64
// needs-sanitizer-address
// needs-sanitizer-memory
// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO
// no-prefer-dynamic
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# needs-sanitizer-support
# only-x86_64
# needs-sanitizer-address
# only-linux

-include ../tools.mk
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# needs-sanitizer-support
# only-x86_64
# needs-sanitizer-address
# only-linux

-include ../tools.mk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# needs-sanitizer-support
# only-x86_64
# needs-sanitizer-address
# only-linux

-include ../tools.mk
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc/sanitizer-option.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// needs-sanitizer-support
// needs-sanitizer-address
// compile-flags: --test -Z sanitizer=address
//
// #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/address.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-address
//
// compile-flags: -Z sanitizer=address -O -g
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/badfree.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-address
//
// compile-flags: -Z sanitizer=address -O
//
Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/sanitize/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// the `#[cfg(sanitize = "option")]` attribute is configured.

// needs-sanitizer-support
// only-linux
// only-x86_64
// needs-sanitizer-address
// needs-sanitizer-leak
// needs-sanitizer-memory
// needs-sanitizer-thread
// check-pass
// revisions: address leak memory thread
//[address]compile-flags: -Zsanitizer=address --cfg address
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/issue-72154-lifetime-markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// miscompilation which was subsequently detected by AddressSanitizer as UB.
//
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-address
//
// compile-flags: -Copt-level=0 -Zsanitizer=address
// run-pass
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/leak.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-leak
//
// compile-flags: -Z sanitizer=leak -O
//
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/sanitize/memory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// needs-sanitizer-support
// only-linux
// only-x86_64
// needs-sanitizer-memory
//
// compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// min-llvm-version 9.0
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-address
//
// no-prefer-dynamic
// revisions: opt0 opt1
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// would occasionally fail, making test flaky.
//
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-thread
//
// compile-flags: -Z sanitizer=thread -O
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/sanitize/use-after-scope.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// needs-sanitizer-support
// only-x86_64
// needs-sanitizer-address
//
// compile-flags: -Zsanitizer=address
// run-fail
Expand Down
28 changes: 23 additions & 5 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ impl EarlyProps {
let mut props = EarlyProps::default();
let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();
let has_asan = util::ASAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_lsan = util::LSAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_msan = util::MSAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_tsan = util::TSAN_SUPPORTED_TARGETS.contains(&&*config.target);

iter_header(testfile, None, rdr, &mut |ln| {
// we should check if any only-<platform> exists and if it exists
Expand Down Expand Up @@ -74,7 +78,25 @@ impl EarlyProps {
props.ignore = true;
}

if !rustc_has_sanitizer_support && config.parse_needs_sanitizer_support(ln) {
if !rustc_has_sanitizer_support
&& config.parse_name_directive(ln, "needs-sanitizer-support")
{
props.ignore = true;
}

if !has_asan && config.parse_name_directive(ln, "needs-sanitizer-address") {
props.ignore = true;
}

if !has_lsan && config.parse_name_directive(ln, "needs-sanitizer-leak") {
props.ignore = true;
}

if !has_msan && config.parse_name_directive(ln, "needs-sanitizer-memory") {
props.ignore = true;
}

if !has_tsan && config.parse_name_directive(ln, "needs-sanitizer-thread") {
props.ignore = true;
}

Expand Down Expand Up @@ -829,10 +851,6 @@ impl Config {
self.parse_name_directive(line, "needs-profiler-support")
}

fn parse_needs_sanitizer_support(&self, line: &str) -> bool {
self.parse_name_directive(line, "needs-sanitizer-support")
}

/// Parses a name-value directive which contains config-specific information, e.g., `ignore-x86`
/// or `normalize-stderr-32bit`.
fn parse_cfg_name_directive(&self, line: &str, prefix: &str) -> ParsedNameDirective {
Expand Down
19 changes: 19 additions & 0 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,22 @@ fn debugger() {
config.debugger = Some(Debugger::Lldb);
assert!(parse_rs(&config, "// ignore-lldb").ignore);
}

#[test]
fn sanitizers() {
let mut config = config();

// Target that supports all sanitizers:
config.target = "x86_64-unknown-linux-gnu".to_owned();
assert!(!parse_rs(&config, "// needs-sanitizer-address").ignore);
assert!(!parse_rs(&config, "// needs-sanitizer-leak").ignore);
assert!(!parse_rs(&config, "// needs-sanitizer-memory").ignore);
assert!(!parse_rs(&config, "// needs-sanitizer-thread").ignore);

// Target that doesn't support sanitizers:
config.target = "wasm32-unknown-emscripten".to_owned();
assert!(parse_rs(&config, "// needs-sanitizer-address").ignore);
assert!(parse_rs(&config, "// needs-sanitizer-leak").ignore);
assert!(parse_rs(&config, "// needs-sanitizer-memory").ignore);
assert!(parse_rs(&config, "// needs-sanitizer-thread").ignore);
}
11 changes: 11 additions & 0 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
("xcore", "xcore"),
];

pub const ASAN_SUPPORTED_TARGETS: &'static [&'static str] =
&["aarch64-fuchsia", "x86_64-apple-darwin", "x86_64-fuchsia", "x86_64-unknown-linux-gnu"];

pub const LSAN_SUPPORTED_TARGETS: &'static [&'static str] =
&["x86_64-apple-darwin", "x86_64-unknown-linux-gnu"];

pub const MSAN_SUPPORTED_TARGETS: &'static [&'static str] = &["x86_64-unknown-linux-gnu"];

pub const TSAN_SUPPORTED_TARGETS: &'static [&'static str] =
&["x86_64-apple-darwin", "x86_64-unknown-linux-gnu"];

pub fn matches_os(triple: &str, name: &str) -> bool {
// For the wasm32 bare target we ignore anything also ignored on emscripten
// and then we also recognize `wasm32-bare` as the os for the target
Expand Down