Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikic

Diagnose use of incompatible sanitizers

Emit an error when incompatible sanitizer are configured through command
line options. Previously the last one configured prevailed and others
were silently ignored.

Additionally use a set to represent configured sanitizers, making it
possible to enable multiple sanitizers at once. At least in principle,
since currently all of them are considered to be incompatible with
others.
This commit is contained in:
Manish Goregaokar 2020-06-19 19:42:55 -07:00 committed by GitHub
commit 17b80d947d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 216 additions and 218 deletions

View file

@ -0,0 +1,6 @@
// compile-flags: -Z sanitizer=address -Z sanitizer=memory --target x86_64-unknown-linux-gnu
// error-pattern: error: `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory`
#![feature(no_core)]
#![no_core]
#![no_main]

View file

@ -0,0 +1,4 @@
error: `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory`
error: aborting due to previous error

View file

@ -1,6 +1,5 @@
// ignore-tidy-linelength
// compile-flags: -Z sanitizer=leak --target i686-unknown-linux-gnu
// error-pattern: error: LeakSanitizer only works with the `x86_64-unknown-linux-gnu` or `x86_64-apple-darwin` target
// error-pattern: error: `-Zsanitizer=leak` only works with targets:
#![feature(no_core)]
#![no_core]

View file

@ -1,4 +1,4 @@
error: LeakSanitizer only works with the `x86_64-unknown-linux-gnu` or `x86_64-apple-darwin` target
error: `-Zsanitizer=leak` only works with targets: x86_64-apple-darwin, x86_64-unknown-linux-gnu
error: aborting due to previous error