Fix up tests and typos
This commit is contained in:
parent
b5099a708d
commit
291c51b9c8
4 changed files with 12 additions and 10 deletions
|
@ -97,7 +97,11 @@ impl<'a> Folder for ExpandAllocatorDirectives<'a> {
|
||||||
]);
|
]);
|
||||||
let mut items = vec![
|
let mut items = vec![
|
||||||
f.cx.item_extern_crate(f.span, f.alloc),
|
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 {
|
for method in ALLOCATOR_METHODS {
|
||||||
items.push(f.allocator_fn(method));
|
items.push(f.allocator_fn(method));
|
||||||
|
|
|
@ -664,7 +664,7 @@ pub fn integer_lit(s: &str, suffix: Option<Symbol>, diag: Option<(Span, &Handler
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use syntax_pos::{self, Span, BytePos, Pos, NO_EXPANSION};
|
use syntax_pos::{self, Span, BytePos, Pos, NO_EXPANSION};
|
||||||
use codemap::Spanned;
|
use codemap::{respan, Spanned};
|
||||||
use ast::{self, Ident, PatKind};
|
use ast::{self, Ident, PatKind};
|
||||||
use abi::Abi;
|
use abi::Abi;
|
||||||
use attr::first_attr_value_str_by_name;
|
use attr::first_attr_value_str_by_name;
|
||||||
|
@ -932,7 +932,7 @@ mod tests {
|
||||||
span: sp(15,21),
|
span: sp(15,21),
|
||||||
recovered: false,
|
recovered: false,
|
||||||
})),
|
})),
|
||||||
vis: codemap::respan(sp(0, 0), ast::VisibilityKind::Inherited),
|
vis: respan(sp(0, 0), ast::VisibilityKind::Inherited),
|
||||||
span: sp(0,21)})));
|
span: sp(0,21)})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ impl Span {
|
||||||
/// Returns a new span representing an empty span at the beginning of this span
|
/// Returns a new span representing an empty span at the beginning of this span
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn empty(self) -> Span {
|
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.
|
/// Returns `self` if `self` is not the dummy span, and `other` otherwise.
|
||||||
|
|
|
@ -2,23 +2,21 @@ error[E0449]: unnecessary visibility qualifier
|
||||||
--> $DIR/E0449.rs:17:1
|
--> $DIR/E0449.rs:17:1
|
||||||
|
|
|
|
||||||
17 | pub impl Bar {} //~ ERROR E0449
|
17 | pub impl Bar {} //~ ERROR E0449
|
||||||
| ^^^^^^^^^^^^^^^ `pub` not needed here
|
| ^^^ `pub` not needed here
|
||||||
|
|
|
|
||||||
= note: place qualifiers on individual impl items instead
|
= note: place qualifiers on individual impl items instead
|
||||||
|
|
||||||
error[E0449]: unnecessary visibility qualifier
|
error[E0449]: unnecessary visibility qualifier
|
||||||
--> $DIR/E0449.rs:19:1
|
--> $DIR/E0449.rs:19:1
|
||||||
|
|
|
|
||||||
19 | / pub impl Foo for Bar { //~ ERROR E0449
|
19 | pub impl Foo for Bar { //~ ERROR E0449
|
||||||
20 | | pub fn foo() {} //~ ERROR E0449
|
| ^^^ `pub` not needed here
|
||||||
21 | | }
|
|
||||||
| |_^ `pub` not needed here
|
|
||||||
|
|
||||||
error[E0449]: unnecessary visibility qualifier
|
error[E0449]: unnecessary visibility qualifier
|
||||||
--> $DIR/E0449.rs:20:5
|
--> $DIR/E0449.rs:20:5
|
||||||
|
|
|
|
||||||
20 | pub fn foo() {} //~ ERROR E0449
|
20 | pub fn foo() {} //~ ERROR E0449
|
||||||
| ^^^^^^^^^^^^^^^ `pub` not needed here
|
| ^^^ `pub` not needed here
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue