File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
compiler/rustc_hir_pretty/src Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -1687,7 +1687,11 @@ impl<'a> State<'a> {
16871687
16881688 let mut nonelided_generic_args: bool = false ;
16891689 let elide_lifetimes = generic_args. args . iter ( ) . all ( |arg| match arg {
1690- GenericArg :: Lifetime ( lt) => lt. is_elided ( ) ,
1690+ GenericArg :: Lifetime ( lt) if lt. is_elided ( ) => true ,
1691+ GenericArg :: Lifetime ( _) => {
1692+ nonelided_generic_args = true ;
1693+ false
1694+ }
16911695 _ => {
16921696 nonelided_generic_args = true ;
16931697 true
Original file line number Diff line number Diff line change 1+ #[prelude_import]
2+ use ::std::prelude::rust_2015::*;
3+ #[macro_use]
4+ extern crate std;
5+ // Test to print lifetimes on HIR pretty-printing.
6+
7+ // pretty-compare-only
8+ // pretty-mode:hir
9+ // pp-exact:issue-85089.pp
10+
11+ trait A<' x> { }
12+ trait B<' x> { }
13+
14+ struct Foo<' b> {
15+ bar: &' b dyn for <' a> A<' a>,
16+ }
17+
18+ impl <' a> B<' a> for dyn for <' b> A<' b> { }
19+
20+ impl <' a> A<' a> for Foo<' a> { }
Original file line number Diff line number Diff line change 1+ // Test to print lifetimes on HIR pretty-printing.
2+
3+ // pretty-compare-only
4+ // pretty-mode:hir
5+ // pp-exact:issue-85089.pp
6+
7+ trait A < ' x > { }
8+ trait B < ' x > { }
9+
10+ struct Foo < ' b > {
11+ pub bar : & ' b dyn for < ' a > A < ' a > ,
12+ }
13+
14+ impl < ' a > B < ' a > for dyn for < ' b > A < ' b > { }
15+
16+ impl < ' a > A < ' a > for Foo < ' a > { }
You can’t perform that action at this time.
0 commit comments