-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #101333 - matthiaskrgr:rollup-qpf1otj, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #100121 (Try normalizing types without RevealAll in ParamEnv in MIR validation) - #100200 (Change implementation of `-Z gcc-ld` and `lld-wrapper` again) - #100814 ( Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1) - #101215 (Also replace the version placeholder in rustc_attr) - #101260 (Use `FILE_ATTRIBUTE_TAG_INFO` to get reparse tag) - #101323 (Remove unused .toggle-label CSS rule) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
28 changed files
with
303 additions
and
144 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/trait_selection.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 @@ | ||
trait_selection_dump_vtable_entries = vtable entries for `{$trait_ref}`: {$entries} | ||
trait_selection_unable_to_construct_constant_value = unable to construct a constant value for the unevaluated constant {$unevaluated} | ||
trait_selection_auto_deref_reached_recursion_limit = reached the recursion limit while auto-dereferencing `{$ty}` | ||
.label = deref recursion limit reached | ||
.help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) | ||
trait_selection_empty_on_clause_in_rustc_on_unimplemented = empty `on`-clause in `#[rustc_on_unimplemented]` | ||
.label = empty on-clause here | ||
trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-clause in `#[rustc_on_unimplemented]` | ||
.label = invalid on-clause here | ||
trait_selection_no_value_in_rustc_on_unimplemented = this attribute must have a valid value | ||
.label = expected value here | ||
.note = eg `#[rustc_on_unimplemented(message="foo")]` | ||
trait_selection_negative_positive_conflict = found both positive and negative implementation of trait `{$trait_desc}`{$self_desc -> | ||
[none] {""} | ||
*[default] {" "}for type `{$self_desc}` | ||
}: | ||
.negative_implementation_here = negative implementation here | ||
.negative_implementation_in_crate = negative implementation in crate `{$negative_impl_cname}` | ||
.positive_implementation_here = positive implementation here | ||
.positive_implementation_in_crate = positive implementation in crate `{$positive_impl_cname}` |
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
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,102 @@ | ||
use rustc_errors::{fluent, ErrorGuaranteed}; | ||
use rustc_macros::SessionDiagnostic; | ||
use rustc_middle::ty::{PolyTraitRef, Ty, Unevaluated}; | ||
use rustc_session::{parse::ParseSess, Limit, SessionDiagnostic}; | ||
use rustc_span::{Span, Symbol}; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(trait_selection::dump_vtable_entries)] | ||
pub struct DumpVTableEntries<'a> { | ||
#[primary_span] | ||
pub span: Span, | ||
pub trait_ref: PolyTraitRef<'a>, | ||
pub entries: String, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(trait_selection::unable_to_construct_constant_value)] | ||
pub struct UnableToConstructConstantValue<'a> { | ||
#[primary_span] | ||
pub span: Span, | ||
pub unevaluated: Unevaluated<'a>, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[help] | ||
#[diag(trait_selection::auto_deref_reached_recursion_limit, code = "E0055")] | ||
pub struct AutoDerefReachedRecursionLimit<'a> { | ||
#[primary_span] | ||
#[label] | ||
pub span: Span, | ||
pub ty: Ty<'a>, | ||
pub suggested_limit: Limit, | ||
pub crate_name: Symbol, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(trait_selection::empty_on_clause_in_rustc_on_unimplemented, code = "E0232")] | ||
pub struct EmptyOnClauseInOnUnimplemented { | ||
#[primary_span] | ||
#[label] | ||
pub span: Span, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(trait_selection::invalid_on_clause_in_rustc_on_unimplemented, code = "E0232")] | ||
pub struct InvalidOnClauseInOnUnimplemented { | ||
#[primary_span] | ||
#[label] | ||
pub span: Span, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(trait_selection::no_value_in_rustc_on_unimplemented, code = "E0232")] | ||
#[note] | ||
pub struct NoValueInOnUnimplemented { | ||
#[primary_span] | ||
#[label] | ||
pub span: Span, | ||
} | ||
|
||
pub struct NegativePositiveConflict<'a> { | ||
pub impl_span: Span, | ||
pub trait_desc: &'a str, | ||
pub self_desc: &'a Option<String>, | ||
pub negative_impl_span: Result<Span, Symbol>, | ||
pub positive_impl_span: Result<Span, Symbol>, | ||
} | ||
|
||
impl SessionDiagnostic<'_> for NegativePositiveConflict<'_> { | ||
fn into_diagnostic( | ||
self, | ||
sess: &ParseSess, | ||
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { | ||
let mut diag = sess.struct_err(fluent::trait_selection::negative_positive_conflict); | ||
diag.set_arg("trait_desc", self.trait_desc); | ||
diag.set_arg( | ||
"self_desc", | ||
self.self_desc.clone().map_or_else(|| String::from("none"), |ty| ty), | ||
); | ||
diag.set_span(self.impl_span); | ||
diag.code(rustc_errors::error_code!(E0751)); | ||
match self.negative_impl_span { | ||
Ok(span) => { | ||
diag.span_label(span, fluent::trait_selection::negative_implementation_here); | ||
} | ||
Err(cname) => { | ||
diag.note(fluent::trait_selection::negative_implementation_in_crate); | ||
diag.set_arg("negative_impl_cname", cname.to_string()); | ||
} | ||
} | ||
match self.positive_impl_span { | ||
Ok(span) => { | ||
diag.span_label(span, fluent::trait_selection::positive_implementation_here); | ||
} | ||
Err(cname) => { | ||
diag.note(fluent::trait_selection::positive_implementation_in_crate); | ||
diag.set_arg("positive_impl_cname", cname.to_string()); | ||
} | ||
} | ||
diag | ||
} | ||
} |
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
Oops, something went wrong.