Simple fix for make::impl_trait by alibektas · Pull Request #14621 · rust-lang/r...
source link: https://github.com/rust-lang/rust-analyzer/pull/14621
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Contributor
added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label
The PR itself is still an improvement overall though, so let's merge it for now
@@ -184,8 +184,11 @@ pub fn impl_trait( | ||
ty: ast::Path, |
||
ty_params: Option<ast::GenericParamList>, |
||
) -> ast::Impl { |
||
let ty_params = ty_params.map_or_else(String::new, |params| params.to_string()); |
||
ast_from_text(&format!("impl{ty_params} {trait_} for {ty}{ty_params} {{}}")) |
||
// TODO : If this function is now correct we can also change `impl_` accordingly` |
impl_
as the comment states should take ty_args: Option<ast::GenericArgList>
, not ty_params: Option<ast::GenericParamList>
. Likewise it would be better if we change impl_trait
to the following signature:
pub fn impl_trait(
trait_: ast::Path,
ty: ast::Path,
ty_params: Option<ast::GenericParamList>,
ty_args: Option<ast::GenericArgList>,
) -> ast::Impl {
Member
@bors r+ |
Collaborator
Test successful - checks-actions |
Member
changelog internal (first contribution) support type parameters in |
Contributor
Author
After giving some thought I think I will fully implement the |
Member
This PR was already merged so you can't reuse (you can reuse the branch and open a new PR from it if you mean that) |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK