Skip to content

Commit

Permalink
change BuiltinDeriveFn type to get ExtCtxt by immutable ref and fix s…
Browse files Browse the repository at this point in the history
…ignatures
  • Loading branch information
klensy committed Mar 28, 2024
1 parent 615bb53 commit afd0a8e
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_builtin_macros/src/deriving/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;

pub fn expand_deriving_copy(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand All @@ -29,7 +29,7 @@ pub fn expand_deriving_copy(
}

pub fn expand_deriving_const_param_ty(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_clone(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_eq(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/cmp/ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec;

pub fn expand_deriving_ord(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::thin_vec;

pub fn expand_deriving_partial_eq(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec;

pub fn expand_deriving_partial_ord(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_debug(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/decodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_rustc_decodable(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use smallvec::SmallVec;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_default(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &ast::MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/encodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ use rustc_span::Span;
use thin_vec::{thin_vec, ThinVec};

pub fn expand_deriving_rustc_encodable(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_span::Span;
use thin_vec::thin_vec;

pub fn expand_deriving_hash(
cx: &mut ExtCtxt<'_>,
cx: &ExtCtxt<'_>,
span: Span,
mitem: &MetaItem,
item: &Annotatable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod partial_ord;
pub mod generic;

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);

Expand Down

0 comments on commit afd0a8e

Please sign in to comment.