[−][src]Struct rustc_lint::levels::LintLevelsBuilder
Fields
sess: &'s Sessionsets: LintLevelSetsid_to_set: FxHashMap<HirId, u32>cur: u32warn_about_weird_lints: boolImplementations
impl<'s> LintLevelsBuilder<'s>[src]
pub fn new(
sess: &'s Session,
warn_about_weird_lints: bool,
store: &LintStore
) -> Self[src]
sess: &'s Session,
warn_about_weird_lints: bool,
store: &LintStore
) -> Self
pub(in levels) fn process_command_line(
&mut self,
sess: &Session,
store: &LintStore
)[src]
&mut self,
sess: &Session,
store: &LintStore
)
pub(in levels) fn insert_spec(
&mut self,
specs: &mut FxHashMap<LintId, LevelSource>,
id: LintId,
(level, src): LevelSource
)[src]
&mut self,
specs: &mut FxHashMap<LintId, LevelSource>,
id: LintId,
(level, src): LevelSource
)
Attempts to insert the id to level_src map entry. If unsuccessful
(e.g. if a forbid was already inserted on the same scope), then emits a
diagnostic with no change to specs.
pub(crate) fn push(
&mut self,
attrs: &[Attribute],
store: &LintStore,
is_crate_node: bool
) -> BuilderPush[src]
&mut self,
attrs: &[Attribute],
store: &LintStore,
is_crate_node: bool
) -> BuilderPush
Pushes a list of AST lint attributes onto this context.
This function will return a BuilderPush object which should be passed
to pop when this scope for the attributes provided is exited.
This function will perform a number of tasks:
- It'll validate all lint-related attributes in
attrs - It'll mark all lint-related attributes as used
- Lint levels will be updated based on the attributes provided
- Lint attributes are validated, e.g., a
#[forbid]can't be switched to#[allow]
Don't forget to call pop!
pub(in levels) fn check_gated_lint(
&self,
lint_id: LintId,
span: Span
)[src]
&self,
lint_id: LintId,
span: Span
)
Checks if the lint is gated on a feature that is not enabled.
pub fn pop(&mut self, push: BuilderPush)[src]
Called after push when the scope of a set of attributes are exited.
pub fn lint_level(&self, lint: &'static Lint) -> (Level, LintSource)[src]
Find the lint level for a lint.
pub fn struct_lint(
&self,
lint: &'static Lint,
span: Option<MultiSpan>,
decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>)
)[src]
&self,
lint: &'static Lint,
span: Option<MultiSpan>,
decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>)
)
Used to emit a lint-related diagnostic based on the current state of this lint context.
pub fn register_id(&mut self, id: HirId)[src]
Registers the ID provided with the current set of lints stored in this context.
pub fn build(self) -> LintLevelSets[src]
pub fn build_map(self) -> LintLevelMap[src]
Auto Trait Implementations
impl<'s> !RefUnwindSafe for LintLevelsBuilder<'s>
impl<'s> !Send for LintLevelsBuilder<'s>
impl<'s> !Sync for LintLevelsBuilder<'s>
impl<'s> Unpin for LintLevelsBuilder<'s>
impl<'s> !UnwindSafe for LintLevelsBuilder<'s>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,