forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63853 - matthewjasper:test-ast-serializatio…
…n, r=estebank Add default serialization for `Ident`s Also add tests for `-Zast-json` and `-Zast-json-noexpand` closes rust-lang#63728
- Loading branch information
Showing
5 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Test that AST json serialization doesn't ICE (#63728). | ||
|
||
// revisions: expand noexpand | ||
|
||
//[expand] compile-flags: -Zast-json | ||
//[noexpand] compile-flags: -Zast-json-noexpand | ||
|
||
// check-pass | ||
// dont-check-compiler-stdout - don't check for any AST change. | ||
|
||
#![feature(asm)] | ||
|
||
enum V { | ||
A(i32), | ||
B { f: [i64; 3 + 4] } | ||
} | ||
|
||
trait X { | ||
type Output; | ||
fn read(&self) -> Self::Output {} | ||
fn write(&mut self, _: Self::Output) {} | ||
} | ||
|
||
macro_rules! call_println { | ||
($y:ident) => { println!("{}", $y) } | ||
} | ||
|
||
fn main() { | ||
asm!(""::::); | ||
|
||
let x: (i32) = 35; | ||
let y = x as i64<> + 5; | ||
|
||
call_println!(y); | ||
|
||
struct A; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Check that AST json printing works. | ||
|
||
// check-pass | ||
// compile-flags: -Zast-json-noexpand | ||
// normalize-stdout-test ":\d+" -> ":0" | ||
|
||
// Only include a single item to reduce how often the test output needs | ||
// updating. | ||
extern crate core; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"module":{"inner":{"lo":0,"hi":0},"items":[{"ident":{"name":"core","span":{"lo":0,"hi":0}},"attrs":[],"id":0,"node":{"variant":"ExternCrate","fields":[null]},"vis":{"node":"Inherited","span":{"lo":0,"hi":0}},"span":{"lo":0,"hi":0},"tokens":[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["extern",false]},"span":{"lo":0,"hi":0}}]},{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate",false]},"span":{"lo":0,"hi":0}}]},{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["core",false]},"span":{"lo":0,"hi":0}}]},{"variant":"Token","fields":[{"kind":"Semi","span":{"lo":0,"hi":0}}]}]}],"inline":true},"attrs":[],"span":{"lo":0,"hi":0}} |