mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
Fix span bug when searching for the closing paren
This commit is contained in:
parent
008aa88d6e
commit
57a6cae49f
11
src/items.rs
11
src/items.rs
@ -1330,13 +1330,10 @@ fn format_tuple_struct(
|
||||
} else {
|
||||
// This is a dirty hack to work around a missing `)` from the span of the last field.
|
||||
let last_arg_span = fields[fields.len() - 1].span;
|
||||
if context.snippet(last_arg_span).ends_with(')') {
|
||||
last_arg_span.hi()
|
||||
} else {
|
||||
context
|
||||
.snippet_provider
|
||||
.span_after(mk_sp(last_arg_span.hi(), span.hi()), ")")
|
||||
}
|
||||
context
|
||||
.snippet_provider
|
||||
.opt_span_after(mk_sp(last_arg_span.hi(), span.hi()), ")")
|
||||
.unwrap_or(last_arg_span.hi())
|
||||
};
|
||||
|
||||
let where_clause_str = match struct_parts.generics {
|
||||
|
Loading…
Reference in New Issue
Block a user