Fix broken span and related tests

This commit is contained in:
Alexis Bourget 2021-08-10 02:00:25 +02:00
parent 5cf96e70f4
commit 7bc8577d99
4 changed files with 17 additions and 7 deletions

View file

@ -1987,7 +1987,7 @@ impl<'a> Parser<'a> {
// There was no explicit visibility
if matches!(orig_vis.kind, VisibilityKind::Inherited) {
err.span_suggestion(
sp,
sp_start.to(self.prev_token.span),
&format!("visibility `{}` must come before `{}`", vs, snippet),
format!("{} {}", vs, snippet),
Applicability::MachineApplicable,