#![doc = include_str!("../README.md")]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::must_use_candidate)]
#![allow(clippy::trivially_copy_pass_by_ref)]
#![allow(clippy::unused_self)] #![allow(clippy::missing_panics_doc)] #![allow(clippy::new_without_default)] #![cfg_attr(not(feature = "driver-api"), allow(dead_code))]
#![cfg_attr(marker, warn(marker::marker_lints::not_using_has_span_trait))]
pub static MARKER_API_VERSION: &str = env!("CARGO_PKG_VERSION");
mod interface;
mod private;
pub use interface::*;
mod lint;
pub use lint::*;
#[cfg(test)]
pub(crate) mod test;
pub mod ast;
pub mod common;
pub mod context;
pub mod diagnostic;
pub mod prelude;
pub mod sem;
pub mod span;
#[doc(hidden)]
pub mod ffi;
pub use context::MarkerContext;
pub use interface::{LintPassInfo, LintPassInfoBuilder};
pub trait LintPass {
fn info(&self) -> LintPassInfo;
fn check_crate<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _krate: &'ast ast::Crate<'ast>) {}
fn check_item<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _item: ast::ItemKind<'ast>) {}
fn check_field<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _field: &'ast ast::ItemField<'ast>) {}
fn check_variant<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _variant: &'ast ast::EnumVariant<'ast>) {}
fn check_body<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _body: &'ast ast::Body<'ast>) {}
fn check_stmt<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _stmt: ast::StmtKind<'ast>) {}
fn check_expr<'ast>(&mut self, _cx: &'ast MarkerContext<'ast>, _expr: ast::ExprKind<'ast>) {}
}
#[repr(C)]
#[non_exhaustive]
#[derive(Copy, Clone)]
pub struct CtorBlocker {
_data: u8,
}
impl std::fmt::Debug for CtorBlocker {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("..").finish()
}
}
impl CtorBlocker {
#[cfg_attr(feature = "driver-api", visibility::make(pub))]
pub(crate) fn new() -> Self {
Self { _data: 255 }
}
}