Add a footer in FileEncoder and check for it in MemDecoder
This commit is contained in:
parent
39e02f1bd1
commit
95150d7246
16 changed files with 115 additions and 52 deletions
|
@ -96,7 +96,7 @@ mod signal_handler {
|
|||
|
||||
use crate::session_diagnostics::{
|
||||
RLinkEmptyVersionNumber, RLinkEncodingVersionMismatch, RLinkRustcVersionMismatch,
|
||||
RLinkWrongFileType, RlinkNotAFile, RlinkUnableToRead,
|
||||
RLinkWrongFileType, RlinkCorruptFile, RlinkNotAFile, RlinkUnableToRead,
|
||||
};
|
||||
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -645,8 +645,7 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) {
|
|||
match err {
|
||||
CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType),
|
||||
CodegenErrors::EmptyVersionNumber => dcx.emit_fatal(RLinkEmptyVersionNumber),
|
||||
CodegenErrors::EncodingVersionMismatch { version_array, rlink_version } => sess
|
||||
.dcx()
|
||||
CodegenErrors::EncodingVersionMismatch { version_array, rlink_version } => dcx
|
||||
.emit_fatal(RLinkEncodingVersionMismatch { version_array, rlink_version }),
|
||||
CodegenErrors::RustcVersionMismatch { rustc_version } => {
|
||||
dcx.emit_fatal(RLinkRustcVersionMismatch {
|
||||
|
@ -654,6 +653,9 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) {
|
|||
current_version: sess.cfg_version,
|
||||
})
|
||||
}
|
||||
CodegenErrors::CorruptFile => {
|
||||
dcx.emit_fatal(RlinkCorruptFile { file: file.display().to_string() });
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -32,6 +32,12 @@ pub(crate) struct RLinkRustcVersionMismatch<'a> {
|
|||
#[diag(driver_impl_rlink_no_a_file)]
|
||||
pub(crate) struct RlinkNotAFile;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(driver_impl_rlink_corrupt_file)]
|
||||
pub(crate) struct RlinkCorruptFile {
|
||||
pub file: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(driver_impl_ice)]
|
||||
pub(crate) struct Ice;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue