forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#101238 - RalfJung:rollup-bzcmobj, r=RalfJung
Rollup of 7 pull requests Successful merges: - rust-lang#90946 (Ignore `reference`s in "Type::inner_def_id") - rust-lang#100730 (Migrate rustc_monomorphize to use SessionDiagnostic) - rust-lang#100753 (translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1) - rust-lang#100831 (Migrate `symbol_mangling` module to new diagnostics structs) - rust-lang#101204 (rustdoc: Resugar async fn return type in `clean`, not `html`) - rust-lang#101216 (Use in-page links for sanitizer docs.) - rust-lang#101237 (fix into_iter on ZST) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
36 changed files
with
672 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
compiler/rustc_error_messages/locales/en-US/monomorphize.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
monomorphize_recursion_limit = | ||
reached the recursion limit while instantiating `{$shrunk}` | ||
.note = `{$def_path_str}` defined here | ||
monomorphize_written_to_path = the full type name has been written to '{$path}' | ||
monomorphize_type_length_limit = reached the type-length limit while instantiating `{$shrunk}` | ||
monomorphize_consider_type_length_limit = | ||
consider adding a `#![type_length_limit="{$type_length}"]` attribute to your crate | ||
monomorphize_fatal_error = {$error_message} | ||
monomorphize_unknown_partition_strategy = unknown partitioning strategy | ||
monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined | ||
monomorphize_unused_generic_params = item has unused generic parameters | ||
monomorphize_large_assignments = | ||
moving {$size} bytes | ||
.label = value moved from here | ||
.note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` | ||
monomorphize_requires_lang_item = | ||
requires `{$lang_item}` lang_item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
session_incorrect_cgu_reuse_type = | ||
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` | ||
session_feature_gate_error = {$explain} | ||
session_feature_diagnostic_for_issue = | ||
see issue #{$n} <https://github.com/rust-lang/rust/issues/{$n}> for more information | ||
session_feature_diagnostic_help = | ||
add `#![feature({$feature})]` to the crate attributes to enable |
7 changes: 7 additions & 0 deletions
7
compiler/rustc_error_messages/locales/en-US/symbol_mangling.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
symbol_mangling_invalid_symbol_name = symbol-name({$mangled_formatted}) | ||
symbol_mangling_invalid_trait_item = demangling({$demangling_formatted}) | ||
symbol_mangling_alt_invalid_trait_item = demangling-alt({$alt_demangling_formatted}) | ||
symbol_mangling_invalid_def_path = def-path({$def_path}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::LangItem; | ||
|
||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable)] | ||
pub struct LangItemError(pub LangItem); | ||
|
||
impl ToString for LangItemError { | ||
fn to_string(&self) -> String { | ||
format!("requires `{}` lang_item", self.0.name()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
use std::path::PathBuf; | ||
|
||
use rustc_errors::ErrorGuaranteed; | ||
use rustc_macros::{LintDiagnostic, SessionDiagnostic}; | ||
use rustc_session::SessionDiagnostic; | ||
use rustc_span::Span; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(monomorphize::recursion_limit)] | ||
pub struct RecursionLimit { | ||
#[primary_span] | ||
pub span: Span, | ||
pub shrunk: String, | ||
#[note] | ||
pub def_span: Span, | ||
pub def_path_str: String, | ||
#[note(monomorphize::written_to_path)] | ||
pub was_written: Option<()>, | ||
pub path: PathBuf, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(monomorphize::type_length_limit)] | ||
#[help(monomorphize::consider_type_length_limit)] | ||
pub struct TypeLengthLimit { | ||
#[primary_span] | ||
pub span: Span, | ||
pub shrunk: String, | ||
#[note(monomorphize::written_to_path)] | ||
pub was_written: Option<()>, | ||
pub path: PathBuf, | ||
pub type_length: usize, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(monomorphize::requires_lang_item)] | ||
pub struct RequiresLangItem { | ||
pub lang_item: String, | ||
} | ||
|
||
pub struct UnusedGenericParams { | ||
pub span: Span, | ||
pub param_spans: Vec<Span>, | ||
pub param_names: Vec<String>, | ||
} | ||
|
||
impl SessionDiagnostic<'_> for UnusedGenericParams { | ||
fn into_diagnostic( | ||
self, | ||
sess: &'_ rustc_session::parse::ParseSess, | ||
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { | ||
let mut diag = sess.struct_err(rustc_errors::fluent::monomorphize::unused_generic_params); | ||
diag.set_span(self.span); | ||
for (span, name) in self.param_spans.into_iter().zip(self.param_names) { | ||
// FIXME: I can figure out how to do a label with a fluent string with a fixed message, | ||
// or a label with a dynamic value in a hard-coded string, but I haven't figured out | ||
// how to combine the two. 😢 | ||
diag.span_label(span, format!("generic parameter `{}` is unused", name)); | ||
} | ||
diag | ||
} | ||
} | ||
|
||
#[derive(LintDiagnostic)] | ||
#[diag(monomorphize::large_assignments)] | ||
#[note] | ||
pub struct LargeAssignmentsLint { | ||
#[label] | ||
pub span: Span, | ||
pub size: u64, | ||
pub limit: u64, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(monomorphize::unknown_partition_strategy)] | ||
pub struct UnknownPartitionStrategy; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(monomorphize::symbol_already_defined)] | ||
pub struct SymbolAlreadyDefined { | ||
#[primary_span] | ||
pub span: Option<Span>, | ||
pub symbol: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.