Auto merge of #30087 - petrochenkov:indi, r=nrc
I've measured the time/memory consumption before and after - the difference is lost in statistical noise, so it's mostly a code simplification. Sizes of `enum`s are not affected. r? @nrc I wonder if AST/HIR visitors could run faster if `P`s are systematically removed (except for cases where they control `enum` sizes). Theoretically they should. Remaining unnecessary `P`s can't be easily removed because many folders accept `P<X>`s as arguments, but these folders can be converted to accept `X`s instead without loss of efficiency. When I have a mood for some mindless refactoring again, I'll probably try to convert the folders, remove remaining `P`s and measure again.
This commit is contained in:
commit
acf4e0be22
26 changed files with 178 additions and 195 deletions
|
|
@ -176,7 +176,7 @@ pub struct Constant {
|
|||
pub struct Trait {
|
||||
pub unsafety: hir::Unsafety,
|
||||
pub name: Name,
|
||||
pub items: Vec<P<hir::TraitItem>>, //should be TraitItem
|
||||
pub items: Vec<hir::TraitItem>,
|
||||
pub generics: hir::Generics,
|
||||
pub bounds: Vec<hir::TyParamBound>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
|
|
@ -192,7 +192,7 @@ pub struct Impl {
|
|||
pub generics: hir::Generics,
|
||||
pub trait_: Option<hir::TraitRef>,
|
||||
pub for_: P<hir::Ty>,
|
||||
pub items: Vec<P<hir::ImplItem>>,
|
||||
pub items: Vec<hir::ImplItem>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue