summaryrefslogtreecommitdiffstats
path: root/src/test/ui/anon-params
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/anon-params
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/anon-params')
-rw-r--r--src/test/ui/anon-params/anon-params-denied-2018.rs32
-rw-r--r--src/test/ui/anon-params/anon-params-denied-2018.stderr142
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.fixed19
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.rs19
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.stderr34
-rw-r--r--src/test/ui/anon-params/anon-params-edition-hygiene.rs13
-rw-r--r--src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs12
7 files changed, 0 insertions, 271 deletions
diff --git a/src/test/ui/anon-params/anon-params-denied-2018.rs b/src/test/ui/anon-params/anon-params-denied-2018.rs
deleted file mode 100644
index 95533cf3d..000000000
--- a/src/test/ui/anon-params/anon-params-denied-2018.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Tests that anonymous parameters are a hard error in edition 2018.
-
-// edition:2018
-
-trait T {
- fn foo(i32); //~ expected one of `:`, `@`, or `|`, found `)`
-
- // Also checks with `&`
- fn foo_with_ref(&mut i32);
- //~^ ERROR expected one of `:`, `@`, or `|`, found `)`
-
- fn foo_with_qualified_path(<Bar as T>::Baz);
- //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
-
- fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
- //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
-
- fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
- //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
- //~| ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
-
- fn bar_with_default_impl(String, String) {}
- //~^ ERROR expected one of `:`
- //~| ERROR expected one of `:`
-
- // do not complain about missing `b`
- fn baz(a:usize, b, c: usize) -> usize { //~ ERROR expected one of `:`
- a + b + c
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/anon-params/anon-params-denied-2018.stderr b/src/test/ui/anon-params/anon-params-denied-2018.stderr
deleted file mode 100644
index bb60c898e..000000000
--- a/src/test/ui/anon-params/anon-params-denied-2018.stderr
+++ /dev/null
@@ -1,142 +0,0 @@
-error: expected one of `:`, `@`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:6:15
- |
-LL | fn foo(i32);
- | ^ expected one of `:`, `@`, or `|`
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a `self` type, give it a parameter name
- |
-LL | fn foo(self: i32);
- | +++++
-help: if this is a parameter name, give it a type
- |
-LL | fn foo(i32: TypeName);
- | ++++++++++
-help: if this is a type, explicitly ignore the parameter name
- |
-LL | fn foo(_: i32);
- | ++
-
-error: expected one of `:`, `@`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:9:29
- |
-LL | fn foo_with_ref(&mut i32);
- | ^ expected one of `:`, `@`, or `|`
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a `self` type, give it a parameter name
- |
-LL | fn foo_with_ref(self: &mut i32);
- | +++++
-help: if this is a parameter name, give it a type
- |
-LL | fn foo_with_ref(i32: &mut TypeName);
- | ~~~~~~~~~~~~~~~~~~
-help: if this is a type, explicitly ignore the parameter name
- |
-LL | fn foo_with_ref(_: &mut i32);
- | ++
-
-error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:12:47
- |
-LL | fn foo_with_qualified_path(<Bar as T>::Baz);
- | ^ expected one of 8 possible tokens
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: explicitly ignore the parameter name
- |
-LL | fn foo_with_qualified_path(_: <Bar as T>::Baz);
- | ~~~~~~~~~~~~~~~~~~
-
-error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:15:56
- |
-LL | fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
- | ^ expected one of 8 possible tokens
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: explicitly ignore the parameter name
- |
-LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
- | ~~~~~~~~~~~~~~~~~~~
-
-error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
- --> $DIR/anon-params-denied-2018.rs:18:57
- |
-LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
- | ^ expected one of 8 possible tokens
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: explicitly ignore the parameter name
- |
-LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
- | ~~~~~~~~~~~~~~~~~~
-
-error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:18:74
- |
-LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
- | ^ expected one of 8 possible tokens
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: explicitly ignore the parameter name
- |
-LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
- | ~~~~~~~~~~~~~~~~~~
-
-error: expected one of `:`, `@`, or `|`, found `,`
- --> $DIR/anon-params-denied-2018.rs:22:36
- |
-LL | fn bar_with_default_impl(String, String) {}
- | ^ expected one of `:`, `@`, or `|`
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a `self` type, give it a parameter name
- |
-LL | fn bar_with_default_impl(self: String, String) {}
- | +++++
-help: if this is a parameter name, give it a type
- |
-LL | fn bar_with_default_impl(String: TypeName, String) {}
- | ++++++++++
-help: if this is a type, explicitly ignore the parameter name
- |
-LL | fn bar_with_default_impl(_: String, String) {}
- | ++
-
-error: expected one of `:`, `@`, or `|`, found `)`
- --> $DIR/anon-params-denied-2018.rs:22:44
- |
-LL | fn bar_with_default_impl(String, String) {}
- | ^ expected one of `:`, `@`, or `|`
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a parameter name, give it a type
- |
-LL | fn bar_with_default_impl(String, String: TypeName) {}
- | ++++++++++
-help: if this is a type, explicitly ignore the parameter name
- |
-LL | fn bar_with_default_impl(String, _: String) {}
- | ++
-
-error: expected one of `:`, `@`, or `|`, found `,`
- --> $DIR/anon-params-denied-2018.rs:27:22
- |
-LL | fn baz(a:usize, b, c: usize) -> usize {
- | ^ expected one of `:`, `@`, or `|`
- |
- = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a parameter name, give it a type
- |
-LL | fn baz(a:usize, b: TypeName, c: usize) -> usize {
- | ++++++++++
-help: if this is a type, explicitly ignore the parameter name
- |
-LL | fn baz(a:usize, _: b, c: usize) -> usize {
- | ++
-
-error: aborting due to 9 previous errors
-
diff --git a/src/test/ui/anon-params/anon-params-deprecated.fixed b/src/test/ui/anon-params/anon-params-deprecated.fixed
deleted file mode 100644
index c09e20770..000000000
--- a/src/test/ui/anon-params/anon-params-deprecated.fixed
+++ /dev/null
@@ -1,19 +0,0 @@
-#![warn(anonymous_parameters)]
-// Test for the anonymous_parameters deprecation lint (RFC 1685)
-
-// check-pass
-// edition:2015
-// run-rustfix
-
-trait T {
- fn foo(_: i32); //~ WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
-
- fn bar_with_default_impl(_: String, _: String) {}
- //~^ WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
- //~| WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
-}
-
-fn main() {}
diff --git a/src/test/ui/anon-params/anon-params-deprecated.rs b/src/test/ui/anon-params/anon-params-deprecated.rs
deleted file mode 100644
index 6f7385da0..000000000
--- a/src/test/ui/anon-params/anon-params-deprecated.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![warn(anonymous_parameters)]
-// Test for the anonymous_parameters deprecation lint (RFC 1685)
-
-// check-pass
-// edition:2015
-// run-rustfix
-
-trait T {
- fn foo(i32); //~ WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
-
- fn bar_with_default_impl(String, String) {}
- //~^ WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
- //~| WARNING anonymous parameters are deprecated
- //~| WARNING this is accepted in the current edition
-}
-
-fn main() {}
diff --git a/src/test/ui/anon-params/anon-params-deprecated.stderr b/src/test/ui/anon-params/anon-params-deprecated.stderr
deleted file mode 100644
index 691e2c795..000000000
--- a/src/test/ui/anon-params/anon-params-deprecated.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-warning: anonymous parameters are deprecated and will be removed in the next edition
- --> $DIR/anon-params-deprecated.rs:9:12
- |
-LL | fn foo(i32);
- | ^^^ help: try naming the parameter or explicitly ignoring it: `_: i32`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
-note: the lint level is defined here
- --> $DIR/anon-params-deprecated.rs:1:9
- |
-LL | #![warn(anonymous_parameters)]
- | ^^^^^^^^^^^^^^^^^^^^
-
-warning: anonymous parameters are deprecated and will be removed in the next edition
- --> $DIR/anon-params-deprecated.rs:12:30
- |
-LL | fn bar_with_default_impl(String, String) {}
- | ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
-
-warning: anonymous parameters are deprecated and will be removed in the next edition
- --> $DIR/anon-params-deprecated.rs:12:38
- |
-LL | fn bar_with_default_impl(String, String) {}
- | ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
-
-warning: 3 warnings emitted
-
diff --git a/src/test/ui/anon-params/anon-params-edition-hygiene.rs b/src/test/ui/anon-params/anon-params-edition-hygiene.rs
deleted file mode 100644
index 6936205f8..000000000
--- a/src/test/ui/anon-params/anon-params-edition-hygiene.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// check-pass
-// edition:2018
-// aux-build:anon-params-edition-hygiene.rs
-
-// This warning is still surfaced
-#![allow(anonymous_parameters)]
-
-#[macro_use]
-extern crate anon_params_edition_hygiene;
-
-generate_trait_2015!(u8);
-
-fn main() {}
diff --git a/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs b/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs
deleted file mode 100644
index aa4221bec..000000000
--- a/src/test/ui/anon-params/auxiliary/anon-params-edition-hygiene.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// edition:2015
-
-#[macro_export]
-macro_rules! generate_trait_2015 {
- ($Type: ident) => {
- trait Trait {
- fn method($Type) {}
- }
- };
-}
-
-fn main() {}