about summary refs log tree commit diff
path: root/tests/ui/polymorphization
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-04-25 05:04:32 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-04-25 05:04:32 +0000
commitff6fc757815055923e7f7ff73eaed8f9cbcfba75 (patch)
treebfd3766e077a0f447004b74063ad40ec02cd00e3 /tests/ui/polymorphization
parentbed7caf20638dde1822553d432f6fe213baf4eae (diff)
parentcb3752d20e0f5d24348062211102a08d46fbecff (diff)
downloadrust-ff6fc757815055923e7f7ff73eaed8f9cbcfba75.tar.gz
rust-ff6fc757815055923e7f7ff73eaed8f9cbcfba75.zip
Merge from rustc
Diffstat (limited to 'tests/ui/polymorphization')
-rw-r--r--tests/ui/polymorphization/coroutine.rs6
-rw-r--r--tests/ui/polymorphization/coroutine.stderr6
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/ui/polymorphization/coroutine.rs b/tests/ui/polymorphization/coroutine.rs
index a989947f787..22ceadfb194 100644
--- a/tests/ui/polymorphization/coroutine.rs
+++ b/tests/ui/polymorphization/coroutine.rs
@@ -32,6 +32,7 @@ where
 
 #[rustc_polymorphize_error]
 pub fn unused_type<T>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin {
+    #[coroutine]
     || {
         //~^ ERROR item has unused generic parameters
         yield 1;
@@ -41,6 +42,7 @@ pub fn unused_type<T>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin
 
 #[rustc_polymorphize_error]
 pub fn used_type_in_yield<Y: Default>() -> impl Coroutine<(), Yield = Y, Return = u32> + Unpin {
+    #[coroutine]
     || {
         yield Y::default();
         2
@@ -49,6 +51,7 @@ pub fn used_type_in_yield<Y: Default>() -> impl Coroutine<(), Yield = Y, Return
 
 #[rustc_polymorphize_error]
 pub fn used_type_in_return<R: Default>() -> impl Coroutine<(), Yield = u32, Return = R> + Unpin {
+    #[coroutine]
     || {
         yield 3;
         R::default()
@@ -57,6 +60,7 @@ pub fn used_type_in_return<R: Default>() -> impl Coroutine<(), Yield = u32, Retu
 
 #[rustc_polymorphize_error]
 pub fn unused_const<const T: u32>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin {
+    #[coroutine]
     || {
         //~^ ERROR item has unused generic parameters
         yield 1;
@@ -67,6 +71,7 @@ pub fn unused_const<const T: u32>() -> impl Coroutine<(), Yield = u32, Return =
 #[rustc_polymorphize_error]
 pub fn used_const_in_yield<const Y: u32>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin
 {
+    #[coroutine]
     || {
         yield Y;
         2
@@ -76,6 +81,7 @@ pub fn used_const_in_yield<const Y: u32>() -> impl Coroutine<(), Yield = u32, Re
 #[rustc_polymorphize_error]
 pub fn used_const_in_return<const R: u32>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin
 {
+    #[coroutine]
     || {
         yield 4;
         R
diff --git a/tests/ui/polymorphization/coroutine.stderr b/tests/ui/polymorphization/coroutine.stderr
index 67b55a59883..07e29184226 100644
--- a/tests/ui/polymorphization/coroutine.stderr
+++ b/tests/ui/polymorphization/coroutine.stderr
@@ -8,18 +8,20 @@ LL | #![feature(generic_const_exprs, coroutines, coroutine_trait, rustc_attrs)]
    = note: `#[warn(incomplete_features)]` on by default
 
 error: item has unused generic parameters
-  --> $DIR/coroutine.rs:35:5
+  --> $DIR/coroutine.rs:36:5
    |
 LL | pub fn unused_type<T>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin {
    |                    - generic parameter `T` is unused
+LL |     #[coroutine]
 LL |     || {
    |     ^^
 
 error: item has unused generic parameters
-  --> $DIR/coroutine.rs:60:5
+  --> $DIR/coroutine.rs:64:5
    |
 LL | pub fn unused_const<const T: u32>() -> impl Coroutine<(), Yield = u32, Return = u32> + Unpin {
    |                     ------------ generic parameter `T` is unused
+LL |     #[coroutine]
 LL |     || {
    |     ^^