Repository: rust
Issue: "Trait bounds were not satisfied" error when trait bound already specified.
Labels: T-compiler,C-bug,S-needs-repro

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->
I have generic trait implementation in my code and when I tried this code:

```rust
#[async_trait]
impl <'a, T,K, S> MyTrait<T,K> for S
  where T: sqlx::Row + sqlx::FromRow<'a, sqlx::mysql::MySqlRow> 
{
  async fn find_by_key(conn: &MySqlPool, key: &K) -> Result<Option<T>, Error> {
    let mut query_builder: QueryBuilder<MySql> = QueryBuilder::new(r#"..."#);
    query_builder.push("...");
    let mut query = query_builder.build_query_as::<T>(); // <--- this is where I suspect the error happnened first
    let mut rows: Vec<T> = query.fetch_all(conn).await?; // <--- This is where the red line appear below `fetch_all`
    
  }
}
```

I expected to see this happen: compiler compiled the code successfully

Instead, this happened: 
I got the error:
> the method fetch_all exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bound were not satisfied the following trait bounds were not satisfied:
T: FromRow<'r, MySqlRow>

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.69.0-nightly (e972bc808 2023-01-29)
binary: rustc
commit-hash: e972bc8083d5228536dfd42913c8778b6bb04c8e
commit-date: 2023-01-29
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary>Backtrace</summary>
<p>

```
error[E0599]: the method fetch_all exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:194:38
    |
194 |         let mut rows: Vec<T> = query.fetch_all(conn).await?;
    |                                      ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

error[E0599]: the method fetch_all exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:226:38
    |
226 |         let mut rows: Vec<T> = query.fetch_all(conn).await?;
    |                                      ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

error[E0599]: the method fetch_all exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:263:38
    |
263 |         let mut rows: Vec<T> = query.fetch_all(conn).await?;
    |                                      ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

error[E0599]: the method fetch_all exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:424:38
    |
424 |         let mut rows: Vec<T> = query.fetch_all(conn).await?;
    |                                      ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

error[E0599]: the method fetch_one exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:453:31
    |
453 |         let target: T = query.fetch_one(conn).await?;
    |                               ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

error[E0599]: the method fetch_one exists for struct QueryAs<'_, MySql, T, MySqlArguments>, but its trait bounds were not satisfied
   --> src/db/common.rs:480:35
    |
480 |         let new_target: T = query.fetch_one(conn).await?;
    |                                   ^^^^^^^^^ method cannot be called on QueryAs<'_, MySql, T, MySqlArguments> due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            T: FromRow<'r, MySqlRow>

For more information about this error, try rustc --explain E0599.
```

</p>
</details>