Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
09f774d
Mark all arms as being from a desugaring when lowering `?` and for lo…
Jarcho Nov 23, 2025
2135bc1
Remove `rustc_lexer::cursor` module.
nnethercote Jan 21, 2026
506ea79
Move two `rustc_parse` error diagnostics.
nnethercote Jan 21, 2026
b33fdb2
Move `TokenDescription`.
nnethercote Jan 21, 2026
13141af
Consolidate type const checks on `tcx.is_type_const`
eggyal Feb 4, 2026
1851937
Hard code the error code registry for custom drivers
bjorn3 Feb 4, 2026
34cdaeb
Fix typos in riscv64a23-unknown-linux-gnu.md
wolfv Feb 5, 2026
639cb69
Replace Registry type with a lazily initialized static
bjorn3 Feb 4, 2026
9112039
Port rustc_effective_visibility to the new attribute parser
jdonszelmann Feb 5, 2026
dd61998
Convert to inline diagnostics in `rustc_borrowck`
JonathanBrouwer Feb 4, 2026
6782a19
Register functions in translation
JonathanBrouwer Feb 4, 2026
55d1ba1
Convert to inline diagnostics in `rustc_trait_selection`
JonathanBrouwer Feb 4, 2026
623c9cd
update compiler stable backport zulip msg
apiraino Feb 5, 2026
a2f9dec
Parse #[rustc_abi(..)]
Ozzy1423 Feb 5, 2026
5d42732
update openmp/offload builds to LLVM 22
ZuseZ4 Feb 6, 2026
1dfdfe8
chore: clearify tidy's error message
nyurik Feb 6, 2026
62d0533
Update error message for non-descriptive test files
nyurik Feb 6, 2026
dc87b28
Improve error message for non-descriptive test names
nyurik Feb 6, 2026
57aae94
Convert to inline diagnostics in `rustc_hir_analysis`
JonathanBrouwer Feb 5, 2026
de0e4bd
Rollup merge of #152191 - JonathanBrouwer:convert_hir_analysis, r=jdo…
JonathanBrouwer Feb 6, 2026
ee753e8
Rollup merge of #149329 - Jarcho:for_question_ctxt, r=davidtwco
JonathanBrouwer Feb 6, 2026
3fb5265
Rollup merge of #151474 - nnethercote:circ-deps, r=davidtwco
JonathanBrouwer Feb 6, 2026
65a1d97
Rollup merge of #152107 - JonathanBrouwer:convert_borrowck, r=lqd
JonathanBrouwer Feb 6, 2026
771fa57
Rollup merge of #152117 - JonathanBrouwer:convert_trait_selection2, r…
JonathanBrouwer Feb 6, 2026
ce706cd
Rollup merge of #152136 - eggyal:consolidate-type-const-checks, r=Box…
JonathanBrouwer Feb 6, 2026
d96d73f
Rollup merge of #152140 - bjorn3:driver_fixed_error_codes, r=jdonszel…
JonathanBrouwer Feb 6, 2026
19840e1
Rollup merge of #152155 - wolfv:patch-1, r=wesleywiser
JonathanBrouwer Feb 6, 2026
19f4c05
Rollup merge of #152170 - jdonszelmann:port-rustc-effective-visibilit…
JonathanBrouwer Feb 6, 2026
6db1e09
Rollup merge of #152182 - apiraino:update-compiler-stable-backport-zu…
JonathanBrouwer Feb 6, 2026
0cc62c8
Rollup merge of #152184 - Ozzy1423:attrs3, r=jdonszelmann
JonathanBrouwer Feb 6, 2026
8420a08
Rollup merge of #152195 - ZuseZ4:update-offload-llvm22-A, r=jieyouxu
JonathanBrouwer Feb 6, 2026
2a01963
Rollup merge of #152202 - nyurik:better-msg, r=jieyouxu
JonathanBrouwer Feb 6, 2026
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
2 changes: 0 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3795,7 +3795,6 @@ dependencies = [
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"serde_json",
"shlex",
"tracing",
Expand Down Expand Up @@ -4721,7 +4720,6 @@ dependencies = [
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_fluent_macro",
"rustc_hir",
"rustc_infer",
"rustc_macros",
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_driver_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ rustc_resolve = { path = "../rustc_resolve" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
serde_json = "1.0.59"
shlex = "1.0"
tracing = { version = "0.1.35" }
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
rustc_mir_build::DEFAULT_LOCALE_RESOURCE,
rustc_parse::DEFAULT_LOCALE_RESOURCE,
rustc_passes::DEFAULT_LOCALE_RESOURCE,
rustc_trait_selection::DEFAULT_LOCALE_RESOURCE,
// tidy-alphabetical-end
];

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub fn fluent_bundle(
Ok(Some(bundle))
}

fn register_functions(bundle: &mut FluentBundle) {
pub fn register_functions<R, M>(bundle: &mut fluent_bundle::bundle::FluentBundle<R, M>) {
bundle
.add_function("STREQ", |positional, _named| match positional {
[FluentValue::String(a), FluentValue::String(b)] => format!("{}", (a == b)).into(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_errors/src/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::env;
use std::error::Report;
use std::sync::Arc;

use rustc_error_messages::langid;
pub use rustc_error_messages::{FluentArgs, LazyFallbackBundle};
use rustc_error_messages::{langid, register_functions};
use tracing::{debug, trace};

use crate::error::{TranslateError, TranslateErrorKind};
Expand Down Expand Up @@ -91,6 +91,7 @@ impl Translator {
let mut bundle = fluent_bundle::FluentBundle::new(vec![langid!("en-US")]);
bundle.set_use_isolating(false);
bundle.add_resource(resource).unwrap();
register_functions(&mut bundle);
let message = bundle.get_message(GENERATED_MSG_ID).unwrap();
let value = message.value().unwrap();

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_trait_selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_hir = { path = "../rustc_hir" }
rustc_infer = { path = "../rustc_infer" }
rustc_macros = { path = "../rustc_macros" }
Expand Down
470 changes: 0 additions & 470 deletions compiler/rustc_trait_selection/messages.ftl

This file was deleted.

37 changes: 24 additions & 13 deletions compiler/rustc_trait_selection/src/error_reporting/infer/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use std::iter;

use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::{
Applicability, Diag, E0309, E0310, E0311, E0803, Subdiagnostic, struct_span_code_err,
Applicability, Diag, E0309, E0310, E0311, E0803, Subdiagnostic, inline_fluent,
struct_span_code_err,
};
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId};
Expand All @@ -25,7 +26,6 @@ use crate::errors::{
self, FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent,
RefLongerThanData, RegionOriginNote, WhereClauseSuggestions, note_and_explain,
};
use crate::fluent_generated as fluent;
use crate::infer::region_constraints::GenericKind;
use crate::infer::{
BoundRegionConversionTime, InferCtxt, RegionResolutionError, RegionVariableOrigin,
Expand Down Expand Up @@ -228,18 +228,22 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
expected_found: self.values_str(trace.values, &trace.cause, err.long_ty_path()),
}
.add_to_diag(err),
SubregionOrigin::Reborrow(span) => {
RegionOriginNote::Plain { span, msg: fluent::trait_selection_reborrow }
.add_to_diag(err)
SubregionOrigin::Reborrow(span) => RegionOriginNote::Plain {
span,
msg: inline_fluent!("...so that reference does not outlive borrowed content"),
}
.add_to_diag(err),
SubregionOrigin::RelateObjectBound(span) => {
RegionOriginNote::Plain { span, msg: fluent::trait_selection_relate_object_bound }
.add_to_diag(err);
RegionOriginNote::Plain {
span,
msg: inline_fluent!("...so that it can be closed over into an object"),
}
.add_to_diag(err);
}
SubregionOrigin::ReferenceOutlivesReferent(ty, span) => {
RegionOriginNote::WithName {
span,
msg: fluent::trait_selection_reference_outlives_referent,
msg: inline_fluent!("...so that the reference type `{$name}` does not outlive the data it points at"),
name: &self.ty_to_string(ty),
continues: false,
}
Expand All @@ -248,30 +252,37 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
SubregionOrigin::RelateParamBound(span, ty, opt_span) => {
RegionOriginNote::WithName {
span,
msg: fluent::trait_selection_relate_param_bound,
msg: inline_fluent!("...so that the type `{$name}` will meet its required lifetime bounds{$continues ->
[true] ...
*[false] {\"\"}
}"),
name: &self.ty_to_string(ty),
continues: opt_span.is_some(),
}
.add_to_diag(err);
if let Some(span) = opt_span {
RegionOriginNote::Plain {
span,
msg: fluent::trait_selection_relate_param_bound_2,
msg: inline_fluent!("...that is required by this bound"),
}
.add_to_diag(err);
}
}
SubregionOrigin::RelateRegionParamBound(span, _) => {
RegionOriginNote::Plain {
span,
msg: fluent::trait_selection_relate_region_param_bound,
msg: inline_fluent!(
"...so that the declared lifetime parameter bounds are satisfied"
),
}
.add_to_diag(err);
}
SubregionOrigin::CompareImplItemObligation { span, .. } => {
RegionOriginNote::Plain {
span,
msg: fluent::trait_selection_compare_impl_item_obligation,
msg: inline_fluent!(
"...so that the definition in impl matches the definition from the trait"
),
}
.add_to_diag(err);
}
Expand All @@ -281,7 +292,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
SubregionOrigin::AscribeUserTypeProvePredicate(span) => {
RegionOriginNote::Plain {
span,
msg: fluent::trait_selection_ascribe_user_type_prove_predicate,
msg: inline_fluent!("...so that the where clause holds"),
}
.add_to_diag(err);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rustc_data_structures::unord::UnordSet;
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, ErrorGuaranteed, Level, MultiSpan, StashKey, StringPart, Suggestions,
pluralize, struct_span_code_err,
inline_fluent, pluralize, struct_span_code_err,
};
use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId};
use rustc_hir::intravisit::Visitor;
Expand Down Expand Up @@ -3003,7 +3003,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
{
err.span_help(
self.tcx.def_span(trait_def_id),
crate::fluent_generated::trait_selection_trait_has_no_impls,
inline_fluent!("this trait has no implementations, consider adding one"),
);
} else if !suggested && trait_predicate.polarity() == ty::PredicatePolarity::Positive {
// Can't show anything else useful, try to find similar impls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ pub enum AppendConstMessage {
}

#[derive(LintDiagnostic)]
#[diag(trait_selection_malformed_on_unimplemented_attr)]
#[help]
#[diag("malformed `on_unimplemented` attribute")]
#[help("only `message`, `note` and `label` are allowed as options")]
pub struct MalformedOnUnimplementedAttrLint {
#[label]
#[label("invalid option found here")]
pub span: Span,
}

Expand All @@ -374,17 +374,17 @@ impl MalformedOnUnimplementedAttrLint {
}

#[derive(LintDiagnostic)]
#[diag(trait_selection_missing_options_for_on_unimplemented_attr)]
#[help]
#[diag("missing options for `on_unimplemented` attribute")]
#[help("at least one of the `message`, `note` and `label` options are expected")]
pub struct MissingOptionsForOnUnimplementedAttr;

#[derive(LintDiagnostic)]
#[diag(trait_selection_ignored_diagnostic_option)]
#[diag("`{$option_name}` is ignored due to previous definition of `{$option_name}`")]
pub struct IgnoredDiagnosticOption {
pub option_name: &'static str,
#[label]
#[label("`{$option_name}` is already declared here")]
pub span: Span,
#[label(trait_selection_other_label)]
#[label("`{$option_name}` is first declared here")]
pub prev_span: Span,
}

Expand All @@ -410,7 +410,7 @@ impl IgnoredDiagnosticOption {
}

#[derive(LintDiagnostic)]
#[diag(trait_selection_wrapped_parser_error)]
#[diag("{$description}")]
pub struct WrappedParserError {
pub description: String,
pub label: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,27 @@ pub mod errors {
use super::*;

#[derive(LintDiagnostic)]
#[diag(trait_selection_unknown_format_parameter_for_on_unimplemented_attr)]
#[help]
#[diag("there is no parameter `{$argument_name}` on trait `{$trait_name}`")]
#[help("expect either a generic argument name or {\"`{Self}`\"} as format argument")]
pub struct UnknownFormatParameterForOnUnimplementedAttr {
pub argument_name: Symbol,
pub trait_name: Ident,
}

#[derive(LintDiagnostic)]
#[diag(trait_selection_disallowed_positional_argument)]
#[help]
#[diag("positional format arguments are not allowed here")]
#[help(
"only named format arguments with the name of one of the generic types are allowed in this context"
)]
pub struct DisallowedPositionalArgument;

#[derive(LintDiagnostic)]
#[diag(trait_selection_invalid_format_specifier)]
#[help]
#[diag("invalid format specifier")]
#[help("no format specifier are supported in this position")]
pub struct InvalidFormatSpecifier;

#[derive(LintDiagnostic)]
#[diag(trait_selection_missing_options_for_on_unimplemented_attr)]
#[help]
#[diag("missing options for `on_unimplemented` attribute")]
#[help("at least one of the `message`, `note` and `label` options are expected")]
pub struct MissingOptionsForOnUnimplementedAttr;
}
Loading