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

Support for force-warns #85788

Merged
merged 9 commits into from
Jun 4, 2021
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Add deny-by-default test
  • Loading branch information
rylev committed Jun 2, 2021

Verified

This commit was signed with the committer’s verified signature.
commit dc2db7389945ce13e28c017c69991dc4e0794c79
8 changes: 8 additions & 0 deletions src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// compile-flags: --force-warns const_err
// check-pass

const C: i32 = 1 / 0;
//~^ WARN any use of this value will cause an error
//~| WARN this was previously accepted by the compiler

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
warning: any use of this value will cause an error
--> $DIR/force-deny-by-default-lint.rs:4:16
|
LL | const C: i32 = 1 / 0;
| ---------------^^^^^-
| |
| attempt to divide `1_i32` by zero
|
= note: Warning forced by `force-warns` commandline option
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

warning: 1 warning emitted