Skip to content

Commit 8c93a79

Browse files
committed
rustdoc: Replace no-pretty-expanded with pretty-expanded
Now that features must be declared expanded source often does not compile. This adds 'pretty-expanded' to a bunch of test cases that still work.
1 parent e901910 commit 8c93a79

File tree

1,544 files changed

+3093
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,544 files changed

+3093
-12
lines changed

src/compiletest/header.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub struct TestProps {
4040
pub check_stdout: bool,
4141
// Don't force a --crate-type=dylib flag on the command line
4242
pub no_prefer_dynamic: bool,
43-
// Don't run --pretty expanded when running pretty printing tests
44-
pub no_pretty_expanded: bool,
43+
// Run --pretty expanded when running pretty printing tests
44+
pub pretty_expanded: bool,
4545
// Which pretty mode are we testing with, default to 'normal'
4646
pub pretty_mode: String,
4747
// Only compare pretty output and don't try compiling
@@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
6262
let mut force_host = false;
6363
let mut check_stdout = false;
6464
let mut no_prefer_dynamic = false;
65-
let mut no_pretty_expanded = false;
65+
let mut pretty_expanded = false;
6666
let mut pretty_mode = None;
6767
let mut pretty_compare_only = false;
6868
let mut forbid_output = Vec::new();
@@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
9696
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
9797
}
9898

99-
if !no_pretty_expanded {
100-
no_pretty_expanded = parse_no_pretty_expanded(ln);
99+
if !pretty_expanded {
100+
pretty_expanded = parse_pretty_expanded(ln);
101101
}
102102

103103
if pretty_mode.is_none() {
@@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
152152
force_host: force_host,
153153
check_stdout: check_stdout,
154154
no_prefer_dynamic: no_prefer_dynamic,
155-
no_pretty_expanded: no_pretty_expanded,
155+
pretty_expanded: pretty_expanded,
156156
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
157157
pretty_compare_only: pretty_compare_only,
158158
forbid_output: forbid_output,
@@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
295295
parse_name_directive(line, "no-prefer-dynamic")
296296
}
297297

298-
fn parse_no_pretty_expanded(line: &str) -> bool {
299-
parse_name_directive(line, "no-pretty-expanded")
298+
fn parse_pretty_expanded(line: &str) -> bool {
299+
parse_name_directive(line, "pretty-expanded")
300300
}
301301

302302
fn parse_pretty_mode(line: &str) -> Option<String> {
@@ -340,7 +340,8 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
340340
}
341341

342342
fn parse_name_directive(line: &str, directive: &str) -> bool {
343-
line.contains(directive)
343+
// This 'no-' rule is a quick hack to allow pretty-expanded and no-pretty-expanded to coexist
344+
line.contains(directive) && !line.contains(&("no-".to_string() + directive))
344345
}
345346

346347
pub fn parse_name_value_directive(line: &str, directive: &str)

src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
245245
if !proc_res.status.success() {
246246
fatal_proc_rec("pretty-printed source does not typecheck", &proc_res);
247247
}
248-
if props.no_pretty_expanded { return }
248+
if !props.pretty_expanded { return }
249249

250250
// additionally, run `--pretty expanded` and try to build it.
251251
let proc_res = print_source(config, props, testfile, srcs[round].clone(), "expanded");

src/test/run-pass/alias-uninit-value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
// Regression test for issue #374
1414

15+
// pretty-expanded FIXME #23616
16+
1517
enum sty { ty_nil, }
1618

1719
struct RawT {struct_: sty, cname: Option<String>, hash: uint}

src/test/run-pass/alloca-from-derived-tydesc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111

12+
// pretty-expanded FIXME #23616
13+
1214
enum option<T> { some(T), none, }
1315

1416
struct R<T> {v: Vec<option<T>> }

src/test/run-pass/anon-extern-mod-cross-crate-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
// aux-build:anon-extern-mod-cross-crate-1.rs
12+
// pretty-expanded FIXME #23616
13+
1214
extern crate anonexternmod;
1315

1416
use anonexternmod::rust_get_test_int;

src/test/run-pass/anon-extern-mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// pretty-expanded FIXME #23616
12+
1113
#![feature(libc)]
1214

1315
extern crate libc;

src/test/run-pass/argument-passing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111

12+
// pretty-expanded FIXME #23616
13+
1214
struct X {
1315
x: int
1416
}

src/test/run-pass/arith-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111

1212

13+
// pretty-expanded FIXME #23616
14+
1315
pub fn main() {
1416
let i32_c: int = 0x10101010;
1517
assert!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) ==

src/test/run-pass/arith-unsigned.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// pretty-expanded FIXME #23616
12+
1113
#![allow(type_limits)]
1214

1315
// Unsigned integer operations

src/test/run-pass/artificial-block.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// pretty-expanded FIXME #23616
12+
1113
fn f() -> int { { return 3; } }
1214

1315
pub fn main() { assert!((f() == 3)); }

0 commit comments

Comments
 (0)