Fix up tests and typos

This commit is contained in:
Seiichi Uchida 2018-02-14 22:30:15 +09:00
parent b5099a708d
commit 291c51b9c8
4 changed files with 12 additions and 10 deletions

View File

@ -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));

View File

@ -664,7 +664,7 @@ pub fn integer_lit(s: &str, suffix: Option<Symbol>, 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)})));
}

View File

@ -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.

View File

@ -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