ast: Revert a breaking attribute visiting order change
This commit is contained in:
parent
3c4066d112
commit
6e67eaa311
7 changed files with 53 additions and 69 deletions
|
@ -852,10 +852,10 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(
|
||||||
ctxt: AssocCtxt,
|
ctxt: AssocCtxt,
|
||||||
) -> V::Result {
|
) -> V::Result {
|
||||||
let &Item { id: _, span: _, ident, ref vis, ref attrs, ref kind, tokens: _ } = item;
|
let &Item { id: _, span: _, ident, ref vis, ref attrs, ref kind, tokens: _ } = item;
|
||||||
walk_list!(visitor, visit_attribute, attrs);
|
|
||||||
try_visit!(visitor.visit_vis(vis));
|
try_visit!(visitor.visit_vis(vis));
|
||||||
try_visit!(visitor.visit_ident(ident));
|
try_visit!(visitor.visit_ident(ident));
|
||||||
try_visit!(kind.walk(item, ctxt, visitor));
|
try_visit!(kind.walk(item, ctxt, visitor));
|
||||||
|
walk_list!(visitor, visit_attribute, attrs);
|
||||||
V::Result::output()
|
V::Result::output()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,35 +1,11 @@
|
||||||
error: using tabs in doc comments is not recommended
|
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:6:5
|
|
||||||
|
|
|
||||||
LL | /// - first one
|
|
||||||
| ^^^^ help: consider using four spaces per tab
|
|
||||||
|
|
|
||||||
= note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
|
|
||||||
= help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`
|
|
||||||
|
|
||||||
error: using tabs in doc comments is not recommended
|
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:6:13
|
|
||||||
|
|
|
||||||
LL | /// - first one
|
|
||||||
| ^^^^^^^^ help: consider using four spaces per tab
|
|
||||||
|
|
||||||
error: using tabs in doc comments is not recommended
|
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:7:5
|
|
||||||
|
|
|
||||||
LL | /// - second one
|
|
||||||
| ^^^^ help: consider using four spaces per tab
|
|
||||||
|
|
||||||
error: using tabs in doc comments is not recommended
|
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:7:14
|
|
||||||
|
|
|
||||||
LL | /// - second one
|
|
||||||
| ^^^^ help: consider using four spaces per tab
|
|
||||||
|
|
||||||
error: using tabs in doc comments is not recommended
|
error: using tabs in doc comments is not recommended
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:10:9
|
--> tests/ui/tabs_in_doc_comments.rs:10:9
|
||||||
|
|
|
|
||||||
LL | /// - First String:
|
LL | /// - First String:
|
||||||
| ^^^^ help: consider using four spaces per tab
|
| ^^^^ help: consider using four spaces per tab
|
||||||
|
|
|
||||||
|
= note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
|
||||||
|
= help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`
|
||||||
|
|
||||||
error: using tabs in doc comments is not recommended
|
error: using tabs in doc comments is not recommended
|
||||||
--> tests/ui/tabs_in_doc_comments.rs:11:9
|
--> tests/ui/tabs_in_doc_comments.rs:11:9
|
||||||
|
@ -49,5 +25,29 @@ error: using tabs in doc comments is not recommended
|
||||||
LL | /// - needs to be inside here
|
LL | /// - needs to be inside here
|
||||||
| ^^^^^^^^ help: consider using four spaces per tab
|
| ^^^^^^^^ help: consider using four spaces per tab
|
||||||
|
|
||||||
|
error: using tabs in doc comments is not recommended
|
||||||
|
--> tests/ui/tabs_in_doc_comments.rs:6:5
|
||||||
|
|
|
||||||
|
LL | /// - first one
|
||||||
|
| ^^^^ help: consider using four spaces per tab
|
||||||
|
|
||||||
|
error: using tabs in doc comments is not recommended
|
||||||
|
--> tests/ui/tabs_in_doc_comments.rs:6:13
|
||||||
|
|
|
||||||
|
LL | /// - first one
|
||||||
|
| ^^^^^^^^ help: consider using four spaces per tab
|
||||||
|
|
||||||
|
error: using tabs in doc comments is not recommended
|
||||||
|
--> tests/ui/tabs_in_doc_comments.rs:7:5
|
||||||
|
|
|
||||||
|
LL | /// - second one
|
||||||
|
| ^^^^ help: consider using four spaces per tab
|
||||||
|
|
||||||
|
error: using tabs in doc comments is not recommended
|
||||||
|
--> tests/ui/tabs_in_doc_comments.rs:7:14
|
||||||
|
|
|
||||||
|
LL | /// - second one
|
||||||
|
| ^^^^ help: consider using four spaces per tab
|
||||||
|
|
||||||
error: aborting due to 8 previous errors
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ fn before() {
|
||||||
macro_rules! in_root { () => { "" } }
|
macro_rules! in_root { () => { "" } }
|
||||||
|
|
||||||
mod macros_stay {
|
mod macros_stay {
|
||||||
#![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope
|
#![doc = in_mod!()] // FIXME, this is a bug
|
||||||
|
|
||||||
macro_rules! in_mod { () => { "" } }
|
macro_rules! in_mod { () => { "" } }
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ mod macros_stay {
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod macros_escape {
|
mod macros_escape {
|
||||||
#![doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape` in this scope
|
#![doc = in_mod_escape!()] // FIXME, this is a bug
|
||||||
|
|
||||||
macro_rules! in_mod_escape { () => { "" } }
|
macro_rules! in_mod_escape { () => { "" } }
|
||||||
|
|
||||||
|
|
|
@ -78,22 +78,6 @@ LL | #![doc = in_block!()]
|
||||||
|
|
|
|
||||||
= help: have you added the `#[macro_use]` on the module/import?
|
= help: have you added the `#[macro_use]` on the module/import?
|
||||||
|
|
||||||
error: cannot find macro `in_mod` in this scope
|
|
||||||
--> $DIR/key-value-expansion-scope.rs:20:14
|
|
||||||
|
|
|
||||||
LL | #![doc = in_mod!()]
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: have you added the `#[macro_use]` on the module/import?
|
|
||||||
|
|
||||||
error: cannot find macro `in_mod_escape` in this scope
|
|
||||||
--> $DIR/key-value-expansion-scope.rs:32:14
|
|
||||||
|
|
|
||||||
LL | #![doc = in_mod_escape!()]
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= help: have you added the `#[macro_use]` on the module/import?
|
|
||||||
|
|
||||||
error: cannot find macro `in_block` in this scope
|
error: cannot find macro `in_block` in this scope
|
||||||
--> $DIR/key-value-expansion-scope.rs:43:14
|
--> $DIR/key-value-expansion-scope.rs:43:14
|
||||||
|
|
|
|
||||||
|
@ -134,5 +118,5 @@ LL | #![doc = in_block!()]
|
||||||
|
|
|
|
||||||
= help: have you added the `#[macro_use]` on the module/import?
|
= help: have you added the `#[macro_use]` on the module/import?
|
||||||
|
|
||||||
error: aborting due to 17 previous errors
|
error: aborting due to 15 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
|
||||||
--> $DIR/feature-gate-optimize_attribute.rs:4:1
|
|
||||||
|
|
|
||||||
LL | #[optimize(size)]
|
|
||||||
| ^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: see issue #54882 <https://github.com/rust-lang/rust/issues/54882> for more information
|
|
||||||
= help: add `#![feature(optimize_attribute)]` to the crate attributes to enable
|
|
||||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
|
||||||
|
|
||||||
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
||||||
--> $DIR/feature-gate-optimize_attribute.rs:7:1
|
--> $DIR/feature-gate-optimize_attribute.rs:7:1
|
||||||
|
|
|
|
||||||
|
@ -38,6 +28,16 @@ LL | #[optimize(banana)]
|
||||||
= help: add `#![feature(optimize_attribute)]` to the crate attributes to enable
|
= help: add `#![feature(optimize_attribute)]` to the crate attributes to enable
|
||||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||||
|
|
||||||
|
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
||||||
|
--> $DIR/feature-gate-optimize_attribute.rs:4:1
|
||||||
|
|
|
||||||
|
LL | #[optimize(size)]
|
||||||
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #54882 <https://github.com/rust-lang/rust/issues/54882> for more information
|
||||||
|
= help: add `#![feature(optimize_attribute)]` to the crate attributes to enable
|
||||||
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||||
|
|
||||||
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
error[E0658]: the `#[optimize]` attribute is an experimental feature
|
||||||
--> $DIR/feature-gate-optimize_attribute.rs:2:1
|
--> $DIR/feature-gate-optimize_attribute.rs:2:1
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
|
||||||
--> $DIR/issue-43106-gating-of-stable.rs:10:1
|
|
||||||
|
|
|
||||||
LL | #[stable()]
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
--> $DIR/issue-43106-gating-of-stable.rs:14:9
|
--> $DIR/issue-43106-gating-of-stable.rs:14:9
|
||||||
|
|
|
|
||||||
|
@ -34,6 +28,12 @@ error[E0734]: stability attributes may not be used outside of the standard libra
|
||||||
LL | #[stable()]
|
LL | #[stable()]
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
|
--> $DIR/issue-43106-gating-of-stable.rs:10:1
|
||||||
|
|
|
||||||
|
LL | #[stable()]
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
--> $DIR/issue-43106-gating-of-stable.rs:7:1
|
--> $DIR/issue-43106-gating-of-stable.rs:7:1
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
|
||||||
--> $DIR/issue-43106-gating-of-unstable.rs:10:1
|
|
||||||
|
|
|
||||||
LL | #[unstable()]
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
--> $DIR/issue-43106-gating-of-unstable.rs:14:9
|
--> $DIR/issue-43106-gating-of-unstable.rs:14:9
|
||||||
|
|
|
|
||||||
|
@ -34,6 +28,12 @@ error[E0734]: stability attributes may not be used outside of the standard libra
|
||||||
LL | #[unstable()]
|
LL | #[unstable()]
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
|
--> $DIR/issue-43106-gating-of-unstable.rs:10:1
|
||||||
|
|
|
||||||
|
LL | #[unstable()]
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0734]: stability attributes may not be used outside of the standard library
|
error[E0734]: stability attributes may not be used outside of the standard library
|
||||||
--> $DIR/issue-43106-gating-of-unstable.rs:7:1
|
--> $DIR/issue-43106-gating-of-unstable.rs:7:1
|
||||||
|
|
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue