We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5025a53 commit 078fbb0Copy full SHA for 078fbb0
src/types.rs
@@ -616,7 +616,15 @@ impl Rewrite for ast::TraitRef {
616
impl Rewrite for ast::Ty {
617
fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
618
match self.node {
619
- ast::TyKind::TraitObject(ref bounds, ..) => bounds.rewrite(context, shape),
+ ast::TyKind::TraitObject(ref bounds, tobj_syntax) => {
620
+ let res = bounds.rewrite(context, shape)?;
621
+ // we have to consider 'dyn' keyword is used or not!!!
622
+ if tobj_syntax == ast::TraitObjectSyntax::Dyn {
623
+ Some(format!("dyn {}", res))
624
+ } else {
625
+ Some(res)
626
+ }
627
628
ast::TyKind::Ptr(ref mt) => {
629
let prefix = match mt.mutbl {
630
Mutability::Mutable => "*mut ",
0 commit comments