summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-return_type_notation.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/ui/feature-gates/feature-gate-return_type_notation.rs
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-return_type_notation.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.rs b/tests/ui/feature-gates/feature-gate-return_type_notation.rs
new file mode 100644
index 000000000..5028b9ec9
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.rs
@@ -0,0 +1,22 @@
+// edition: 2021
+// revisions: cfg no
+
+//[no] check-pass
+// Since we're not adding new syntax, `cfg`'d out RTN must pass.
+
+#![feature(async_fn_in_trait)]
+//~^ WARN the feature `async_fn_in_trait` is incomplete
+
+trait Trait {
+ async fn m();
+}
+
+#[cfg(cfg)]
+fn foo<T: Trait<m(): Send>>() {}
+//[cfg]~^ ERROR return type notation is experimental
+//[cfg]~| ERROR parenthesized generic arguments cannot be used in associated type constraints
+//[cfg]~| ERROR associated type `m` not found for `Trait`
+//[no]~^^^^ WARN return type notation is experimental
+//[no]~| WARN unstable syntax can change at any point in the future, causing a hard error!
+
+fn main() {}