Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
137f20c
rebased: convert rustc_monomorphize errors to SessionDiagnostic
CleanCut Aug 18, 2022
40f4473
replace some usages of [Span]FatalError with error-specific types
CleanCut Aug 23, 2022
33cbbc2
remove stray comment
CleanCut Aug 23, 2022
e914247
bless the change in note/help order due to migrating to SessionDiagno…
CleanCut Aug 24, 2022
30c7506
allow non-monomorphize modules to access hard-coded error message thr…
CleanCut Aug 24, 2022
6cdfdd0
adjust to new error value
CleanCut Aug 24, 2022
82d609c
have LangItemError derive everything LangItem does
CleanCut Aug 24, 2022
706452e
translations(rustc_session): migrate the file cgu_reuse_tracker
beowolx Aug 19, 2022
d5262a9
translations(rustc_session): migrate 80% of the file parse.rs
beowolx Aug 22, 2022
2c77f3e
translations(rustc_session): migrate check_expected_reuse
beowolx Aug 24, 2022
a19139f
remove unnecessary comment
CleanCut Aug 26, 2022
845d567
revert src/tools/cargo submodule to where it ought to be from where w…
CleanCut Aug 26, 2022
6099d17
rustdoc: Resugar async fn return type in `clean`, not `html`
aDotInTheVoid Aug 30, 2022
6c585fc
Clean up render_assoc_items_inner a bit
GuillaumeGomez Aug 30, 2022
86f8c4e
ADD - InvalidSymbolName to migrate symbol-name({}) error to new diagn…
JhonnyBillM Aug 27, 2022
359002b
ADD - migrate InvalidTraitItem and AltInvalidTraitItem errors
JhonnyBillM Aug 21, 2022
bd83bbc
UPDATE - accept String instead of unused 'str
JhonnyBillM Aug 21, 2022
8f5fada
ADD - migrate InvalidDefPath to new diagnostics infra
JhonnyBillM Aug 21, 2022
ef2f6ab
ADD - diagnostics lints to symbol_mangling module
JhonnyBillM Aug 21, 2022
3ee6946
UPDATE - to support diag introduced in PR #100765
JhonnyBillM Aug 21, 2022
8588374
Use in-page links for sanitizer docs.
ehuss Aug 30, 2022
900cda2
Print only blanket implementations on reference primitive type
GuillaumeGomez Aug 30, 2022
477b7ba
Add regression test for implementations displayed on reference primit…
GuillaumeGomez Aug 30, 2022
fcc90f2
Rollup merge of #90946 - GuillaumeGomez:def-id-remove-weird-case, r=M…
GuillaumeGomez Aug 31, 2022
ac7705f
Rollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=…
GuillaumeGomez Aug 31, 2022
d8f2acf
Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-ses…
GuillaumeGomez Aug 31, 2022
7e11c11
Rollup merge of #100831 - JhonnyBillM:migrate-symbol-mangling-to-diag…
GuillaumeGomez Aug 31, 2022
72e33a3
Rollup merge of #101204 - aDotInTheVoid:async-resugar-in-clean, r=Gui…
GuillaumeGomez Aug 31, 2022
39b083c
Rollup merge of #101216 - ehuss:sanitizer-links, r=JohnTitor
GuillaumeGomez Aug 31, 2022
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
Prev Previous commit
Next Next commit
translations(rustc_session): migrate check_expected_reuse
This commit migrates the errors in the function check_expected_reuse
to use the new SessionDiagnostic. It also does some small refactor
for the IncorrectCguReuseType to include the 'at least' word in the
fluent translation file
  • Loading branch information
beowolx committed Aug 26, 2022
commit 2c77f3e9c5804edc0bb520c7b4774424cea6beb0
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
}
});

sess.cgu_reuse_tracker.check_expected_reuse(sess.diagnostic());
sess.cgu_reuse_tracker.check_expected_reuse(sess);

sess.abort_if_errors();

Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_error_messages/locales/en-US/session.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
session_incorrect_cgu_reuse_type =
CGU-reuse for `{$cgu_user_name}` is `{$actual_reuse}` but should be `{$at_least}``${expected_reuse}`
CGU-reuse for `{$cgu_user_name}` is `{$actual_reuse}` but should be {$at_least ->
[one] {"at least "}
*[other] {""}
}`{$expected_reuse}`

session_cgu_not_recorded =
CGU-reuse for `{$cgu_user_name}` is (mangled: `{$cgu_name}`) was not recorded`
Expand Down
17 changes: 5 additions & 12 deletions compiler/rustc_session/src/cgu_reuse_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
//! compilation. This is used for incremental compilation tests and debug
//! output.

use crate::errors::IncorrectCguReuseType;
use crate::errors::{CguNotRecorded, IncorrectCguReuseType};
use crate::Session;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
use rustc_span::{Span, Symbol};
Expand Down Expand Up @@ -104,7 +105,7 @@ impl CguReuseTracker {
}
}

pub fn check_expected_reuse(&self, diag: &rustc_errors::Handler) {
pub fn check_expected_reuse(&self, sess: &Session) {
if let Some(ref data) = self.data {
let data = data.lock().unwrap();

Expand All @@ -118,7 +119,7 @@ impl CguReuseTracker {
};

if error {
let at_least = if at_least { "at least " } else { "" };
let at_least = if at_least { 1 } else { 0 };
IncorrectCguReuseType {
span: error_span.0,
cgu_user_name: &cgu_user_name,
Expand All @@ -128,15 +129,7 @@ impl CguReuseTracker {
};
}
} else {
//FIXME: Remove this once PR #100694 that implements `[fatal(..)]` is merged
let msg = format!(
"CGU-reuse for `{cgu_user_name}` (mangled: `{cgu_name}`) was \
not recorded"
);
diag.span_fatal(error_span.0, &msg)

//FIXME: Uncomment this once PR #100694 that implements `[fatal(..)]` is merged
// CguNotRecorded { cgu_user_name, cgu_name };
sess.emit_fatal(CguNotRecorded { cgu_user_name, cgu_name });
}
}
}
Expand Down
15 changes: 7 additions & 8 deletions compiler/rustc_session/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ pub struct IncorrectCguReuseType<'a> {
pub cgu_user_name: &'a str,
pub actual_reuse: CguReuse,
pub expected_reuse: CguReuse,
pub at_least: &'a str,
pub at_least: u8,
}

//FIXME: Uncomment this once PR #100694 that implements `[fatal(..)]` is merged
// #[derive(SessionDiagnostic)]
// #[fatal(session::cgu_not_recorded)]
// pub struct CguNotRecorded<'a> {
// pub cgu_user_name: &'a str,
// pub cgu_name: &'a str,
// }
#[derive(SessionDiagnostic)]
#[diag(session::cgu_not_recorded)]
pub struct CguNotRecorded<'a> {
pub cgu_user_name: &'a str,
pub cgu_name: &'a str,
}

#[derive(SessionDiagnostic)]
#[diag(session::feature_gate_error, code = "E0658")]
Expand Down