about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-06-09 17:45:25 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-06-25 16:52:31 +0000
commitf1fb323dda177b0e39ef1c9dcdfc1190e7c107ee (patch)
treed5c6f3a891bb69154da0707c723523e8cd8b198c
parent2801f9aaf9b7580d9b230b532b0700709857cc88 (diff)
downloadrust-f1fb323dda177b0e39ef1c9dcdfc1190e7c107ee.tar.gz
rust-f1fb323dda177b0e39ef1c9dcdfc1190e7c107ee.zip
Do not use `gen` as binding name
If we ever start testing every edition, using a new keyword unnecessarily will cause divergent output, so pre-emptively change `gen` into `generator`.
-rw-r--r--tests/ui/coroutine/auto-trait-regions.rs12
-rw-r--r--tests/ui/coroutine/auto-trait-regions.stderr8
-rw-r--r--tests/ui/coroutine/clone-impl-static.rs6
-rw-r--r--tests/ui/coroutine/clone-impl-static.stderr8
4 files changed, 17 insertions, 17 deletions
diff --git a/tests/ui/coroutine/auto-trait-regions.rs b/tests/ui/coroutine/auto-trait-regions.rs
index f115896a473..736555b31bb 100644
--- a/tests/ui/coroutine/auto-trait-regions.rs
+++ b/tests/ui/coroutine/auto-trait-regions.rs
@@ -23,31 +23,31 @@ fn assert_foo<T: Foo>(f: T) {}
 fn main() {
     // Make sure 'static is erased for coroutine interiors so we can't match it in trait selection
     let x: &'static _ = &OnlyFooIfStaticRef(No);
-    let gen = #[coroutine] move || {
+    let generator = #[coroutine] move || {
         let x = x;
         yield;
         assert_foo(x);
     };
-    assert_foo(gen);
+    assert_foo(generator);
     //~^ ERROR implementation of `Foo` is not general enough
 
     // Allow impls which matches any lifetime
     let x = &OnlyFooIfRef(No);
-    let gen = #[coroutine] move || {
+    let generator = #[coroutine] move || {
         let x = x;
         yield;
         assert_foo(x);
     };
-    assert_foo(gen); // ok
+    assert_foo(generator); // ok
 
     // Disallow impls which relates lifetimes in the coroutine interior
-    let gen = #[coroutine] move || {
+    let generator = #[coroutine] move || {
         let a = A(&mut true, &mut true, No);
         //~^ ERROR borrow may still be in use when coroutine yields
         //~| ERROR borrow may still be in use when coroutine yields
         yield;
         assert_foo(a);
     };
-    assert_foo(gen);
+    assert_foo(generator);
     //~^ ERROR not general enough
 }
diff --git a/tests/ui/coroutine/auto-trait-regions.stderr b/tests/ui/coroutine/auto-trait-regions.stderr
index 77b5f3ce57c..7a5949de55b 100644
--- a/tests/ui/coroutine/auto-trait-regions.stderr
+++ b/tests/ui/coroutine/auto-trait-regions.stderr
@@ -33,8 +33,8 @@ LL |     let gen = #[coroutine] static move || {
 error: implementation of `Foo` is not general enough
   --> $DIR/auto-trait-regions.rs:31:5
    |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+LL |     assert_foo(generator);
+   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
    |
    = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
    = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
@@ -42,8 +42,8 @@ LL |     assert_foo(gen);
 error: implementation of `Foo` is not general enough
   --> $DIR/auto-trait-regions.rs:51:5
    |
-LL |     assert_foo(gen);
-   |     ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+LL |     assert_foo(generator);
+   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
    |
    = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
    = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
diff --git a/tests/ui/coroutine/clone-impl-static.rs b/tests/ui/coroutine/clone-impl-static.rs
index f6fadff7faf..2f941d65591 100644
--- a/tests/ui/coroutine/clone-impl-static.rs
+++ b/tests/ui/coroutine/clone-impl-static.rs
@@ -7,13 +7,13 @@
 #![feature(coroutines, coroutine_clone, stmt_expr_attributes)]
 
 fn main() {
-    let gen = #[coroutine]
+    let generator = #[coroutine]
     static move || {
         yield;
     };
-    check_copy(&gen);
+    check_copy(&generator);
     //~^ ERROR Copy` is not satisfied
-    check_clone(&gen);
+    check_clone(&generator);
     //~^ ERROR Clone` is not satisfied
 }
 
diff --git a/tests/ui/coroutine/clone-impl-static.stderr b/tests/ui/coroutine/clone-impl-static.stderr
index db1d2770346..9fb71fd5fd0 100644
--- a/tests/ui/coroutine/clone-impl-static.stderr
+++ b/tests/ui/coroutine/clone-impl-static.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Copy` is not satisfied
   --> $DIR/clone-impl-static.rs:14:16
    |
-LL |     check_copy(&gen);
-   |     ---------- ^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
+LL |     check_copy(&generator);
+   |     ---------- ^^^^^^^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
    |     |
    |     required by a bound introduced by this call
    |
@@ -15,8 +15,8 @@ LL | fn check_copy<T: Copy>(_x: &T) {}
 error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Clone` is not satisfied
   --> $DIR/clone-impl-static.rs:16:17
    |
-LL |     check_clone(&gen);
-   |     ----------- ^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
+LL |     check_clone(&generator);
+   |     ----------- ^^^^^^^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
    |     |
    |     required by a bound introduced by this call
    |