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:
commit
17b80d947d
23 changed files with 216 additions and 218 deletions
6
src/test/ui/sanitize/incompatible.rs
Normal file
6
src/test/ui/sanitize/incompatible.rs
Normal 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]
|
||||
4
src/test/ui/sanitize/incompatible.stderr
Normal file
4
src/test/ui/sanitize/incompatible.stderr
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
error: `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue