Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d1380a1
Use erased self type when autoderefing for trait error suggestion
compiler-errors Jul 23, 2023
f355369
Comment stuff in the new solver
compiler-errors Jul 23, 2023
a8f1b72
Remove "-unknown" from `llvm_target` for arm*v7r-none-eabi* targets.
chrisnc Apr 18, 2023
ef89948
Remove redundant `c_enum_min_bits` option from the thumbv4t-none-eabi…
chrisnc Jul 18, 2023
8e54cab
Fix comments about GCC/Clang's enum width for arm-none targets.
chrisnc Jul 18, 2023
c2158a4
generic smir stable impl for Binder
ericmarkmartin Jul 24, 2023
e36b901
Optimize format usage
nyurik Jul 24, 2023
badb617
Dynamic for smir
ericmarkmartin Jul 24, 2023
bb1ad0a
Optimize format usage
nyurik Jul 24, 2023
b787fc0
Remove redundant note.
jonathanpallant Jul 17, 2023
34e01d5
Add clarification about build-std and using newer instructions.
jonathanpallant Jul 17, 2023
8cab95e
Add missing documentation for `Session::time`
GuillaumeGomez Jul 24, 2023
3ad3bb6
lcnr's suggestions
compiler-errors Jul 24, 2023
60a5d2d
Rollup merge of #113969 - ericmarkmartin:smir-ty-dynamic, r=spastorino
matthiaskrgr Jul 24, 2023
15c7234
Rollup merge of #113985 - compiler-errors:issue-113951, r=estebank
matthiaskrgr Jul 24, 2023
2660d5d
Rollup merge of #113987 - compiler-errors:comments, r=lcnr
matthiaskrgr Jul 24, 2023
4d2f98d
Rollup merge of #113992 - chrisnc:arm-none-fixups, r=oli-obk
matthiaskrgr Jul 24, 2023
974a1c2
Rollup merge of #113993 - nyurik:ref_format_errors, r=WaffleLapkin
matthiaskrgr Jul 24, 2023
3723b30
Rollup merge of #113994 - nyurik:parser-fmt-ref, r=davidtwco
matthiaskrgr Jul 24, 2023
4ee3266
Rollup merge of #114006 - jonathanpallant:update-sparc-unknown-readme…
matthiaskrgr Jul 24, 2023
a516425
Rollup merge of #114021 - GuillaumeGomez:session-time-docs, r=lcnr
matthiaskrgr Jul 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,13 @@ impl Diagnostic {
let expected_label = if expected_label.is_empty() {
"expected".to_string()
} else {
format!("expected {}", expected_label)
format!("expected {expected_label}")
};
let found_label = found_label.to_string();
let found_label = if found_label.is_empty() {
"found".to_string()
} else {
format!("found {}", found_label)
format!("found {found_label}")
};
let (found_padding, expected_padding) = if expected_label.len() > found_label.len() {
(expected_label.len() - found_label.len(), 0)
Expand All @@ -439,13 +439,13 @@ impl Diagnostic {
StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
}));
msg.push((format!("`{}\n", expected_extra), Style::NoStyle));
msg.push((format!("`{expected_extra}\n"), Style::NoStyle));
msg.push((format!("{}{} `", " ".repeat(found_padding), found_label), Style::NoStyle));
msg.extend(found.0.iter().map(|x| match *x {
StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle),
StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight),
}));
msg.push((format!("`{}", found_extra), Style::NoStyle));
msg.push((format!("`{found_extra}"), Style::NoStyle));

// For now, just attach these as notes.
self.highlighted_note(msg);
Expand All @@ -454,7 +454,7 @@ impl Diagnostic {

pub fn note_trait_signature(&mut self, name: Symbol, signature: String) -> &mut Self {
self.highlighted_note(vec![
(format!("`{}` from trait: `", name), Style::NoStyle),
(format!("`{name}` from trait: `"), Style::NoStyle),
(signature, Style::Highlight),
("`".to_string(), Style::NoStyle),
]);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/diagnostic_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl IntoDiagnosticArg for bool {

impl IntoDiagnosticArg for char {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
DiagnosticArgValue::Str(Cow::Owned(format!("{:?}", self)))
DiagnosticArgValue::Str(Cow::Owned(format!("{self:?}")))
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ pub trait Emitter: Translate {
let msg = if substitution.is_empty() || sugg.style.hide_inline() {
// This substitution is only removal OR we explicitly don't want to show the
// code inline (`hide_inline`). Therefore, we don't show the substitution.
format!("help: {}", &msg)
format!("help: {msg}")
} else {
// Show the default suggestion text with the substitution
format!(
"help: {}{}: `{}`",
&msg,
msg,
if self.source_map().is_some_and(|sm| is_case_difference(
sm,
substitution,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ impl HandlerInner {
let _ = self.fatal(errors);
}
(_, _) => {
let _ = self.fatal(format!("{}; {}", &errors, &warnings));
let _ = self.fatal(format!("{errors}; {warnings}"));
}
}

Expand Down