Use chaining in DiagnosticBuilder
construction.
To avoid the use of a mutable local variable, and because it reads more nicely.
This commit is contained in:
parent
b1b9278851
commit
589591efde
22 changed files with 223 additions and 369 deletions
|
@ -249,9 +249,9 @@ impl<'a> StringReader<'a> {
|
|||
let lifetime_name = self.str_from(start);
|
||||
if starts_with_number {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
let mut diag = self.dcx().struct_err("lifetimes cannot start with a number");
|
||||
diag.span(span);
|
||||
diag.stash(span, StashKey::LifetimeIsChar);
|
||||
self.dcx().struct_err("lifetimes cannot start with a number")
|
||||
.span_mv(span)
|
||||
.stash(span, StashKey::LifetimeIsChar);
|
||||
}
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue