about summary refs log tree commit diff
path: root/tests/ui/codegen/no-mangle-on-internal-lang-items.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/codegen/no-mangle-on-internal-lang-items.rs')
-rw-r--r--tests/ui/codegen/no-mangle-on-internal-lang-items.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/codegen/no-mangle-on-internal-lang-items.rs b/tests/ui/codegen/no-mangle-on-internal-lang-items.rs
new file mode 100644
index 00000000000..37766936410
--- /dev/null
+++ b/tests/ui/codegen/no-mangle-on-internal-lang-items.rs
@@ -0,0 +1,14 @@
+// Issue a error when the user uses #[no_mangle] on internal language items
+//@ edition:2024
+
+#![feature(rustc_attrs)]
+
+#[rustc_std_internal_symbol]
+#[unsafe(no_mangle)] //~ERROR `#[no_mangle]` cannot be used on internal language items
+fn internal_lang_function () {
+
+}
+
+fn main() {
+
+}