Fix pretty printer when there are multiple lifetime parameters
This commit is contained in:
@@ -1572,17 +1572,24 @@ fn print_path_(s: @ps,
|
|||||||
}
|
}
|
||||||
word(s.s, "<");
|
word(s.s, "<");
|
||||||
|
|
||||||
|
let mut comma = false;
|
||||||
for lifetime in segment.lifetimes.iter() {
|
for lifetime in segment.lifetimes.iter() {
|
||||||
print_lifetime(s, lifetime);
|
if comma {
|
||||||
if !segment.types.is_empty() {
|
|
||||||
word_space(s, ",")
|
word_space(s, ",")
|
||||||
}
|
}
|
||||||
|
print_lifetime(s, lifetime);
|
||||||
|
comma = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !segment.types.is_empty() {
|
||||||
|
if comma {
|
||||||
|
word_space(s, ",")
|
||||||
|
}
|
||||||
commasep(s,
|
commasep(s,
|
||||||
inconsistent,
|
inconsistent,
|
||||||
segment.types.map_to_vec(|t| (*t).clone()),
|
segment.types.map_to_vec(|t| (*t).clone()),
|
||||||
print_type);
|
print_type);
|
||||||
|
}
|
||||||
|
|
||||||
word(s.s, ">")
|
word(s.s, ">")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ fn use_<'short,'long>(c: Invariant<'long>,
|
|||||||
// 'short <= 'long, this would be true if the Invariant type were
|
// 'short <= 'long, this would be true if the Invariant type were
|
||||||
// contravariant with respect to its parameter 'a.
|
// contravariant with respect to its parameter 'a.
|
||||||
|
|
||||||
let _: Invariant<'short> = c; //~ ERROR lifetime mistach
|
let _: Invariant<'short> = c; //~ ERROR mismatched types
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|||||||
Reference in New Issue
Block a user