-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Improve print_type.
#144625
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
Improve print_type.
#144625
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,11 +42,16 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> { | |
| | ty::UnsafeBinder(_) => self.pretty_print_type(ty), | ||
|
|
||
| // Placeholders (all printed as `_` to uniformize them). | ||
| ty::Param(_) | ty::Bound(..) | ty::Placeholder(_) | ty::Infer(_) | ty::Error(_) => { | ||
| ty::Bound(..) | ty::Placeholder(_) | ty::Infer(_) | ty::Error(_) => { | ||
| write!(self, "_")?; | ||
| Ok(()) | ||
| } | ||
|
|
||
| ty::Param(param_ty) => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment here? All the other sections in this match have a nice comment. |
||
| write!(self, "{}", param_ty.name)?; | ||
| Ok(()) | ||
| } | ||
|
|
||
| // Types with identity (print the module path). | ||
| ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), args) | ||
| | ty::FnDef(def_id, args) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,5 @@ impl<M> Bar<M> { | |
| } | ||
|
|
||
| fn main() { | ||
| assert_eq!(Bar(()).foo(), "issue_61894::Bar<_>::foo::f"); | ||
| assert_eq!(Bar(()).foo(), "issue_61894::Bar<M>::foo::f"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is confusing about this is that there is no
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, iirc printing |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does sound like the
_was deliberate -- but I don't have a strong opinion either way.