Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run doctest does not work in impl trait blocks #4449

Closed
fehrnah opened this issue May 13, 2020 · 3 comments · Fixed by #4491
Closed

Run doctest does not work in impl trait blocks #4449

fehrnah opened this issue May 13, 2020 · 3 comments · Fixed by #4491
Labels

Comments

@fehrnah
Copy link

fehrnah commented May 13, 2020

On VScode, the Run doctest does not work if the doctest is in a trait impl block.

Cargo test is called on Struct::function instead of Struct::Trait::function

@matklad
Copy link
Member

matklad commented May 13, 2020

cc @bnjjj

@bnjjj
Copy link
Contributor

bnjjj commented May 13, 2020

Ok will fix it this weekend. @fehrnah can you provide a minimal example to help me reproduce ?

@Woyten
Copy link

Woyten commented May 13, 2020

In fact, any documented function that is not a module-level function can't work. The fix seems straight-forward but I believe that there are some tricky cases like generics and impls of the same trait for different structs in the same module.

bnjjj added a commit to bnjjj/rust-analyzer that referenced this issue May 16, 2020
bnjjj added a commit to bnjjj/rust-analyzer that referenced this issue May 17, 2020
bnjjj added a commit to bnjjj/rust-analyzer that referenced this issue May 17, 2020
@bors bors bot closed this as completed in 131849f May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants