about summary refs log tree commit diff
path: root/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-28 07:25:28 +0000
committerbors <bors@rust-lang.org>2024-06-28 07:25:28 +0000
commit99f77a2eda555b50b518f74823ab636a20efb87f (patch)
tree8dd11cc66cae04d768306ccb8e6c7e625e25104d /tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
parent42add88d2275b95c98e512ab680436ede691e853 (diff)
parent89a0cfe72afe047c699df3810e1ce5e4d9cb98b4 (diff)
downloadrust-99f77a2eda555b50b518f74823ab636a20efb87f.tar.gz
rust-99f77a2eda555b50b518f74823ab636a20efb87f.zip
Auto merge of #127076 - matthiaskrgr:rollup-l01gm36, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #124741 (patchable-function-entry: Add unstable compiler flag and attribute)
 - #126470 (make cargo submodule optional)
 - #126956 (core: avoid `extern type`s in formatting infrastructure)
 - #126970 (Simplify `str::clone_into`)
 - #127022 (Support fetching `Attribute` of items.)
 - #127058 (Tighten `fn_decl_span` for async blocks)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs')
-rw-r--r--tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
new file mode 100644
index 00000000000..1e376c9ff3c
--- /dev/null
+++ b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
@@ -0,0 +1,17 @@
+#![feature(patchable_function_entry)]
+fn main() {}
+
+#[patchable_function_entry(prefix_nops = 256, entry_nops = 0)]//~error: integer value out of range
+pub fn too_high_pnops() {}
+
+#[patchable_function_entry(prefix_nops = "stringvalue", entry_nops = 0)]//~error: invalid literal value
+pub fn non_int_nop() {}
+
+#[patchable_function_entry]//~error: malformed `patchable_function_entry` attribute input
+pub fn malformed_attribute() {}
+
+#[patchable_function_entry(prefix_nops = 10, something = 0)]//~error: unexpected parameter name
+pub fn unexpected_parameter_name() {}
+
+#[patchable_function_entry()]//~error: must specify at least one parameter
+pub fn no_parameters_given() {}