Reject macro calls inside of #![crate_name]

This commit is contained in:
León Orell Valerian Liehr
2024-07-10 17:38:52 +02:00
parent 46d53a68aa
commit 9b6fd35738
21 changed files with 196 additions and 115 deletions

View File

@@ -4,6 +4,21 @@ use std::path::Path;
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 {