Closed
Description
echo "mod abc; fn main(){let a =1\n; \n let b = 2;}" | rustfmt
result:
stdin:1:5: 1:8 error: file not found for module `abc`
stdin:1 mod abc; fn main(){let a =1
^~~
For file formatting it's quite okay since you have a location to search modules in, but obviously this behavior is not ideal when piping from stdin.
The error is generated by syntex_syntax. Maybe we can parse syntax items more granularly and ignore this kind of error.