@@ -51,49 +51,41 @@ fn find_rust_files(files: &mutable [str], path: &str) {
51
51
fn safe_to_steal( e : ast:: expr_ ) -> bool {
52
52
alt e {
53
53
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
59
55
ast: : expr_lit ( lit) {
60
56
alt lit. node {
61
57
ast:: lit_str ( _) { true }
62
58
ast:: lit_char ( _) { true }
63
59
ast:: lit_int ( _) { false }
64
- ast:: lit_uint ( _) { false }
60
+ ast:: lit_uint ( _) { true }
65
61
ast:: lit_mach_int ( _, _) { false }
66
62
ast:: lit_float ( _) { false }
67
63
ast:: lit_mach_float ( _, _) { false }
68
64
ast:: lit_nil. { true }
69
65
ast:: lit_bool ( _) { true }
70
66
}
71
67
}
68
+
69
+ // https://github.com/graydon/rust/issues/890
72
70
ast:: expr_cast ( _, _) { false }
73
71
ast:: expr_assert ( _) { false }
74
72
ast:: expr_binary ( _, _, _) { false }
75
73
ast:: expr_assign ( _, _) { false }
76
74
ast:: expr_assign_op ( _, _, _) { false }
77
- ast:: expr_fail( option:: none. ) {
78
- false
79
- /* https://github.com/graydon/rust/issues/764 */
80
75
81
- }
76
+ // https://github.com/graydon/rust/issues/764
77
+ ast:: expr_fail( option:: none. ) { false }
82
78
ast:: expr_ret( option:: none. ) { false }
83
79
ast:: expr_put( option:: none. ) { false }
84
80
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 }
85
87
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 }
97
89
}
98
90
}
99
91
@@ -173,9 +165,7 @@ fn check_variants_of_ast(crate: &ast::crate, codemap: &codemap::codemap,
173
165
filename,
174
166
io::string_reader(" ") , _,
175
167
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, 7 u) ;
168
+ check_roundtrip_convergence ( str3, 1 u) ;
179
169
//check_whole_compiler(str3);
180
170
}
181
171
}
@@ -225,49 +215,28 @@ fn parse_and_print(code: &str) -> str {
225
215
226
216
fn content_is_dangerous_to_modify ( code : & str ) -> bool {
227
217
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"
233
221
234
222
for p: str in dangerous_patterns { if contains ( code, p) { ret true ; } }
235
223
ret false;
236
224
}
237
225
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 {
247
227
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
+ ] ;
252
233
253
234
for p: str in confusing_patterns { if contains ( code, p) { ret true ; } }
254
235
ret false;
255
236
}
256
237
257
238
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 = [ ] ;
271
240
272
241
for f in confusing_files { if contains ( filename, f) { ret true ; } }
273
242
@@ -308,7 +277,7 @@ fn check_convergence(files: &[str]) {
308
277
let s = io:: read_whole_file_str ( file) ;
309
278
if !content_is_confusing ( s) {
310
279
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
312
281
check_roundtrip_convergence ( s, 7 u) ;
313
282
}
314
283
}
0 commit comments