-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Migrate rustc_driver to SessionDiagnostic #100890
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
Merged
bors
merged 6 commits into
rust-lang:master
from
adriantombu:migrate_diagnostic_rustc_driver
Aug 27, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dbe39d8
Start moving rustc_driver to SessionDiagnostic
adriantombu e7ded92
Fixes fmt & SessionDiagnostic structs
adriantombu 1c575c5
Use std::io::Error and remove useless to_string
adriantombu 3f883b8
Start adding enum errors for deserialize_rlink
adriantombu bf7ce6a
Replace spaghetti with a simple errors enum
adriantombu d0401f7
Code cleaning
adriantombu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use rustc_macros::SessionDiagnostic; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_unable_to_read)] | ||
pub(crate) struct RlinkUnableToRead { | ||
pub err: std::io::Error, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_wrong_file_type)] | ||
pub(crate) struct RLinkWrongFileType; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_empty_version_number)] | ||
pub(crate) struct RLinkEmptyVersionNumber; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_encoding_version_mismatch)] | ||
pub(crate) struct RLinkEncodingVersionMismatch { | ||
pub version_array: String, | ||
pub rlink_version: u32, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_rustc_version_mismatch)] | ||
pub(crate) struct RLinkRustcVersionMismatch<'a> { | ||
pub rustc_version: String, | ||
pub current_version: &'a str, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(driver::rlink_no_a_file)] | ||
pub(crate) struct RlinkNotAFile; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
driver_rlink_unable_to_read = failed to read rlink file: `{$err}` | ||
|
||
driver_rlink_wrong_file_type = The input does not look like a .rlink file | ||
|
||
driver_rlink_empty_version_number = The input does not contain version number | ||
|
||
driver_rlink_encoding_version_mismatch = .rlink file was produced with encoding version `{$version_array}`, but the current version is `{$rlink_version}` | ||
|
||
driver_rlink_rustc_version_mismatch = .rlink file was produced by rustc version `{$rustc_version}`, but the current version is `{$current_version}` | ||
|
||
driver_rlink_no_a_file = rlink must be a file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.