report the varargs_without_pattern lint in deps

This commit is contained in:
Folkert de Vries
2026-03-30 18:14:01 +02:00
parent 14196dbfa3
commit 7c4cf96587
4 changed files with 150 additions and 4 deletions
+5 -4
View File
@@ -5558,7 +5558,8 @@
///
/// ### Example
///
/// ```rust
#[cfg_attr(bootstrap, doc = "```rust")]
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
/// // Using `...` in non-foreign function definitions is unstable, however stability is
/// // currently only checked after attributes are expanded, so using `#[cfg(false)]` here will
/// // allow this to compile on stable Rust.
@@ -5566,7 +5567,7 @@
/// fn foo(...) {
///
/// }
/// ```
#[doc = "```"]
///
/// {{produces}}
///
@@ -5590,10 +5591,10 @@
///
/// [future-incompatible]: ../index.md#future-incompatible-lints
pub VARARGS_WITHOUT_PATTERN,
Warn,
Deny,
"detects usage of `...` arguments without a pattern in non-foreign items",
@future_incompatible = FutureIncompatibleInfo {
reason: fcw!(FutureReleaseError #145544),
report_in_deps: false,
report_in_deps: true,
};
}
@@ -44,3 +44,60 @@ LL | unsafe extern "C" fn f(_: ...) {}
error: aborting due to 3 previous errors
Future incompatibility report: Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:11:28
|
LL | unsafe extern "C" fn f(...) {
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {
| ++
Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:14:32
|
LL | unsafe extern "C" fn f(...) {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {}
| ++
Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:20:32
|
LL | unsafe extern "C" fn f(...) {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {}
| ++
@@ -57,3 +57,79 @@ LL | unsafe extern "C" fn f(_: ...) {}
error: aborting due to 4 previous errors
Future incompatibility report: Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:11:28
|
LL | unsafe extern "C" fn f(...) {
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {
| ++
Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:14:32
|
LL | unsafe extern "C" fn f(...) {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {}
| ++
Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:20:32
|
LL | unsafe extern "C" fn f(...) {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {}
| ++
Future breakage diagnostic:
error: missing pattern for `...` argument
--> $DIR/parse-errors.rs:26:32
|
LL | unsafe extern "C" fn f(...) {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #145544 <https://github.com/rust-lang/rust/issues/145544>
note: the lint level is defined here
--> $DIR/parse-errors.rs:7:9
|
LL | #![deny(varargs_without_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn f(_: ...) {}
| ++
+12
View File
@@ -0,0 +1,12 @@
Future incompatibility report: Future breakage diagnostic:
warning: missing pattern for `...` argument
--> $DIR/c-variadic.rs:7:34
|
LL | unsafe extern "C" fn foo(_: i32, ...) {}
| ^^^
|
help: name the argument, or use `_` to continue ignoring it
|
LL | unsafe extern "C" fn foo(_: i32, _: ...) {}
| ++