diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
commit | 7a1cae59acf72f821343b2ba10ef69fb92a5b952 (patch) | |
tree | 26e606ccd132a24e9bc89cf174e4adadf60c5992 /crates/ra_cli/src | |
parent | b0d84cb8faefedde7ace4ff152a2a13408e79e5d (diff) | |
parent | 80a17251473bd6213a4c8a51ea7f732394d173c5 (diff) |
Merge #1337
1337: Move syntax errors our of syntax tree r=matklad a=matklad
I am not really sure if it's a good idea, but `SyntaxError` do not really belong to a `SyntaxTree`. So let's just store them on the side?
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_cli/src')
-rw-r--r-- | crates/ra_cli/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 84a1564ce..c9ca13bbc 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -34,7 +34,7 @@ fn main() -> Result<()> { | |||
34 | if !matches.is_present("no-dump") { | 34 | if !matches.is_present("no-dump") { |
35 | println!("{}", file.syntax().debug_dump()); | 35 | println!("{}", file.syntax().debug_dump()); |
36 | } | 36 | } |
37 | ::std::mem::forget(file); | 37 | std::mem::forget(file); |
38 | } | 38 | } |
39 | ("symbols", _) => { | 39 | ("symbols", _) => { |
40 | let file = file()?; | 40 | let file = file()?; |
@@ -60,11 +60,11 @@ fn main() -> Result<()> { | |||
60 | 60 | ||
61 | fn file() -> Result<TreeArc<SourceFile>> { | 61 | fn file() -> Result<TreeArc<SourceFile>> { |
62 | let text = read_stdin()?; | 62 | let text = read_stdin()?; |
63 | Ok(SourceFile::parse(&text)) | 63 | Ok(SourceFile::parse(&text).tree) |
64 | } | 64 | } |
65 | 65 | ||
66 | fn read_stdin() -> Result<String> { | 66 | fn read_stdin() -> Result<String> { |
67 | let mut buff = String::new(); | 67 | let mut buff = String::new(); |
68 | ::std::io::stdin().read_to_string(&mut buff)?; | 68 | std::io::stdin().read_to_string(&mut buff)?; |
69 | Ok(buff) | 69 | Ok(buff) |
70 | } | 70 | } |