diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/entry-point | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/entry-point')
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/entry-point/auxiliary/bad_main_functions.rs b/tests/ui/entry-point/auxiliary/bad_main_functions.rs new file mode 100644 index 000000000..4649be99e --- /dev/null +++ b/tests/ui/entry-point/auxiliary/bad_main_functions.rs @@ -0,0 +1,2 @@ +pub fn boilerplate(x: u8) {} +//~^ ERROR: `main` function has wrong type [E0580] diff --git a/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs new file mode 100644 index 000000000..0a115dd3b --- /dev/null +++ b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs @@ -0,0 +1,6 @@ +// aux-build:bad_main_functions.rs + +#![feature(imported_main)] + +extern crate bad_main_functions; +pub use bad_main_functions::boilerplate as main; diff --git a/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.stderr b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.stderr new file mode 100644 index 000000000..3c6893310 --- /dev/null +++ b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.stderr @@ -0,0 +1,12 @@ +error[E0580]: `main` function has wrong type + --> $DIR/auxiliary/bad_main_functions.rs:1:1 + | +LL | pub fn boilerplate(x: u8) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected signature `fn()` + found signature `fn(u8)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0580`. |