mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 05:14:27 +00:00
commit
e1d7b8ea01
@ -342,6 +342,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
|
||||
pub fn visit_trait_item(&mut self, ti: &ast::TraitItem) {
|
||||
if self.visit_attrs(&ti.attrs) {
|
||||
self.push_rewrite(ti.span, None);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -385,6 +386,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
|
||||
pub fn visit_impl_item(&mut self, ii: &ast::ImplItem) {
|
||||
if self.visit_attrs(&ii.attrs) {
|
||||
self.push_rewrite(ii.span, None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
18
tests/source/skip.rs
Normal file
18
tests/source/skip.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// Test the skip attribute works
|
||||
|
||||
#[rustfmt_skip]
|
||||
fn foo() { badly; formatted; stuff
|
||||
; }
|
||||
|
||||
#[rustfmt_skip]
|
||||
trait Foo
|
||||
{
|
||||
fn foo(
|
||||
);
|
||||
}
|
||||
|
||||
impl LateLintPass for UsedUnderscoreBinding {
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
fn check_expr() { // comment
|
||||
}
|
||||
}
|
@ -10,3 +10,9 @@ trait Foo
|
||||
fn foo(
|
||||
);
|
||||
}
|
||||
|
||||
impl LateLintPass for UsedUnderscoreBinding {
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
fn check_expr() { // comment
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user