mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 10:58:02 +00:00
Merge pull request #19749 from Veykril/push-tsxvxzzmlxpq
refactor: Remove unnecessary `AsAny` trait
This commit is contained in:
commit
d40455fec0
4 changed files with 4 additions and 56 deletions
|
|
@ -19,18 +19,8 @@ pub enum ProcMacroKind {
|
|||
Attr,
|
||||
}
|
||||
|
||||
pub trait AsAny: Any {
|
||||
fn as_any(&self) -> &dyn Any;
|
||||
}
|
||||
|
||||
impl<T: Any> AsAny for T {
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// A proc-macro expander implementation.
|
||||
pub trait ProcMacroExpander: fmt::Debug + Send + Sync + RefUnwindSafe + AsAny {
|
||||
pub trait ProcMacroExpander: fmt::Debug + Send + Sync + RefUnwindSafe + Any {
|
||||
/// Run the expander with the given input subtree, optional attribute input subtree (for
|
||||
/// [`ProcMacroKind::Attr`]), environment variables, and span information.
|
||||
fn expand(
|
||||
|
|
@ -44,7 +34,9 @@ pub trait ProcMacroExpander: fmt::Debug + Send + Sync + RefUnwindSafe + AsAny {
|
|||
current_dir: String,
|
||||
) -> Result<tt::TopSubtree, ProcMacroExpansionError>;
|
||||
|
||||
fn eq_dyn(&self, other: &dyn ProcMacroExpander) -> bool;
|
||||
fn eq_dyn(&self, other: &dyn ProcMacroExpander) -> bool {
|
||||
other.type_id() == self.type_id()
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for dyn ProcMacroExpander {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue