You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "failed to parse crate: \"pub fn test() {\\n for i in 1 .. unsafe { 100 } {\\n println!(\\\"{:?}\\\", i);\\n }\\n}\\n\""', /checkout/src/libcore/result.rs:906:4
Changing unsafe { 100 } to be just 100 fixes the issue.
The attached rust (test.rs) compiles fine (with rustc 1.22 nightly), so I think it should be able to be parsed by syn.
Thanks for the great library!
The text was updated successfully, but these errors were encountered:
The problem here is that we parse unsafe {} in the same parser as we parse {}, and in that position a normal, non-unsafe, block would not be allowed to be parsed, but an unsafe block would.
We'll need to split up the parsers for unsafe {} and {} so that we don't have to guard both.
Tested with syn 0.11.11.
Output:
Changing
unsafe { 100 }
to be just100
fixes the issue.The attached rust (
test.rs
) compiles fine (with rustc 1.22 nightly), so I think it should be able to be parsed bysyn
.Thanks for the great library!
The text was updated successfully, but these errors were encountered: