Skip to content

Commit e5c14c3

Browse files
committed
split up context.rs
1 parent f6d667f commit e5c14c3

File tree

5 files changed

+362
-338
lines changed

5 files changed

+362
-338
lines changed

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//! Specifically, you might not care about managing the state of your [`AttributeParser`]
88
//! state machine yourself. In this case you can choose to implement:
99
//!
10-
//! - [`SingleAttributeParser`]: makes it easy to implement an attribute which should error if it
10+
//! - [`SingleAttributeParser`](crate::attributes::SingleAttributeParser): makes it easy to implement an attribute which should error if it
1111
//! appears more than once in a list of attributes
12-
//! - [`CombineAttributeParser`]: makes it easy to implement an attribute which should combine the
12+
//! - [`CombineAttributeParser`](crate::attributes::CombineAttributeParser): makes it easy to implement an attribute which should combine the
1313
//! contents of attributes, if an attribute appear multiple times in a list
1414
//!
1515
//! Attributes should be added to `crate::context::ATTRIBUTE_PARSERS` to be parsed.
@@ -285,7 +285,7 @@ impl<T: NoArgsAttributeParser<S>, S: Stage> SingleAttributeParser<S> for Without
285285
}
286286
}
287287

288-
pub(super) type ConvertFn<E> = fn(ThinVec<E>, Span) -> AttributeKind;
288+
type ConvertFn<E> = fn(ThinVec<E>, Span) -> AttributeKind;
289289

290290
/// Alternative to [`AttributeParser`] that automatically handles state management.
291291
/// If multiple attributes appear on an element, combines the values of each into a
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
// parsing
2-
pub(super) use crate::attributes::{
3-
AcceptMapping, AttributeOrder, AttributeParser, CombineAttributeParser, ConvertFn,
4-
NoArgsAttributeParser, OnDuplicate, SingleAttributeParser,
5-
};
6-
pub(super) use crate::parser::*;
7-
8-
// contexts
9-
pub(super) use crate::context::{AcceptContext, FinalizeContext, Stage};
10-
2+
// templates
3+
pub(super) use rustc_feature::{AttributeTemplate, template};
114
// data structures
125
pub(super) use rustc_hir::attrs::AttributeKind;
136
pub(super) use rustc_hir::lints::AttributeLintKind;
7+
pub(super) use rustc_hir::{MethodKind, Target};
148
pub(super) use rustc_span::{DUMMY_SP, Ident, Span, Symbol, sym};
159
pub(super) use thin_vec::ThinVec;
1610

11+
pub(super) use crate::attributes::{
12+
AcceptMapping, AttributeOrder, AttributeParser, CombineAttributeParser, ConvertFn,
13+
NoArgsAttributeParser, OnDuplicate, SingleAttributeParser,
14+
};
15+
// contexts
16+
pub(super) use crate::context::{AcceptContext, FinalizeContext, Stage};
17+
pub(super) use crate::parser::*;
1718
// target checking
1819
pub(super) use crate::target_checking::Policy::{Allow, Error, Warn};
1920
pub(super) use crate::target_checking::{ALL_TARGETS, AllowedTargets};
20-
pub(super) use rustc_hir::{MethodKind, Target};
21-
22-
// templates
23-
pub(super) use rustc_feature::{AttributeTemplate, template};

0 commit comments

Comments
 (0)