Skip to content

Rollup of 7 pull requests #101238

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
merged 31 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 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
fe29ac9
fix into_iter on ZST
RalfJung Aug 31, 2022
775e969
Rollup merge of #90946 - GuillaumeGomez:def-id-remove-weird-case, r=M…
RalfJung Aug 31, 2022
6c4bda6
Rollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=…
RalfJung Aug 31, 2022
24922b7
Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-ses…
RalfJung Aug 31, 2022
59d2c19
Rollup merge of #100831 - JhonnyBillM:migrate-symbol-mangling-to-diag…
RalfJung Aug 31, 2022
8ed9ac6
Rollup merge of #101204 - aDotInTheVoid:async-resugar-in-clean, r=Gui…
RalfJung Aug 31, 2022
cc02024
Rollup merge of #101216 - ehuss:sanitizer-links, r=JohnTitor
RalfJung Aug 31, 2022
2a02882
Rollup merge of #101237 - RalfJung:into-iter-zst, r=thomcc
RalfJung 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
ADD - InvalidSymbolName to migrate symbol-name({}) error to new diagn…
…ostics infraestructure

ADD - dependencies needed to port a module to new Diagnostics infra (rustc_macros, rustc_errors, errors file, and fluent file)
  • Loading branch information
JhonnyBillM committed Aug 30, 2022
commit 86f8c4e8e3136ee1831ffaa9d6fbdac7267d35ea
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4155,7 +4155,9 @@ dependencies = [
"punycode",
"rustc-demangle",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symbol_mangling_invalid_symbol_name = symbol-name({$mangled_formatted})
1 change: 1 addition & 0 deletions compiler/rustc_error_messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fluent_messages! {
ty_utils => "../locales/en-US/ty_utils.ftl",
typeck => "../locales/en-US/typeck.ftl",
mir_dataflow => "../locales/en-US/mir_dataflow.ftl",
symbol_mangling => "../locales/en-US/symbol_mangling.ftl",
}

pub use fluent_generated::{self as fluent, DEFAULT_LOCALE_RESOURCES};
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_symbol_mangling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ rustc_hir = { path = "../rustc_hir" }
rustc_target = { path = "../rustc_target" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_session = { path = "../rustc_session" }
rustc_macros = { path = "../rustc_macros" }
rustc_errors = { path = "../rustc_errors" }
12 changes: 12 additions & 0 deletions compiler/rustc_symbol_mangling/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Errors emitted by symbol_mangling.

use rustc_macros::SessionDiagnostic;
use rustc_span::Span;

#[derive(SessionDiagnostic)]
#[error(symbol_mangling::invalid_symbol_name)]
pub struct InvalidSymbolName<'a> {
#[primary_span]
pub span: Span,
pub mangled_formatted: &'a str,
}
1 change: 1 addition & 0 deletions compiler/rustc_symbol_mangling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ use tracing::debug;
mod legacy;
mod v0;

pub mod errors;
pub mod test;
pub mod typeid;

Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_symbol_mangling/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! def-path. This is used for unit testing the code that generates
//! paths etc in all kinds of annoying scenarios.

use crate::errors::InvalidSymbolName;
use rustc_hir::def_id::LocalDefId;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{subst::InternalSubsts, Instance, TyCtxt};
Expand Down Expand Up @@ -59,7 +60,10 @@ impl SymbolNamesTest<'_> {
tcx.erase_regions(InternalSubsts::identity_for_item(tcx, def_id)),
);
let mangled = tcx.symbol_name(instance);
tcx.sess.span_err(attr.span, &format!("symbol-name({})", mangled));
tcx.sess.emit_err(InvalidSymbolName {
span: attr.span,
mangled_formatted: &format!("{mangled}"),
});
if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) {
tcx.sess.span_err(attr.span, &format!("demangling({})", demangling));
tcx.sess.span_err(attr.span, &format!("demangling-alt({:#})", demangling));
Expand Down