Skip to content

Commit

Permalink
Fix botched fix for rust-lang/rust#111633
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed May 31, 2023
1 parent 23a8541 commit e91518e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ impl Callbacks {
let lib = result.unwrap_or_else(|err| {
// smoelius: rust-lang/rust#111633 changed the type of `early_error`'s `msg`
// argument from `&str` to `impl Into<DiagnosticMessage>`.
let msg = format!(
"could not load library `{}`: {}",
path.to_string_lossy(),
err
);
rustc_session::early_error(
rustc_session::config::ErrorOutputType::default(),
format!(
"could not load library `{}`: {}",
path.to_string_lossy(),
err
)
.as_str(),
msg.as_str(),
);
});

Expand Down
3 changes: 2 additions & 1 deletion utils/linting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ pub fn config_toml(name: &str) -> ConfigResult<Option<toml::Value>> {
/// etc. includes a call to `init_config`.
pub fn init_config(sess: &rustc_session::Session) {
try_init_config(sess).unwrap_or_else(|err| {
let msg = format!("could not read configuration file: {err}");
rustc_session::early_error(
rustc_session::config::ErrorOutputType::default(),
format!("could not read configuration file: {err}").as_str(),
msg.as_str(),
);
});
}
Expand Down

0 comments on commit e91518e

Please sign in to comment.