File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,11 @@ pub(crate) fn format_expr(
404404 ast:: ExprKind :: FormatArgs ( ..)
405405 | ast:: ExprKind :: IncludedBytes ( ..)
406406 | ast:: ExprKind :: OffsetOf ( ..) => {
407- // These do not occur in the AST because macros aren't expanded.
408- unreachable ! ( )
407+ // These don't normally occur in the AST because macros aren't expanded. However,
408+ // rustfmt tries to parse macro arguments when formatting macros, so it's not totally
409+ // impossible for rustfmt to come across one of these nodes when formatting a file.
410+ // Also, rustfmt might get passed the output from `-Zunpretty=expanded`.
411+ None
409412 }
410413 ast:: ExprKind :: Err => None ,
411414 } ;
Original file line number Diff line number Diff line change @@ -176,8 +176,14 @@ fn rustfmt_emits_error_on_line_overflow_true() {
176176#[ test]
177177#[ allow( non_snake_case) ]
178178fn dont_emit_ICE ( ) {
179- let files = [ "tests/target/issue_5728.rs" , "tests/target/issue_5729.rs" , "tests/target/issue_6069.rs" ] ;
180-
179+ let files = [
180+ "tests/target/issue_5728.rs" ,
181+ "tests/target/issue_5729.rs" ,
182+ "tests/target/issue-5885.rs" ,
183+ "tests/target/issue_6069.rs" ,
184+ "tests/target/issue-6105.rs" ,
185+ ] ;
186+
181187 for file in files {
182188 let args = [ file] ;
183189 let ( _stdout, stderr) = rustfmt ( & args) ;
Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ println ! ( "{}" , builtin # offset_of( A , 0. 1.1 . 1 ) ) ;
3+ }
Original file line number Diff line number Diff line change 1+ const _: () = builtin # offset_of(x, x);
You can’t perform that action at this time.
0 commit comments