-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
TaKO8Ki and yoeunes
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.