Skip to content

Deny all warnings by default in doc tests #8067

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
2 changes: 1 addition & 1 deletion doc/rust.md
Original file line number Diff line number Diff line change
@@ -1494,7 +1494,7 @@ mod m1 {
This example shows how one can use `allow` and `warn` to toggle
a particular check on and off.

~~~
~~~{.xfail-test}
#[warn(missing_doc)]
mod m2{
#[allow(missing_doc)]
1 change: 1 addition & 0 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
@@ -1154,6 +1154,7 @@ let mut x = 5;
let y = &x; // x is now frozen, it cannot be modified
}
// x is now unfrozen again
# x = 3;
~~~~

Mutable managed boxes handle freezing dynamically when any of their contents
12 changes: 4 additions & 8 deletions src/etc/extract-tests.py
Original file line number Diff line number Diff line change
@@ -59,14 +59,10 @@
block = "fn main() {\n" + block + "\n}\n"
if not re.search(r"\bextern mod extra\b", block):
block = "extern mod extra;\n" + block
block = """#[ forbid(ctypes) ];
#[ forbid(path_statement) ];
#[ forbid(type_limits) ];
#[ forbid(unrecognized_lint) ];
#[ forbid(unused_imports) ];
#[ forbid(while_true) ];

#[ warn(non_camel_case_types) ];\n
block = """#[ deny(warnings) ];
#[ allow(unused_variable) ];\n
#[ allow(dead_assignment) ];\n
#[ allow(unused_mut) ];\n
""" + block
if xfail:
block = "// xfail-test\n" + block