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
Using rustc_driver::run_compiler(["empty_file.rs"], ...), the compilation is stopped after parsing.
The codemap is retrieved, and the call to lookup_char_pos panics when we visit the AST:
So if a filemap's last byte is at position n in the codemap, then n+1 will not refer to any filemap, and the next filemap will begin an n+2.
This is useful for empty files, it means that every file (even empty ones) has a byte in the codemap.
Closesrust-lang#23301, rust-lang#26504
Using
rustc_driver::run_compiler(["empty_file.rs"], ...)
, the compilation is stopped after parsing.The codemap is retrieved, and the call to
lookup_char_pos
panics when we visit the AST:I'm wondering if it's an unexpected behavior or if this situation violates an invariant of codemap.
Backtrace:
rustc:
cc nrc/rustfmt#115
The text was updated successfully, but these errors were encountered: