1
Fork 0

change BuiltinDeriveFn type to get ExtCtxt by immutable ref and fix signatures

This commit is contained in:
klensy 2024-03-28 12:49:18 +03:00
parent 615bb53a8d
commit afd0a8eb8f
12 changed files with 13 additions and 13 deletions

View file

@ -6,7 +6,7 @@ use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span; use rustc_span::Span;
pub fn expand_deriving_copy( pub fn expand_deriving_copy(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,
@ -29,7 +29,7 @@ pub fn expand_deriving_copy(
} }
pub fn expand_deriving_const_param_ty( pub fn expand_deriving_const_param_ty(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_clone( pub fn expand_deriving_clone(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -10,7 +10,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_eq( pub fn expand_deriving_eq(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec; use thin_vec::thin_vec;
pub fn expand_deriving_ord( pub fn expand_deriving_ord(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::thin_vec; use thin_vec::thin_vec;
pub fn expand_deriving_partial_eq( pub fn expand_deriving_partial_eq(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec; use thin_vec::thin_vec;
pub fn expand_deriving_partial_ord( pub fn expand_deriving_partial_ord(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_debug( pub fn expand_deriving_debug(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -11,7 +11,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_rustc_decodable( pub fn expand_deriving_rustc_decodable(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -13,7 +13,7 @@ use smallvec::SmallVec;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_default( pub fn expand_deriving_default(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &ast::MetaItem, mitem: &ast::MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -95,7 +95,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec}; use thin_vec::{thin_vec, ThinVec};
pub fn expand_deriving_rustc_encodable( pub fn expand_deriving_rustc_encodable(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec; use thin_vec::thin_vec;
pub fn expand_deriving_hash( pub fn expand_deriving_hash(
cx: &mut ExtCtxt<'_>, cx: &ExtCtxt<'_>,
span: Span, span: Span,
mitem: &MetaItem, mitem: &MetaItem,
item: &Annotatable, item: &Annotatable,

View file

@ -40,7 +40,7 @@ pub mod partial_ord;
pub mod generic; pub mod generic;
pub(crate) type BuiltinDeriveFn = pub(crate) type BuiltinDeriveFn =
fn(&mut ExtCtxt<'_>, Span, &MetaItem, &Annotatable, &mut dyn FnMut(Annotatable), bool); fn(&ExtCtxt<'_>, Span, &MetaItem, &Annotatable, &mut dyn FnMut(Annotatable), bool);
pub(crate) struct BuiltinDerive(pub(crate) BuiltinDeriveFn); pub(crate) struct BuiltinDerive(pub(crate) BuiltinDeriveFn);