Skip to content

Commit 02f150c

Browse files
committed
---
yaml --- r: 5193 b: refs/heads/master c: 8e1902f h: refs/heads/master i: 5191: 5fe27d6 v: v3
1 parent 14e4c92 commit 02f150c

File tree

2 files changed

+26
-57
lines changed

2 files changed

+26
-57
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 718205441618e1bdda7dd57a7f7ab9f3569a64aa
2+
refs/heads/master: 8e1902f30fcdd5a8dc28c50b1c93604bd7500f40

trunk/src/fuzzer/fuzzer.rs

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -51,49 +51,41 @@ fn find_rust_files(files: &mutable [str], path: &str) {
5151
fn safe_to_steal(e: ast::expr_) -> bool {
5252
alt e {
5353

54-
55-
// pretty-printer precedence issues -- https://github.com/graydon/rust/issues/670
56-
ast::expr_unary(_, _) {
57-
false
58-
}
54+
// https://github.com/graydon/rust/issues/890
5955
ast::expr_lit(lit) {
6056
alt lit.node {
6157
ast::lit_str(_) { true }
6258
ast::lit_char(_) { true }
6359
ast::lit_int(_) { false }
64-
ast::lit_uint(_) { false }
60+
ast::lit_uint(_) { true }
6561
ast::lit_mach_int(_, _) { false }
6662
ast::lit_float(_) { false }
6763
ast::lit_mach_float(_, _) { false }
6864
ast::lit_nil. { true }
6965
ast::lit_bool(_) { true }
7066
}
7167
}
68+
69+
// https://github.com/graydon/rust/issues/890
7270
ast::expr_cast(_, _) { false }
7371
ast::expr_assert(_) { false }
7472
ast::expr_binary(_, _, _) { false }
7573
ast::expr_assign(_, _) { false }
7674
ast::expr_assign_op(_, _, _) { false }
77-
ast::expr_fail(option::none.) {
78-
false
79-
/* https://github.com/graydon/rust/issues/764 */
8075

81-
}
76+
// https://github.com/graydon/rust/issues/764
77+
ast::expr_fail(option::none.) { false }
8278
ast::expr_ret(option::none.) { false }
8379
ast::expr_put(option::none.) { false }
8480

81+
// These prefix-operator keywords are not being parenthesized when in callee positions.
82+
// https://github.com/graydon/rust/issues/891
83+
ast::expr_ret(_) { false }
84+
ast::expr_put(_) { false }
85+
ast::expr_check(_, _) { false }
86+
ast::expr_log(_, _) { false }
8587

86-
ast::expr_ret(_) {
87-
false
88-
/* lots of code generation issues, such as https://github.com/graydon/rust/issues/770 */
89-
90-
}
91-
ast::expr_fail(_) { false }
92-
93-
94-
_ {
95-
true
96-
}
88+
_ { true }
9789
}
9890
}
9991

@@ -173,9 +165,7 @@ fn check_variants_of_ast(crate: &ast::crate, codemap: &codemap::codemap,
173165
filename,
174166
io::string_reader(""), _,
175167
pprust::no_ann()));
176-
// 1u would be sane here, but the pretty-printer currently has lots of whitespace and paren issues,
177-
// and https://github.com/graydon/rust/issues/766 is hilarious.
178-
check_roundtrip_convergence(str3, 7u);
168+
check_roundtrip_convergence(str3, 1u);
179169
//check_whole_compiler(str3);
180170
}
181171
}
@@ -225,49 +215,28 @@ fn parse_and_print(code: &str) -> str {
225215

226216
fn content_is_dangerous_to_modify(code: &str) -> bool {
227217
let dangerous_patterns =
228-
["obj", // not safe to steal; https://github.com/graydon/rust/issues/761
229-
"#macro", // not safe to steal things inside of it, because they have a special syntax
230-
"#", // strange representation of the arguments to #fmt, for example
231-
" be ", // don't want to replace its child with a non-call: "Non-call expression in tail call"
232-
"@"]; // hangs when compiling: https://github.com/graydon/rust/issues/768
218+
["#macro", // not safe to steal things inside of it, because they have a special syntax
219+
"#", // strange representation of the arguments to #fmt, for example
220+
" be "]; // don't want to replace its child with a non-call: "Non-call expression in tail call"
233221

234222
for p: str in dangerous_patterns { if contains(code, p) { ret true; } }
235223
ret false;
236224
}
237225

238-
fn content_is_confusing(code: &str) ->
239-
bool { // https://github.com/graydon/rust/issues/671
240-
// https://github.com/graydon/rust/issues/669
241-
// https://github.com/graydon/rust/issues/669
242-
// https://github.com/graydon/rust/issues/669
243-
// crazy rules enforced by parser rather than typechecker?
244-
// more precedence issues
245-
// more precedence issues?
246-
226+
fn content_is_confusing(code: &str) -> bool {
247227
let confusing_patterns =
248-
["#macro", "][]", "][mutable]", "][mutable ]", "self", "spawn",
249-
"bind", "\n\n\n\n\n", // https://github.com/graydon/rust/issues/759
250-
" : ", // https://github.com/graydon/rust/issues/760
251-
"if ret", "alt ret", "if fail", "alt fail"];
228+
["self", // crazy rules enforced by parser rather than typechecker?
229+
"spawn", // precedence issues?
230+
"bind", // precedence issues?
231+
"\n\n\n\n\n" // https://github.com/graydon/rust/issues/850
232+
];
252233

253234
for p: str in confusing_patterns { if contains(code, p) { ret true; } }
254235
ret false;
255236
}
256237

257238
fn file_is_confusing(filename: &str) -> bool {
258-
259-
// https://github.com/graydon/rust/issues/674
260-
261-
// something to do with () as a lone pattern
262-
263-
// an issue where -2147483648 gains an
264-
// extra negative sign each time through,
265-
// which i can't reproduce using "rustc
266-
// --pretty normal"???
267-
let confusing_files =
268-
["block-expr-precedence.rs", "nil-pattern.rs",
269-
"syntax-extension-fmt.rs",
270-
"newtype.rs"]; // modifying it hits something like https://github.com/graydon/rust/issues/670
239+
let confusing_files = [];
271240

272241
for f in confusing_files { if contains(filename, f) { ret true; } }
273242

@@ -308,7 +277,7 @@ fn check_convergence(files: &[str]) {
308277
let s = io::read_whole_file_str(file);
309278
if !content_is_confusing(s) {
310279
log_err #fmt["pp converge: %s", file];
311-
// Change from 7u to 2u when https://github.com/graydon/rust/issues/759 is fixed
280+
// Change from 7u to 2u once https://github.com/graydon/rust/issues/850 is fixed
312281
check_roundtrip_convergence(s, 7u);
313282
}
314283
}

0 commit comments

Comments
 (0)