diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index 357be2f48f85..313c0ef1a9da 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -5,8 +5,8 @@ use super::prelude::*; use crate::attributes::AttributeSafety; use crate::session_diagnostics::{ - NakedFunctionIncompatibleAttribute, NullOnExport, NullOnObjcClass, NullOnObjcSelector, - ObjcClassExpectedStringLiteral, ObjcSelectorExpectedStringLiteral, + EmptyExportName, NakedFunctionIncompatibleAttribute, NullOnExport, NullOnObjcClass, + NullOnObjcSelector, ObjcClassExpectedStringLiteral, ObjcSelectorExpectedStringLiteral, }; use crate::target_checking::Policy::AllowSilent; @@ -133,6 +133,12 @@ fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option $DIR/invalid-export-name.rs:3:1 + | +LL | #[export_name = "\0foo"] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0648]: `export_name` may not contain null characters + --> $DIR/invalid-export-name.rs:7:1 + | +LL | #[export_name = "foo\0"] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0648]: `export_name` may not contain null characters + --> $DIR/invalid-export-name.rs:11:1 + | +LL | #[export_name = "\0"] + | ^^^^^^^^^^^^^^^^^^^^^ + +error: `export_name` may not be empty + --> $DIR/invalid-export-name.rs:15:1 + | +LL | #[export_name = ""] + | ^^^^^^^^^^^^^^^^^^^ + +error: `export_name` may not be empty + --> $DIR/invalid-export-name.rs:19:1 + | +LL | / #[export_name = "\ +LL | | "] + | |__^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0648`.