-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Closed
Copy link
Labels
C-featureCategory: feature requestCategory: feature request
Description
This PR made jumping into the proper definition of a from method when from the into() which made things much much easier.
I'm working in a project where I'm using a lot of #[Instrument]
attributes in most my functions to have it working with opentelemetry/application insights.
There I noticed that if the method has a macro attribute it won't find the proper From declaration, I'm not sure if this would be an easy fix but I'm just raising this, raising it as a feature as I'm not sure if it can be considered a bug or not.
Here's an code example:
pub struct Test {
pub test: String,
}
impl From<String> for Test {
fn from(value: String) -> Self {
Self {
test: value.clone(),
}
}
}
#[tokio::main]
async fn main() {
//Any function that has an atribute macro won't find the From on the .into(), this one goes to the Std definition o Into
let test: Test = "test".to_string().into();
}
fn test() {
//This goes to the from on this file properly
let test: Test = "test".to_string().into();
}
async fn test_async() {
//This goes to the from on this file properly
let test: Test = "test".to_string().into();
}
Metadata
Metadata
Assignees
Labels
C-featureCategory: feature requestCategory: feature request