Files
rust/compiler/rustc_query_system/src/error.rs
T
Noratrieb d66647ba2c Reword unstable finterprint ICE to ask for reproduction
When the unstable finterprint error was added, Rust was on fire, and we
needed a quick way for people to sort of understand what's going on,
follow the tracking issue, and leave some information without
overwhelming the issue tracker and focusing on getting their code
working.

This is what motivated the previous message. It called this a "known
issue", provided help on how to fix it, and only secondarily asked for a
bug report.

This is no longer true. These days incremental compilation is fairly
solid and these issues are supposed to be rare, we expect *none* of them
to exist (but obviously know that's not true). As such, it's time to
reword this message.

Recently someone mentioned how they didn't bother reporting this issue
because it said that it was a "known issue", and I only got awareness of
their problem because they complained about all the rustc-ice files
hanging around their directories. This is not at all what we want, we
want reports from people, ideally with a reproduction.

To get this, I reworded the error. It now explicitly asks for a
reproduction (and explaining what that means) and no longer calls it a
"known issue". It also does not link to the tracking issue anymore,
because I don't think this tracking issue is useful. It should probably
be closed.

I still mention the workaround, but explicitly call it a "workaround".
People should report a reproduction and only *then* use the workaround.
2025-10-17 23:28:54 +02:00

99 lines
2.2 KiB
Rust

use rustc_errors::codes::*;
use rustc_hir::limit::Limit;
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol};
#[derive(Subdiagnostic)]
#[note(query_system_cycle_stack_middle)]
pub(crate) struct CycleStack {
#[primary_span]
pub span: Span,
pub desc: String,
}
#[derive(Copy, Clone)]
pub enum HandleCycleError {
Error,
Fatal,
DelayBug,
Stash,
}
#[derive(Subdiagnostic)]
pub(crate) enum StackCount {
#[note(query_system_cycle_stack_single)]
Single,
#[note(query_system_cycle_stack_multiple)]
Multiple,
}
#[derive(Subdiagnostic)]
pub(crate) enum Alias {
#[note(query_system_cycle_recursive_ty_alias)]
#[help(query_system_cycle_recursive_ty_alias_help1)]
#[help(query_system_cycle_recursive_ty_alias_help2)]
Ty,
#[note(query_system_cycle_recursive_trait_alias)]
Trait,
}
#[derive(Subdiagnostic)]
#[note(query_system_cycle_usage)]
pub(crate) struct CycleUsage {
#[primary_span]
pub span: Span,
pub usage: String,
}
#[derive(Diagnostic)]
#[diag(query_system_cycle, code = E0391)]
pub(crate) struct Cycle {
#[primary_span]
pub span: Span,
pub stack_bottom: String,
#[subdiagnostic]
pub cycle_stack: Vec<CycleStack>,
#[subdiagnostic]
pub stack_count: StackCount,
#[subdiagnostic]
pub alias: Option<Alias>,
#[subdiagnostic]
pub cycle_usage: Option<CycleUsage>,
#[note]
pub note_span: (),
}
#[derive(Diagnostic)]
#[diag(query_system_reentrant)]
pub(crate) struct Reentrant;
#[derive(Diagnostic)]
#[diag(query_system_increment_compilation)]
#[note(query_system_increment_compilation_note1)]
#[note(query_system_increment_compilation_note2)]
#[note(query_system_increment_compilation_note3)]
#[note(query_system_increment_compilation_note4)]
pub(crate) struct IncrementCompilation {
pub run_cmd: String,
pub dep_node: String,
}
#[derive(Diagnostic)]
#[help]
#[diag(query_system_query_overflow)]
pub struct QueryOverflow {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub note: QueryOverflowNote,
pub suggested_limit: Limit,
pub crate_name: Symbol,
}
#[derive(Subdiagnostic)]
#[note(query_system_overflow_note)]
pub struct QueryOverflowNote {
pub desc: String,
pub depth: usize,
}