Closed
Description
Hi there!
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a4dec9e7f93eb65805bcd2d986ba009e
extern crate async_trait;
extern crate reqwest;
use async_trait::async_trait;
use reqwest::{Client, IntoUrl};
#[async_trait]
pub trait ClientExt {
async fn publish<T: IntoUrl>(&self, url: T) -> String;
}
#[async_trait]
impl ClientExt for Client {
async fn publish<T: IntoUrl>(&self, url: T) -> String {
"Foo".to_string()
}
}
The current output is:
help: consider further restricting this bound
|
14 | async fn publish<T + std::marker::Send: IntoUrl>(&self, url: T) -> String {
| +++++++++++++++++++
Ideally the output should look like:
help: consider further restricting this bound
|
14 | async fn publish<T: IntoUrl + std::marker::Send>(&self, url: T) -> String {
| +++++++++++++++++++
The generated code is invalid, the restricting must be placed after the trait name.
Activity
Tag the inserted lifetime bounds with the span of the other bounds
Tag the inserted lifetime bounds with the span of the other bounds
compiler-errors commentedon Jun 20, 2022
This was fixed in #93803