diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-07-10 17:38:52 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2025-02-15 16:47:30 +0100 |
| commit | 9b6fd35738965ef3f246018fddc743b5e5cd8d2c (patch) | |
| tree | 955710be2b114b379217abfe9c79362d99b37bbe /compiler/rustc_interface/src/errors.rs | |
| parent | 46d53a68aa1b10833ec25178171f34e29e71f1f1 (diff) | |
| download | rust-9b6fd35738965ef3f246018fddc743b5e5cd8d2c.tar.gz rust-9b6fd35738965ef3f246018fddc743b5e5cd8d2c.zip | |
Reject macro calls inside of `#![crate_name]`
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
| -rw-r--r-- | compiler/rustc_interface/src/errors.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs index b62950d6709..c3b858d4f2e 100644 --- a/compiler/rustc_interface/src/errors.rs +++ b/compiler/rustc_interface/src/errors.rs @@ -5,6 +5,21 @@ use rustc_macros::Diagnostic; use rustc_span::{Span, Symbol}; #[derive(Diagnostic)] +#[diag(interface_crate_name_does_not_match)] +pub(crate) struct CrateNameDoesNotMatch { + #[primary_span] + pub(crate) span: Span, + pub(crate) crate_name: Symbol, + pub(crate) attr_crate_name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(interface_crate_name_invalid)] +pub(crate) struct CrateNameInvalid<'a> { + pub(crate) crate_name: &'a str, +} + +#[derive(Diagnostic)] #[diag(interface_ferris_identifier)] pub struct FerrisIdentifier { #[primary_span] |
