-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the JSON error emitter to librustc_errors #66427
Conversation
This comment has been minimized.
This comment has been minimized.
4b8670a
to
ed3aa84
Compare
r? @estebank |
Hmm; it seems to me that
|
The motivation behind this change seems quite sensible. 👍 |
Yeah, I'm not a fan of the rustc_data_structures locale -- I can definitely move it to syntax_pos. I mostly decided to just give up and move it "as far back as possible" -- maybe the right strategy is to create a |
This is a bit unfortunate, but code needs to be able to fatally error early on (in particular, syntax_pos after we move SourceMap there). It's also a tiny bit of code, which means it's ultimately not that bad.
This does not update the use sites or delete the now unnecessary SourceMapper trait, to allow git to interpret the file move as a rename rather than a new file.
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
ed3aa84
to
c31a875
Compare
Okay I split up the move of SourceMap and git now properly detects it as a rename of the file (though the intermediate commit won't build). Also changed the first commit to move FatalError to syntax_pos into a module (very creatively named |
r? @Centril |
Looks great; thanks! @bors r+ |
📌 Commit c31a875 has been approved by |
Move the JSON error emitter to librustc_errors This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself. Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).
Move the JSON error emitter to librustc_errors This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself. Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).
Rollup of 5 pull requests Successful merges: - #66350 (protect creation of destructors by a mutex) - #66407 (Add more tests for fixed ICEs) - #66415 (Add --force-run-in-process unstable option to libtest) - #66427 (Move the JSON error emitter to librustc_errors) - #66441 (libpanic_unwind for Miri: make sure we have the SEH lang items when needed) Failed merges: r? @ghost
This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself.
Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving
FatalError
to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).