mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 03:27:44 +00:00
42 lines
1.1 KiB
Rust
42 lines
1.1 KiB
Rust
use rustc_hir::ConstContext;
|
|
use rustc_macros::SessionDiagnostic;
|
|
use rustc_span::Span;
|
|
|
|
#[derive(SessionDiagnostic)]
|
|
#[error(const_eval::unstable_in_stable)]
|
|
pub(crate) struct UnstableInStable {
|
|
pub gate: String,
|
|
#[primary_span]
|
|
pub span: Span,
|
|
#[suggestion(
|
|
const_eval::unstable_sugg,
|
|
code = "#[rustc_const_unstable(feature = \"...\", issue = \"...\")]\n",
|
|
applicability = "has-placeholders"
|
|
)]
|
|
#[suggestion(
|
|
const_eval::bypass_sugg,
|
|
code = "#[rustc_allow_const_fn_unstable({gate})]\n",
|
|
applicability = "has-placeholders"
|
|
)]
|
|
pub attr_span: Span,
|
|
}
|
|
|
|
#[derive(SessionDiagnostic)]
|
|
#[error(const_eval::thread_local_access, code = "E0625")]
|
|
pub(crate) struct NonConstOpErr {
|
|
#[primary_span]
|
|
pub span: Span,
|
|
}
|
|
|
|
#[derive(SessionDiagnostic)]
|
|
#[error(const_eval::static_access, code = "E0013")]
|
|
#[help]
|
|
pub(crate) struct StaticAccessErr {
|
|
#[primary_span]
|
|
pub span: Span,
|
|
pub kind: ConstContext,
|
|
#[note(const_eval::teach_note)]
|
|
#[help(const_eval::teach_help)]
|
|
pub teach: Option<()>,
|
|
}
|