From 291c51b9c8abe254216da4e954c5f6696a52da8f Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Wed, 14 Feb 2018 22:30:15 +0900 Subject: [PATCH] Fix up tests and typos --- src/librustc_allocator/expand.rs | 6 +++++- src/libsyntax/parse/mod.rs | 4 ++-- src/libsyntax_pos/lib.rs | 2 +- src/test/ui/error-codes/E0449.stderr | 10 ++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/librustc_allocator/expand.rs b/src/librustc_allocator/expand.rs index 26a7f50b9979..c088458c3557 100644 --- a/src/librustc_allocator/expand.rs +++ b/src/librustc_allocator/expand.rs @@ -97,7 +97,11 @@ impl<'a> Folder for ExpandAllocatorDirectives<'a> { ]); let mut items = vec![ f.cx.item_extern_crate(f.span, f.alloc), - f.cx.item_use_simple(f.span, respan(f.span.empty(), VisibilityKind::Inherited), super_path), + f.cx.item_use_simple( + f.span, + respan(f.span.empty(), VisibilityKind::Inherited), + super_path, + ), ]; for method in ALLOCATOR_METHODS { items.push(f.allocator_fn(method)); diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index d2ae9904143d..06eb64e157cd 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -664,7 +664,7 @@ pub fn integer_lit(s: &str, suffix: Option, diag: Option<(Span, &Handler mod tests { use super::*; use syntax_pos::{self, Span, BytePos, Pos, NO_EXPANSION}; - use codemap::Spanned; + use codemap::{respan, Spanned}; use ast::{self, Ident, PatKind}; use abi::Abi; use attr::first_attr_value_str_by_name; @@ -932,7 +932,7 @@ mod tests { span: sp(15,21), recovered: false, })), - vis: codemap::respan(sp(0, 0), ast::VisibilityKind::Inherited), + vis: respan(sp(0, 0), ast::VisibilityKind::Inherited), span: sp(0,21)}))); } diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index f9e01b630aeb..0f6dbc39e217 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -219,7 +219,7 @@ impl Span { /// Returns a new span representing an empty span at the beginning of this span #[inline] pub fn empty(self) -> Span { - span.with_hi(self.lo()) + self.with_hi(self.lo()) } /// Returns `self` if `self` is not the dummy span, and `other` otherwise. diff --git a/src/test/ui/error-codes/E0449.stderr b/src/test/ui/error-codes/E0449.stderr index 2270167303a8..3587319ed0cb 100644 --- a/src/test/ui/error-codes/E0449.stderr +++ b/src/test/ui/error-codes/E0449.stderr @@ -2,23 +2,21 @@ error[E0449]: unnecessary visibility qualifier --> $DIR/E0449.rs:17:1 | 17 | pub impl Bar {} //~ ERROR E0449 - | ^^^^^^^^^^^^^^^ `pub` not needed here + | ^^^ `pub` not needed here | = note: place qualifiers on individual impl items instead error[E0449]: unnecessary visibility qualifier --> $DIR/E0449.rs:19:1 | -19 | / pub impl Foo for Bar { //~ ERROR E0449 -20 | | pub fn foo() {} //~ ERROR E0449 -21 | | } - | |_^ `pub` not needed here +19 | pub impl Foo for Bar { //~ ERROR E0449 + | ^^^ `pub` not needed here error[E0449]: unnecessary visibility qualifier --> $DIR/E0449.rs:20:5 | 20 | pub fn foo() {} //~ ERROR E0449 - | ^^^^^^^^^^^^^^^ `pub` not needed here + | ^^^ `pub` not needed here error: aborting due to 3 previous errors