| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904 |
- // SPDX-License-Identifier: Apache-2.0 OR MIT
- // This file is @generated by syn-internal-codegen.
- // It is not intended for manual editing.
- #![allow(unreachable_code, unused_variables)]
- #![allow(
- clippy::match_wildcard_for_single_variants,
- clippy::needless_match,
- clippy::needless_pass_by_ref_mut,
- )]
- #[cfg(feature = "full")]
- macro_rules! full {
- ($e:expr) => {
- $e
- };
- }
- #[cfg(all(feature = "derive", not(feature = "full")))]
- macro_rules! full {
- ($e:expr) => {
- unreachable!()
- };
- }
- /// Syntax tree traversal to transform the nodes of an owned syntax tree.
- ///
- /// See the [module documentation] for details.
- ///
- /// [module documentation]: self
- pub trait Fold {
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_abi(&mut self, i: crate::Abi) -> crate::Abi {
- fold_abi(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_angle_bracketed_generic_arguments(
- &mut self,
- i: crate::AngleBracketedGenericArguments,
- ) -> crate::AngleBracketedGenericArguments {
- fold_angle_bracketed_generic_arguments(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_arm(&mut self, i: crate::Arm) -> crate::Arm {
- fold_arm(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_assoc_const(&mut self, i: crate::AssocConst) -> crate::AssocConst {
- fold_assoc_const(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_assoc_type(&mut self, i: crate::AssocType) -> crate::AssocType {
- fold_assoc_type(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_attr_style(&mut self, i: crate::AttrStyle) -> crate::AttrStyle {
- fold_attr_style(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_attribute(&mut self, i: crate::Attribute) -> crate::Attribute {
- fold_attribute(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_attributes(&mut self, i: Vec<crate::Attribute>) -> Vec<crate::Attribute> {
- fold_vec(i, self, Self::fold_attribute)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_bare_fn_arg(&mut self, i: crate::BareFnArg) -> crate::BareFnArg {
- fold_bare_fn_arg(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_bare_variadic(&mut self, i: crate::BareVariadic) -> crate::BareVariadic {
- fold_bare_variadic(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_bin_op(&mut self, i: crate::BinOp) -> crate::BinOp {
- fold_bin_op(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_block(&mut self, i: crate::Block) -> crate::Block {
- fold_block(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_bound_lifetimes(
- &mut self,
- i: crate::BoundLifetimes,
- ) -> crate::BoundLifetimes {
- fold_bound_lifetimes(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_captured_param(&mut self, i: crate::CapturedParam) -> crate::CapturedParam {
- fold_captured_param(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_const_param(&mut self, i: crate::ConstParam) -> crate::ConstParam {
- fold_const_param(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_constraint(&mut self, i: crate::Constraint) -> crate::Constraint {
- fold_constraint(self, i)
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- fn fold_data(&mut self, i: crate::Data) -> crate::Data {
- fold_data(self, i)
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- fn fold_data_enum(&mut self, i: crate::DataEnum) -> crate::DataEnum {
- fold_data_enum(self, i)
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- fn fold_data_struct(&mut self, i: crate::DataStruct) -> crate::DataStruct {
- fold_data_struct(self, i)
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- fn fold_data_union(&mut self, i: crate::DataUnion) -> crate::DataUnion {
- fold_data_union(self, i)
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- fn fold_derive_input(&mut self, i: crate::DeriveInput) -> crate::DeriveInput {
- fold_derive_input(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr(&mut self, i: crate::Expr) -> crate::Expr {
- fold_expr(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_array(&mut self, i: crate::ExprArray) -> crate::ExprArray {
- fold_expr_array(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_assign(&mut self, i: crate::ExprAssign) -> crate::ExprAssign {
- fold_expr_assign(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_async(&mut self, i: crate::ExprAsync) -> crate::ExprAsync {
- fold_expr_async(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_await(&mut self, i: crate::ExprAwait) -> crate::ExprAwait {
- fold_expr_await(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_binary(&mut self, i: crate::ExprBinary) -> crate::ExprBinary {
- fold_expr_binary(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_block(&mut self, i: crate::ExprBlock) -> crate::ExprBlock {
- fold_expr_block(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_break(&mut self, i: crate::ExprBreak) -> crate::ExprBreak {
- fold_expr_break(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_call(&mut self, i: crate::ExprCall) -> crate::ExprCall {
- fold_expr_call(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_cast(&mut self, i: crate::ExprCast) -> crate::ExprCast {
- fold_expr_cast(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_closure(&mut self, i: crate::ExprClosure) -> crate::ExprClosure {
- fold_expr_closure(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_const(&mut self, i: crate::ExprConst) -> crate::ExprConst {
- fold_expr_const(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_continue(&mut self, i: crate::ExprContinue) -> crate::ExprContinue {
- fold_expr_continue(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_field(&mut self, i: crate::ExprField) -> crate::ExprField {
- fold_expr_field(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_for_loop(&mut self, i: crate::ExprForLoop) -> crate::ExprForLoop {
- fold_expr_for_loop(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_group(&mut self, i: crate::ExprGroup) -> crate::ExprGroup {
- fold_expr_group(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_if(&mut self, i: crate::ExprIf) -> crate::ExprIf {
- fold_expr_if(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_index(&mut self, i: crate::ExprIndex) -> crate::ExprIndex {
- fold_expr_index(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_infer(&mut self, i: crate::ExprInfer) -> crate::ExprInfer {
- fold_expr_infer(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_let(&mut self, i: crate::ExprLet) -> crate::ExprLet {
- fold_expr_let(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_lit(&mut self, i: crate::ExprLit) -> crate::ExprLit {
- fold_expr_lit(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_loop(&mut self, i: crate::ExprLoop) -> crate::ExprLoop {
- fold_expr_loop(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_macro(&mut self, i: crate::ExprMacro) -> crate::ExprMacro {
- fold_expr_macro(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_match(&mut self, i: crate::ExprMatch) -> crate::ExprMatch {
- fold_expr_match(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_method_call(
- &mut self,
- i: crate::ExprMethodCall,
- ) -> crate::ExprMethodCall {
- fold_expr_method_call(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_paren(&mut self, i: crate::ExprParen) -> crate::ExprParen {
- fold_expr_paren(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_path(&mut self, i: crate::ExprPath) -> crate::ExprPath {
- fold_expr_path(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_range(&mut self, i: crate::ExprRange) -> crate::ExprRange {
- fold_expr_range(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_raw_addr(&mut self, i: crate::ExprRawAddr) -> crate::ExprRawAddr {
- fold_expr_raw_addr(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_reference(&mut self, i: crate::ExprReference) -> crate::ExprReference {
- fold_expr_reference(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_repeat(&mut self, i: crate::ExprRepeat) -> crate::ExprRepeat {
- fold_expr_repeat(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_return(&mut self, i: crate::ExprReturn) -> crate::ExprReturn {
- fold_expr_return(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_struct(&mut self, i: crate::ExprStruct) -> crate::ExprStruct {
- fold_expr_struct(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_try(&mut self, i: crate::ExprTry) -> crate::ExprTry {
- fold_expr_try(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_try_block(&mut self, i: crate::ExprTryBlock) -> crate::ExprTryBlock {
- fold_expr_try_block(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_tuple(&mut self, i: crate::ExprTuple) -> crate::ExprTuple {
- fold_expr_tuple(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_expr_unary(&mut self, i: crate::ExprUnary) -> crate::ExprUnary {
- fold_expr_unary(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_unsafe(&mut self, i: crate::ExprUnsafe) -> crate::ExprUnsafe {
- fold_expr_unsafe(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_while(&mut self, i: crate::ExprWhile) -> crate::ExprWhile {
- fold_expr_while(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_expr_yield(&mut self, i: crate::ExprYield) -> crate::ExprYield {
- fold_expr_yield(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_field(&mut self, i: crate::Field) -> crate::Field {
- fold_field(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_field_mutability(
- &mut self,
- i: crate::FieldMutability,
- ) -> crate::FieldMutability {
- fold_field_mutability(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_field_pat(&mut self, i: crate::FieldPat) -> crate::FieldPat {
- fold_field_pat(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_field_value(&mut self, i: crate::FieldValue) -> crate::FieldValue {
- fold_field_value(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_fields(&mut self, i: crate::Fields) -> crate::Fields {
- fold_fields(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_fields_named(&mut self, i: crate::FieldsNamed) -> crate::FieldsNamed {
- fold_fields_named(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_fields_unnamed(&mut self, i: crate::FieldsUnnamed) -> crate::FieldsUnnamed {
- fold_fields_unnamed(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_file(&mut self, i: crate::File) -> crate::File {
- fold_file(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_fn_arg(&mut self, i: crate::FnArg) -> crate::FnArg {
- fold_fn_arg(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_foreign_item(&mut self, i: crate::ForeignItem) -> crate::ForeignItem {
- fold_foreign_item(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_foreign_item_fn(&mut self, i: crate::ForeignItemFn) -> crate::ForeignItemFn {
- fold_foreign_item_fn(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_foreign_item_macro(
- &mut self,
- i: crate::ForeignItemMacro,
- ) -> crate::ForeignItemMacro {
- fold_foreign_item_macro(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_foreign_item_static(
- &mut self,
- i: crate::ForeignItemStatic,
- ) -> crate::ForeignItemStatic {
- fold_foreign_item_static(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_foreign_item_type(
- &mut self,
- i: crate::ForeignItemType,
- ) -> crate::ForeignItemType {
- fold_foreign_item_type(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_generic_argument(
- &mut self,
- i: crate::GenericArgument,
- ) -> crate::GenericArgument {
- fold_generic_argument(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_generic_param(&mut self, i: crate::GenericParam) -> crate::GenericParam {
- fold_generic_param(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_generics(&mut self, i: crate::Generics) -> crate::Generics {
- fold_generics(self, i)
- }
- fn fold_ident(&mut self, i: proc_macro2::Ident) -> proc_macro2::Ident {
- fold_ident(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_item(&mut self, i: crate::ImplItem) -> crate::ImplItem {
- fold_impl_item(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_item_const(&mut self, i: crate::ImplItemConst) -> crate::ImplItemConst {
- fold_impl_item_const(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_item_fn(&mut self, i: crate::ImplItemFn) -> crate::ImplItemFn {
- fold_impl_item_fn(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_item_macro(&mut self, i: crate::ImplItemMacro) -> crate::ImplItemMacro {
- fold_impl_item_macro(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_item_type(&mut self, i: crate::ImplItemType) -> crate::ImplItemType {
- fold_impl_item_type(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_impl_restriction(
- &mut self,
- i: crate::ImplRestriction,
- ) -> crate::ImplRestriction {
- fold_impl_restriction(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_index(&mut self, i: crate::Index) -> crate::Index {
- fold_index(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item(&mut self, i: crate::Item) -> crate::Item {
- fold_item(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_const(&mut self, i: crate::ItemConst) -> crate::ItemConst {
- fold_item_const(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_enum(&mut self, i: crate::ItemEnum) -> crate::ItemEnum {
- fold_item_enum(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_extern_crate(
- &mut self,
- i: crate::ItemExternCrate,
- ) -> crate::ItemExternCrate {
- fold_item_extern_crate(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_fn(&mut self, i: crate::ItemFn) -> crate::ItemFn {
- fold_item_fn(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_foreign_mod(
- &mut self,
- i: crate::ItemForeignMod,
- ) -> crate::ItemForeignMod {
- fold_item_foreign_mod(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_impl(&mut self, i: crate::ItemImpl) -> crate::ItemImpl {
- fold_item_impl(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_macro(&mut self, i: crate::ItemMacro) -> crate::ItemMacro {
- fold_item_macro(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_mod(&mut self, i: crate::ItemMod) -> crate::ItemMod {
- fold_item_mod(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_static(&mut self, i: crate::ItemStatic) -> crate::ItemStatic {
- fold_item_static(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_struct(&mut self, i: crate::ItemStruct) -> crate::ItemStruct {
- fold_item_struct(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_trait(&mut self, i: crate::ItemTrait) -> crate::ItemTrait {
- fold_item_trait(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_trait_alias(
- &mut self,
- i: crate::ItemTraitAlias,
- ) -> crate::ItemTraitAlias {
- fold_item_trait_alias(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_type(&mut self, i: crate::ItemType) -> crate::ItemType {
- fold_item_type(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_union(&mut self, i: crate::ItemUnion) -> crate::ItemUnion {
- fold_item_union(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_item_use(&mut self, i: crate::ItemUse) -> crate::ItemUse {
- fold_item_use(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_label(&mut self, i: crate::Label) -> crate::Label {
- fold_label(self, i)
- }
- fn fold_lifetime(&mut self, i: crate::Lifetime) -> crate::Lifetime {
- fold_lifetime(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_lifetime_param(&mut self, i: crate::LifetimeParam) -> crate::LifetimeParam {
- fold_lifetime_param(self, i)
- }
- fn fold_lit(&mut self, i: crate::Lit) -> crate::Lit {
- fold_lit(self, i)
- }
- fn fold_lit_bool(&mut self, i: crate::LitBool) -> crate::LitBool {
- fold_lit_bool(self, i)
- }
- fn fold_lit_byte(&mut self, i: crate::LitByte) -> crate::LitByte {
- fold_lit_byte(self, i)
- }
- fn fold_lit_byte_str(&mut self, i: crate::LitByteStr) -> crate::LitByteStr {
- fold_lit_byte_str(self, i)
- }
- fn fold_lit_cstr(&mut self, i: crate::LitCStr) -> crate::LitCStr {
- fold_lit_cstr(self, i)
- }
- fn fold_lit_char(&mut self, i: crate::LitChar) -> crate::LitChar {
- fold_lit_char(self, i)
- }
- fn fold_lit_float(&mut self, i: crate::LitFloat) -> crate::LitFloat {
- fold_lit_float(self, i)
- }
- fn fold_lit_int(&mut self, i: crate::LitInt) -> crate::LitInt {
- fold_lit_int(self, i)
- }
- fn fold_lit_str(&mut self, i: crate::LitStr) -> crate::LitStr {
- fold_lit_str(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_local(&mut self, i: crate::Local) -> crate::Local {
- fold_local(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_local_init(&mut self, i: crate::LocalInit) -> crate::LocalInit {
- fold_local_init(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_macro(&mut self, i: crate::Macro) -> crate::Macro {
- fold_macro(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_macro_delimiter(
- &mut self,
- i: crate::MacroDelimiter,
- ) -> crate::MacroDelimiter {
- fold_macro_delimiter(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_member(&mut self, i: crate::Member) -> crate::Member {
- fold_member(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_meta(&mut self, i: crate::Meta) -> crate::Meta {
- fold_meta(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_meta_list(&mut self, i: crate::MetaList) -> crate::MetaList {
- fold_meta_list(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_meta_name_value(&mut self, i: crate::MetaNameValue) -> crate::MetaNameValue {
- fold_meta_name_value(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_parenthesized_generic_arguments(
- &mut self,
- i: crate::ParenthesizedGenericArguments,
- ) -> crate::ParenthesizedGenericArguments {
- fold_parenthesized_generic_arguments(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat(&mut self, i: crate::Pat) -> crate::Pat {
- fold_pat(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_ident(&mut self, i: crate::PatIdent) -> crate::PatIdent {
- fold_pat_ident(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_or(&mut self, i: crate::PatOr) -> crate::PatOr {
- fold_pat_or(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_paren(&mut self, i: crate::PatParen) -> crate::PatParen {
- fold_pat_paren(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_reference(&mut self, i: crate::PatReference) -> crate::PatReference {
- fold_pat_reference(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_rest(&mut self, i: crate::PatRest) -> crate::PatRest {
- fold_pat_rest(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_slice(&mut self, i: crate::PatSlice) -> crate::PatSlice {
- fold_pat_slice(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_struct(&mut self, i: crate::PatStruct) -> crate::PatStruct {
- fold_pat_struct(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_tuple(&mut self, i: crate::PatTuple) -> crate::PatTuple {
- fold_pat_tuple(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_tuple_struct(
- &mut self,
- i: crate::PatTupleStruct,
- ) -> crate::PatTupleStruct {
- fold_pat_tuple_struct(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_type(&mut self, i: crate::PatType) -> crate::PatType {
- fold_pat_type(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pat_wild(&mut self, i: crate::PatWild) -> crate::PatWild {
- fold_pat_wild(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_path(&mut self, i: crate::Path) -> crate::Path {
- fold_path(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_path_arguments(&mut self, i: crate::PathArguments) -> crate::PathArguments {
- fold_path_arguments(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_path_segment(&mut self, i: crate::PathSegment) -> crate::PathSegment {
- fold_path_segment(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_pointer_mutability(
- &mut self,
- i: crate::PointerMutability,
- ) -> crate::PointerMutability {
- fold_pointer_mutability(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_precise_capture(
- &mut self,
- i: crate::PreciseCapture,
- ) -> crate::PreciseCapture {
- fold_precise_capture(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_predicate_lifetime(
- &mut self,
- i: crate::PredicateLifetime,
- ) -> crate::PredicateLifetime {
- fold_predicate_lifetime(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_predicate_type(&mut self, i: crate::PredicateType) -> crate::PredicateType {
- fold_predicate_type(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_qself(&mut self, i: crate::QSelf) -> crate::QSelf {
- fold_qself(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_range_limits(&mut self, i: crate::RangeLimits) -> crate::RangeLimits {
- fold_range_limits(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_receiver(&mut self, i: crate::Receiver) -> crate::Receiver {
- fold_receiver(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_return_type(&mut self, i: crate::ReturnType) -> crate::ReturnType {
- fold_return_type(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_signature(&mut self, i: crate::Signature) -> crate::Signature {
- fold_signature(self, i)
- }
- fn fold_span(&mut self, i: proc_macro2::Span) -> proc_macro2::Span {
- i
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_static_mutability(
- &mut self,
- i: crate::StaticMutability,
- ) -> crate::StaticMutability {
- fold_static_mutability(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_stmt(&mut self, i: crate::Stmt) -> crate::Stmt {
- fold_stmt(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_stmt_macro(&mut self, i: crate::StmtMacro) -> crate::StmtMacro {
- fold_stmt_macro(self, i)
- }
- fn fold_token_stream(
- &mut self,
- i: proc_macro2::TokenStream,
- ) -> proc_macro2::TokenStream {
- i
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_trait_bound(&mut self, i: crate::TraitBound) -> crate::TraitBound {
- fold_trait_bound(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_trait_bound_modifier(
- &mut self,
- i: crate::TraitBoundModifier,
- ) -> crate::TraitBoundModifier {
- fold_trait_bound_modifier(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_trait_item(&mut self, i: crate::TraitItem) -> crate::TraitItem {
- fold_trait_item(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_trait_item_const(
- &mut self,
- i: crate::TraitItemConst,
- ) -> crate::TraitItemConst {
- fold_trait_item_const(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_trait_item_fn(&mut self, i: crate::TraitItemFn) -> crate::TraitItemFn {
- fold_trait_item_fn(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_trait_item_macro(
- &mut self,
- i: crate::TraitItemMacro,
- ) -> crate::TraitItemMacro {
- fold_trait_item_macro(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_trait_item_type(&mut self, i: crate::TraitItemType) -> crate::TraitItemType {
- fold_trait_item_type(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type(&mut self, i: crate::Type) -> crate::Type {
- fold_type(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_array(&mut self, i: crate::TypeArray) -> crate::TypeArray {
- fold_type_array(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_bare_fn(&mut self, i: crate::TypeBareFn) -> crate::TypeBareFn {
- fold_type_bare_fn(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_group(&mut self, i: crate::TypeGroup) -> crate::TypeGroup {
- fold_type_group(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_impl_trait(&mut self, i: crate::TypeImplTrait) -> crate::TypeImplTrait {
- fold_type_impl_trait(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_infer(&mut self, i: crate::TypeInfer) -> crate::TypeInfer {
- fold_type_infer(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_macro(&mut self, i: crate::TypeMacro) -> crate::TypeMacro {
- fold_type_macro(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_never(&mut self, i: crate::TypeNever) -> crate::TypeNever {
- fold_type_never(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_param(&mut self, i: crate::TypeParam) -> crate::TypeParam {
- fold_type_param(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_param_bound(
- &mut self,
- i: crate::TypeParamBound,
- ) -> crate::TypeParamBound {
- fold_type_param_bound(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_paren(&mut self, i: crate::TypeParen) -> crate::TypeParen {
- fold_type_paren(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_path(&mut self, i: crate::TypePath) -> crate::TypePath {
- fold_type_path(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_ptr(&mut self, i: crate::TypePtr) -> crate::TypePtr {
- fold_type_ptr(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_reference(&mut self, i: crate::TypeReference) -> crate::TypeReference {
- fold_type_reference(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_slice(&mut self, i: crate::TypeSlice) -> crate::TypeSlice {
- fold_type_slice(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_trait_object(
- &mut self,
- i: crate::TypeTraitObject,
- ) -> crate::TypeTraitObject {
- fold_type_trait_object(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_type_tuple(&mut self, i: crate::TypeTuple) -> crate::TypeTuple {
- fold_type_tuple(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_un_op(&mut self, i: crate::UnOp) -> crate::UnOp {
- fold_un_op(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_glob(&mut self, i: crate::UseGlob) -> crate::UseGlob {
- fold_use_glob(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_group(&mut self, i: crate::UseGroup) -> crate::UseGroup {
- fold_use_group(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_name(&mut self, i: crate::UseName) -> crate::UseName {
- fold_use_name(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_path(&mut self, i: crate::UsePath) -> crate::UsePath {
- fold_use_path(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_rename(&mut self, i: crate::UseRename) -> crate::UseRename {
- fold_use_rename(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_use_tree(&mut self, i: crate::UseTree) -> crate::UseTree {
- fold_use_tree(self, i)
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- fn fold_variadic(&mut self, i: crate::Variadic) -> crate::Variadic {
- fold_variadic(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_variant(&mut self, i: crate::Variant) -> crate::Variant {
- fold_variant(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_vis_restricted(&mut self, i: crate::VisRestricted) -> crate::VisRestricted {
- fold_vis_restricted(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_visibility(&mut self, i: crate::Visibility) -> crate::Visibility {
- fold_visibility(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_where_clause(&mut self, i: crate::WhereClause) -> crate::WhereClause {
- fold_where_clause(self, i)
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- fn fold_where_predicate(
- &mut self,
- i: crate::WherePredicate,
- ) -> crate::WherePredicate {
- fold_where_predicate(self, i)
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_abi<F>(f: &mut F, node: crate::Abi) -> crate::Abi
- where
- F: Fold + ?Sized,
- {
- crate::Abi {
- extern_token: node.extern_token,
- name: (node.name).map(|it| f.fold_lit_str(it)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_angle_bracketed_generic_arguments<F>(
- f: &mut F,
- node: crate::AngleBracketedGenericArguments,
- ) -> crate::AngleBracketedGenericArguments
- where
- F: Fold + ?Sized,
- {
- crate::AngleBracketedGenericArguments {
- colon2_token: node.colon2_token,
- lt_token: node.lt_token,
- args: crate::punctuated::fold(node.args, f, F::fold_generic_argument),
- gt_token: node.gt_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_arm<F>(f: &mut F, node: crate::Arm) -> crate::Arm
- where
- F: Fold + ?Sized,
- {
- crate::Arm {
- attrs: f.fold_attributes(node.attrs),
- pat: f.fold_pat(node.pat),
- guard: (node.guard).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
- fat_arrow_token: node.fat_arrow_token,
- body: Box::new(f.fold_expr(*node.body)),
- comma: node.comma,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_assoc_const<F>(f: &mut F, node: crate::AssocConst) -> crate::AssocConst
- where
- F: Fold + ?Sized,
- {
- crate::AssocConst {
- ident: f.fold_ident(node.ident),
- generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
- eq_token: node.eq_token,
- value: f.fold_expr(node.value),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_assoc_type<F>(f: &mut F, node: crate::AssocType) -> crate::AssocType
- where
- F: Fold + ?Sized,
- {
- crate::AssocType {
- ident: f.fold_ident(node.ident),
- generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
- eq_token: node.eq_token,
- ty: f.fold_type(node.ty),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_attr_style<F>(f: &mut F, node: crate::AttrStyle) -> crate::AttrStyle
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::AttrStyle::Outer => crate::AttrStyle::Outer,
- crate::AttrStyle::Inner(_binding_0) => crate::AttrStyle::Inner(_binding_0),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_attribute<F>(f: &mut F, node: crate::Attribute) -> crate::Attribute
- where
- F: Fold + ?Sized,
- {
- crate::Attribute {
- pound_token: node.pound_token,
- style: f.fold_attr_style(node.style),
- bracket_token: node.bracket_token,
- meta: f.fold_meta(node.meta),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_bare_fn_arg<F>(f: &mut F, node: crate::BareFnArg) -> crate::BareFnArg
- where
- F: Fold + ?Sized,
- {
- crate::BareFnArg {
- attrs: f.fold_attributes(node.attrs),
- name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
- ty: f.fold_type(node.ty),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_bare_variadic<F>(f: &mut F, node: crate::BareVariadic) -> crate::BareVariadic
- where
- F: Fold + ?Sized,
- {
- crate::BareVariadic {
- attrs: f.fold_attributes(node.attrs),
- name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
- dots: node.dots,
- comma: node.comma,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_bin_op<F>(f: &mut F, node: crate::BinOp) -> crate::BinOp
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::BinOp::Add(_binding_0) => crate::BinOp::Add(_binding_0),
- crate::BinOp::Sub(_binding_0) => crate::BinOp::Sub(_binding_0),
- crate::BinOp::Mul(_binding_0) => crate::BinOp::Mul(_binding_0),
- crate::BinOp::Div(_binding_0) => crate::BinOp::Div(_binding_0),
- crate::BinOp::Rem(_binding_0) => crate::BinOp::Rem(_binding_0),
- crate::BinOp::And(_binding_0) => crate::BinOp::And(_binding_0),
- crate::BinOp::Or(_binding_0) => crate::BinOp::Or(_binding_0),
- crate::BinOp::BitXor(_binding_0) => crate::BinOp::BitXor(_binding_0),
- crate::BinOp::BitAnd(_binding_0) => crate::BinOp::BitAnd(_binding_0),
- crate::BinOp::BitOr(_binding_0) => crate::BinOp::BitOr(_binding_0),
- crate::BinOp::Shl(_binding_0) => crate::BinOp::Shl(_binding_0),
- crate::BinOp::Shr(_binding_0) => crate::BinOp::Shr(_binding_0),
- crate::BinOp::Eq(_binding_0) => crate::BinOp::Eq(_binding_0),
- crate::BinOp::Lt(_binding_0) => crate::BinOp::Lt(_binding_0),
- crate::BinOp::Le(_binding_0) => crate::BinOp::Le(_binding_0),
- crate::BinOp::Ne(_binding_0) => crate::BinOp::Ne(_binding_0),
- crate::BinOp::Ge(_binding_0) => crate::BinOp::Ge(_binding_0),
- crate::BinOp::Gt(_binding_0) => crate::BinOp::Gt(_binding_0),
- crate::BinOp::AddAssign(_binding_0) => crate::BinOp::AddAssign(_binding_0),
- crate::BinOp::SubAssign(_binding_0) => crate::BinOp::SubAssign(_binding_0),
- crate::BinOp::MulAssign(_binding_0) => crate::BinOp::MulAssign(_binding_0),
- crate::BinOp::DivAssign(_binding_0) => crate::BinOp::DivAssign(_binding_0),
- crate::BinOp::RemAssign(_binding_0) => crate::BinOp::RemAssign(_binding_0),
- crate::BinOp::BitXorAssign(_binding_0) => crate::BinOp::BitXorAssign(_binding_0),
- crate::BinOp::BitAndAssign(_binding_0) => crate::BinOp::BitAndAssign(_binding_0),
- crate::BinOp::BitOrAssign(_binding_0) => crate::BinOp::BitOrAssign(_binding_0),
- crate::BinOp::ShlAssign(_binding_0) => crate::BinOp::ShlAssign(_binding_0),
- crate::BinOp::ShrAssign(_binding_0) => crate::BinOp::ShrAssign(_binding_0),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_block<F>(f: &mut F, node: crate::Block) -> crate::Block
- where
- F: Fold + ?Sized,
- {
- crate::Block {
- brace_token: node.brace_token,
- stmts: fold_vec(node.stmts, f, F::fold_stmt),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_bound_lifetimes<F>(
- f: &mut F,
- node: crate::BoundLifetimes,
- ) -> crate::BoundLifetimes
- where
- F: Fold + ?Sized,
- {
- crate::BoundLifetimes {
- for_token: node.for_token,
- lt_token: node.lt_token,
- lifetimes: crate::punctuated::fold(node.lifetimes, f, F::fold_generic_param),
- gt_token: node.gt_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_captured_param<F>(
- f: &mut F,
- node: crate::CapturedParam,
- ) -> crate::CapturedParam
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::CapturedParam::Lifetime(_binding_0) => {
- crate::CapturedParam::Lifetime(f.fold_lifetime(_binding_0))
- }
- crate::CapturedParam::Ident(_binding_0) => {
- crate::CapturedParam::Ident(f.fold_ident(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_const_param<F>(f: &mut F, node: crate::ConstParam) -> crate::ConstParam
- where
- F: Fold + ?Sized,
- {
- crate::ConstParam {
- attrs: f.fold_attributes(node.attrs),
- const_token: node.const_token,
- ident: f.fold_ident(node.ident),
- colon_token: node.colon_token,
- ty: f.fold_type(node.ty),
- eq_token: node.eq_token,
- default: (node.default).map(|it| f.fold_expr(it)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_constraint<F>(f: &mut F, node: crate::Constraint) -> crate::Constraint
- where
- F: Fold + ?Sized,
- {
- crate::Constraint {
- ident: f.fold_ident(node.ident),
- generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- }
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- pub fn fold_data<F>(f: &mut F, node: crate::Data) -> crate::Data
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Data::Struct(_binding_0) => {
- crate::Data::Struct(f.fold_data_struct(_binding_0))
- }
- crate::Data::Enum(_binding_0) => crate::Data::Enum(f.fold_data_enum(_binding_0)),
- crate::Data::Union(_binding_0) => {
- crate::Data::Union(f.fold_data_union(_binding_0))
- }
- }
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- pub fn fold_data_enum<F>(f: &mut F, node: crate::DataEnum) -> crate::DataEnum
- where
- F: Fold + ?Sized,
- {
- crate::DataEnum {
- enum_token: node.enum_token,
- brace_token: node.brace_token,
- variants: crate::punctuated::fold(node.variants, f, F::fold_variant),
- }
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- pub fn fold_data_struct<F>(f: &mut F, node: crate::DataStruct) -> crate::DataStruct
- where
- F: Fold + ?Sized,
- {
- crate::DataStruct {
- struct_token: node.struct_token,
- fields: f.fold_fields(node.fields),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- pub fn fold_data_union<F>(f: &mut F, node: crate::DataUnion) -> crate::DataUnion
- where
- F: Fold + ?Sized,
- {
- crate::DataUnion {
- union_token: node.union_token,
- fields: f.fold_fields_named(node.fields),
- }
- }
- #[cfg(feature = "derive")]
- #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
- pub fn fold_derive_input<F>(f: &mut F, node: crate::DeriveInput) -> crate::DeriveInput
- where
- F: Fold + ?Sized,
- {
- crate::DeriveInput {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- data: f.fold_data(node.data),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr<F>(f: &mut F, node: crate::Expr) -> crate::Expr
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Expr::Array(_binding_0) => {
- crate::Expr::Array(full!(f.fold_expr_array(_binding_0)))
- }
- crate::Expr::Assign(_binding_0) => {
- crate::Expr::Assign(full!(f.fold_expr_assign(_binding_0)))
- }
- crate::Expr::Async(_binding_0) => {
- crate::Expr::Async(full!(f.fold_expr_async(_binding_0)))
- }
- crate::Expr::Await(_binding_0) => {
- crate::Expr::Await(full!(f.fold_expr_await(_binding_0)))
- }
- crate::Expr::Binary(_binding_0) => {
- crate::Expr::Binary(f.fold_expr_binary(_binding_0))
- }
- crate::Expr::Block(_binding_0) => {
- crate::Expr::Block(full!(f.fold_expr_block(_binding_0)))
- }
- crate::Expr::Break(_binding_0) => {
- crate::Expr::Break(full!(f.fold_expr_break(_binding_0)))
- }
- crate::Expr::Call(_binding_0) => crate::Expr::Call(f.fold_expr_call(_binding_0)),
- crate::Expr::Cast(_binding_0) => crate::Expr::Cast(f.fold_expr_cast(_binding_0)),
- crate::Expr::Closure(_binding_0) => {
- crate::Expr::Closure(full!(f.fold_expr_closure(_binding_0)))
- }
- crate::Expr::Const(_binding_0) => {
- crate::Expr::Const(full!(f.fold_expr_const(_binding_0)))
- }
- crate::Expr::Continue(_binding_0) => {
- crate::Expr::Continue(full!(f.fold_expr_continue(_binding_0)))
- }
- crate::Expr::Field(_binding_0) => {
- crate::Expr::Field(f.fold_expr_field(_binding_0))
- }
- crate::Expr::ForLoop(_binding_0) => {
- crate::Expr::ForLoop(full!(f.fold_expr_for_loop(_binding_0)))
- }
- crate::Expr::Group(_binding_0) => {
- crate::Expr::Group(f.fold_expr_group(_binding_0))
- }
- crate::Expr::If(_binding_0) => crate::Expr::If(full!(f.fold_expr_if(_binding_0))),
- crate::Expr::Index(_binding_0) => {
- crate::Expr::Index(f.fold_expr_index(_binding_0))
- }
- crate::Expr::Infer(_binding_0) => {
- crate::Expr::Infer(full!(f.fold_expr_infer(_binding_0)))
- }
- crate::Expr::Let(_binding_0) => {
- crate::Expr::Let(full!(f.fold_expr_let(_binding_0)))
- }
- crate::Expr::Lit(_binding_0) => crate::Expr::Lit(f.fold_expr_lit(_binding_0)),
- crate::Expr::Loop(_binding_0) => {
- crate::Expr::Loop(full!(f.fold_expr_loop(_binding_0)))
- }
- crate::Expr::Macro(_binding_0) => {
- crate::Expr::Macro(f.fold_expr_macro(_binding_0))
- }
- crate::Expr::Match(_binding_0) => {
- crate::Expr::Match(full!(f.fold_expr_match(_binding_0)))
- }
- crate::Expr::MethodCall(_binding_0) => {
- crate::Expr::MethodCall(f.fold_expr_method_call(_binding_0))
- }
- crate::Expr::Paren(_binding_0) => {
- crate::Expr::Paren(f.fold_expr_paren(_binding_0))
- }
- crate::Expr::Path(_binding_0) => crate::Expr::Path(f.fold_expr_path(_binding_0)),
- crate::Expr::Range(_binding_0) => {
- crate::Expr::Range(full!(f.fold_expr_range(_binding_0)))
- }
- crate::Expr::RawAddr(_binding_0) => {
- crate::Expr::RawAddr(full!(f.fold_expr_raw_addr(_binding_0)))
- }
- crate::Expr::Reference(_binding_0) => {
- crate::Expr::Reference(f.fold_expr_reference(_binding_0))
- }
- crate::Expr::Repeat(_binding_0) => {
- crate::Expr::Repeat(full!(f.fold_expr_repeat(_binding_0)))
- }
- crate::Expr::Return(_binding_0) => {
- crate::Expr::Return(full!(f.fold_expr_return(_binding_0)))
- }
- crate::Expr::Struct(_binding_0) => {
- crate::Expr::Struct(f.fold_expr_struct(_binding_0))
- }
- crate::Expr::Try(_binding_0) => {
- crate::Expr::Try(full!(f.fold_expr_try(_binding_0)))
- }
- crate::Expr::TryBlock(_binding_0) => {
- crate::Expr::TryBlock(full!(f.fold_expr_try_block(_binding_0)))
- }
- crate::Expr::Tuple(_binding_0) => {
- crate::Expr::Tuple(f.fold_expr_tuple(_binding_0))
- }
- crate::Expr::Unary(_binding_0) => {
- crate::Expr::Unary(f.fold_expr_unary(_binding_0))
- }
- crate::Expr::Unsafe(_binding_0) => {
- crate::Expr::Unsafe(full!(f.fold_expr_unsafe(_binding_0)))
- }
- crate::Expr::Verbatim(_binding_0) => {
- crate::Expr::Verbatim(f.fold_token_stream(_binding_0))
- }
- crate::Expr::While(_binding_0) => {
- crate::Expr::While(full!(f.fold_expr_while(_binding_0)))
- }
- crate::Expr::Yield(_binding_0) => {
- crate::Expr::Yield(full!(f.fold_expr_yield(_binding_0)))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_array<F>(f: &mut F, node: crate::ExprArray) -> crate::ExprArray
- where
- F: Fold + ?Sized,
- {
- crate::ExprArray {
- attrs: f.fold_attributes(node.attrs),
- bracket_token: node.bracket_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_expr),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_assign<F>(f: &mut F, node: crate::ExprAssign) -> crate::ExprAssign
- where
- F: Fold + ?Sized,
- {
- crate::ExprAssign {
- attrs: f.fold_attributes(node.attrs),
- left: Box::new(f.fold_expr(*node.left)),
- eq_token: node.eq_token,
- right: Box::new(f.fold_expr(*node.right)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_async<F>(f: &mut F, node: crate::ExprAsync) -> crate::ExprAsync
- where
- F: Fold + ?Sized,
- {
- crate::ExprAsync {
- attrs: f.fold_attributes(node.attrs),
- async_token: node.async_token,
- capture: node.capture,
- block: f.fold_block(node.block),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_await<F>(f: &mut F, node: crate::ExprAwait) -> crate::ExprAwait
- where
- F: Fold + ?Sized,
- {
- crate::ExprAwait {
- attrs: f.fold_attributes(node.attrs),
- base: Box::new(f.fold_expr(*node.base)),
- dot_token: node.dot_token,
- await_token: node.await_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_binary<F>(f: &mut F, node: crate::ExprBinary) -> crate::ExprBinary
- where
- F: Fold + ?Sized,
- {
- crate::ExprBinary {
- attrs: f.fold_attributes(node.attrs),
- left: Box::new(f.fold_expr(*node.left)),
- op: f.fold_bin_op(node.op),
- right: Box::new(f.fold_expr(*node.right)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_block<F>(f: &mut F, node: crate::ExprBlock) -> crate::ExprBlock
- where
- F: Fold + ?Sized,
- {
- crate::ExprBlock {
- attrs: f.fold_attributes(node.attrs),
- label: (node.label).map(|it| f.fold_label(it)),
- block: f.fold_block(node.block),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_break<F>(f: &mut F, node: crate::ExprBreak) -> crate::ExprBreak
- where
- F: Fold + ?Sized,
- {
- crate::ExprBreak {
- attrs: f.fold_attributes(node.attrs),
- break_token: node.break_token,
- label: (node.label).map(|it| f.fold_lifetime(it)),
- expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_call<F>(f: &mut F, node: crate::ExprCall) -> crate::ExprCall
- where
- F: Fold + ?Sized,
- {
- crate::ExprCall {
- attrs: f.fold_attributes(node.attrs),
- func: Box::new(f.fold_expr(*node.func)),
- paren_token: node.paren_token,
- args: crate::punctuated::fold(node.args, f, F::fold_expr),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_cast<F>(f: &mut F, node: crate::ExprCast) -> crate::ExprCast
- where
- F: Fold + ?Sized,
- {
- crate::ExprCast {
- attrs: f.fold_attributes(node.attrs),
- expr: Box::new(f.fold_expr(*node.expr)),
- as_token: node.as_token,
- ty: Box::new(f.fold_type(*node.ty)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_closure<F>(f: &mut F, node: crate::ExprClosure) -> crate::ExprClosure
- where
- F: Fold + ?Sized,
- {
- crate::ExprClosure {
- attrs: f.fold_attributes(node.attrs),
- lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
- constness: node.constness,
- movability: node.movability,
- asyncness: node.asyncness,
- capture: node.capture,
- or1_token: node.or1_token,
- inputs: crate::punctuated::fold(node.inputs, f, F::fold_pat),
- or2_token: node.or2_token,
- output: f.fold_return_type(node.output),
- body: Box::new(f.fold_expr(*node.body)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_const<F>(f: &mut F, node: crate::ExprConst) -> crate::ExprConst
- where
- F: Fold + ?Sized,
- {
- crate::ExprConst {
- attrs: f.fold_attributes(node.attrs),
- const_token: node.const_token,
- block: f.fold_block(node.block),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_continue<F>(f: &mut F, node: crate::ExprContinue) -> crate::ExprContinue
- where
- F: Fold + ?Sized,
- {
- crate::ExprContinue {
- attrs: f.fold_attributes(node.attrs),
- continue_token: node.continue_token,
- label: (node.label).map(|it| f.fold_lifetime(it)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_field<F>(f: &mut F, node: crate::ExprField) -> crate::ExprField
- where
- F: Fold + ?Sized,
- {
- crate::ExprField {
- attrs: f.fold_attributes(node.attrs),
- base: Box::new(f.fold_expr(*node.base)),
- dot_token: node.dot_token,
- member: f.fold_member(node.member),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_for_loop<F>(f: &mut F, node: crate::ExprForLoop) -> crate::ExprForLoop
- where
- F: Fold + ?Sized,
- {
- crate::ExprForLoop {
- attrs: f.fold_attributes(node.attrs),
- label: (node.label).map(|it| f.fold_label(it)),
- for_token: node.for_token,
- pat: Box::new(f.fold_pat(*node.pat)),
- in_token: node.in_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- body: f.fold_block(node.body),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_group<F>(f: &mut F, node: crate::ExprGroup) -> crate::ExprGroup
- where
- F: Fold + ?Sized,
- {
- crate::ExprGroup {
- attrs: f.fold_attributes(node.attrs),
- group_token: node.group_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_if<F>(f: &mut F, node: crate::ExprIf) -> crate::ExprIf
- where
- F: Fold + ?Sized,
- {
- crate::ExprIf {
- attrs: f.fold_attributes(node.attrs),
- if_token: node.if_token,
- cond: Box::new(f.fold_expr(*node.cond)),
- then_branch: f.fold_block(node.then_branch),
- else_branch: (node.else_branch)
- .map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_index<F>(f: &mut F, node: crate::ExprIndex) -> crate::ExprIndex
- where
- F: Fold + ?Sized,
- {
- crate::ExprIndex {
- attrs: f.fold_attributes(node.attrs),
- expr: Box::new(f.fold_expr(*node.expr)),
- bracket_token: node.bracket_token,
- index: Box::new(f.fold_expr(*node.index)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_infer<F>(f: &mut F, node: crate::ExprInfer) -> crate::ExprInfer
- where
- F: Fold + ?Sized,
- {
- crate::ExprInfer {
- attrs: f.fold_attributes(node.attrs),
- underscore_token: node.underscore_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_let<F>(f: &mut F, node: crate::ExprLet) -> crate::ExprLet
- where
- F: Fold + ?Sized,
- {
- crate::ExprLet {
- attrs: f.fold_attributes(node.attrs),
- let_token: node.let_token,
- pat: Box::new(f.fold_pat(*node.pat)),
- eq_token: node.eq_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_lit<F>(f: &mut F, node: crate::ExprLit) -> crate::ExprLit
- where
- F: Fold + ?Sized,
- {
- crate::ExprLit {
- attrs: f.fold_attributes(node.attrs),
- lit: f.fold_lit(node.lit),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_loop<F>(f: &mut F, node: crate::ExprLoop) -> crate::ExprLoop
- where
- F: Fold + ?Sized,
- {
- crate::ExprLoop {
- attrs: f.fold_attributes(node.attrs),
- label: (node.label).map(|it| f.fold_label(it)),
- loop_token: node.loop_token,
- body: f.fold_block(node.body),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_macro<F>(f: &mut F, node: crate::ExprMacro) -> crate::ExprMacro
- where
- F: Fold + ?Sized,
- {
- crate::ExprMacro {
- attrs: f.fold_attributes(node.attrs),
- mac: f.fold_macro(node.mac),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_match<F>(f: &mut F, node: crate::ExprMatch) -> crate::ExprMatch
- where
- F: Fold + ?Sized,
- {
- crate::ExprMatch {
- attrs: f.fold_attributes(node.attrs),
- match_token: node.match_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- brace_token: node.brace_token,
- arms: fold_vec(node.arms, f, F::fold_arm),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_method_call<F>(
- f: &mut F,
- node: crate::ExprMethodCall,
- ) -> crate::ExprMethodCall
- where
- F: Fold + ?Sized,
- {
- crate::ExprMethodCall {
- attrs: f.fold_attributes(node.attrs),
- receiver: Box::new(f.fold_expr(*node.receiver)),
- dot_token: node.dot_token,
- method: f.fold_ident(node.method),
- turbofish: (node.turbofish)
- .map(|it| f.fold_angle_bracketed_generic_arguments(it)),
- paren_token: node.paren_token,
- args: crate::punctuated::fold(node.args, f, F::fold_expr),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_paren<F>(f: &mut F, node: crate::ExprParen) -> crate::ExprParen
- where
- F: Fold + ?Sized,
- {
- crate::ExprParen {
- attrs: f.fold_attributes(node.attrs),
- paren_token: node.paren_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_path<F>(f: &mut F, node: crate::ExprPath) -> crate::ExprPath
- where
- F: Fold + ?Sized,
- {
- crate::ExprPath {
- attrs: f.fold_attributes(node.attrs),
- qself: (node.qself).map(|it| f.fold_qself(it)),
- path: f.fold_path(node.path),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_range<F>(f: &mut F, node: crate::ExprRange) -> crate::ExprRange
- where
- F: Fold + ?Sized,
- {
- crate::ExprRange {
- attrs: f.fold_attributes(node.attrs),
- start: (node.start).map(|it| Box::new(f.fold_expr(*it))),
- limits: f.fold_range_limits(node.limits),
- end: (node.end).map(|it| Box::new(f.fold_expr(*it))),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_raw_addr<F>(f: &mut F, node: crate::ExprRawAddr) -> crate::ExprRawAddr
- where
- F: Fold + ?Sized,
- {
- crate::ExprRawAddr {
- attrs: f.fold_attributes(node.attrs),
- and_token: node.and_token,
- raw: node.raw,
- mutability: f.fold_pointer_mutability(node.mutability),
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_reference<F>(
- f: &mut F,
- node: crate::ExprReference,
- ) -> crate::ExprReference
- where
- F: Fold + ?Sized,
- {
- crate::ExprReference {
- attrs: f.fold_attributes(node.attrs),
- and_token: node.and_token,
- mutability: node.mutability,
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_repeat<F>(f: &mut F, node: crate::ExprRepeat) -> crate::ExprRepeat
- where
- F: Fold + ?Sized,
- {
- crate::ExprRepeat {
- attrs: f.fold_attributes(node.attrs),
- bracket_token: node.bracket_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- semi_token: node.semi_token,
- len: Box::new(f.fold_expr(*node.len)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_return<F>(f: &mut F, node: crate::ExprReturn) -> crate::ExprReturn
- where
- F: Fold + ?Sized,
- {
- crate::ExprReturn {
- attrs: f.fold_attributes(node.attrs),
- return_token: node.return_token,
- expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_struct<F>(f: &mut F, node: crate::ExprStruct) -> crate::ExprStruct
- where
- F: Fold + ?Sized,
- {
- crate::ExprStruct {
- attrs: f.fold_attributes(node.attrs),
- qself: (node.qself).map(|it| f.fold_qself(it)),
- path: f.fold_path(node.path),
- brace_token: node.brace_token,
- fields: crate::punctuated::fold(node.fields, f, F::fold_field_value),
- dot2_token: node.dot2_token,
- rest: (node.rest).map(|it| Box::new(f.fold_expr(*it))),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_try<F>(f: &mut F, node: crate::ExprTry) -> crate::ExprTry
- where
- F: Fold + ?Sized,
- {
- crate::ExprTry {
- attrs: f.fold_attributes(node.attrs),
- expr: Box::new(f.fold_expr(*node.expr)),
- question_token: node.question_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_try_block<F>(
- f: &mut F,
- node: crate::ExprTryBlock,
- ) -> crate::ExprTryBlock
- where
- F: Fold + ?Sized,
- {
- crate::ExprTryBlock {
- attrs: f.fold_attributes(node.attrs),
- try_token: node.try_token,
- block: f.fold_block(node.block),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_tuple<F>(f: &mut F, node: crate::ExprTuple) -> crate::ExprTuple
- where
- F: Fold + ?Sized,
- {
- crate::ExprTuple {
- attrs: f.fold_attributes(node.attrs),
- paren_token: node.paren_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_expr),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_expr_unary<F>(f: &mut F, node: crate::ExprUnary) -> crate::ExprUnary
- where
- F: Fold + ?Sized,
- {
- crate::ExprUnary {
- attrs: f.fold_attributes(node.attrs),
- op: f.fold_un_op(node.op),
- expr: Box::new(f.fold_expr(*node.expr)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_unsafe<F>(f: &mut F, node: crate::ExprUnsafe) -> crate::ExprUnsafe
- where
- F: Fold + ?Sized,
- {
- crate::ExprUnsafe {
- attrs: f.fold_attributes(node.attrs),
- unsafe_token: node.unsafe_token,
- block: f.fold_block(node.block),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_while<F>(f: &mut F, node: crate::ExprWhile) -> crate::ExprWhile
- where
- F: Fold + ?Sized,
- {
- crate::ExprWhile {
- attrs: f.fold_attributes(node.attrs),
- label: (node.label).map(|it| f.fold_label(it)),
- while_token: node.while_token,
- cond: Box::new(f.fold_expr(*node.cond)),
- body: f.fold_block(node.body),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_expr_yield<F>(f: &mut F, node: crate::ExprYield) -> crate::ExprYield
- where
- F: Fold + ?Sized,
- {
- crate::ExprYield {
- attrs: f.fold_attributes(node.attrs),
- yield_token: node.yield_token,
- expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_field<F>(f: &mut F, node: crate::Field) -> crate::Field
- where
- F: Fold + ?Sized,
- {
- crate::Field {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- mutability: f.fold_field_mutability(node.mutability),
- ident: (node.ident).map(|it| f.fold_ident(it)),
- colon_token: node.colon_token,
- ty: f.fold_type(node.ty),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_field_mutability<F>(
- f: &mut F,
- node: crate::FieldMutability,
- ) -> crate::FieldMutability
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::FieldMutability::None => crate::FieldMutability::None,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_field_pat<F>(f: &mut F, node: crate::FieldPat) -> crate::FieldPat
- where
- F: Fold + ?Sized,
- {
- crate::FieldPat {
- attrs: f.fold_attributes(node.attrs),
- member: f.fold_member(node.member),
- colon_token: node.colon_token,
- pat: Box::new(f.fold_pat(*node.pat)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_field_value<F>(f: &mut F, node: crate::FieldValue) -> crate::FieldValue
- where
- F: Fold + ?Sized,
- {
- crate::FieldValue {
- attrs: f.fold_attributes(node.attrs),
- member: f.fold_member(node.member),
- colon_token: node.colon_token,
- expr: f.fold_expr(node.expr),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_fields<F>(f: &mut F, node: crate::Fields) -> crate::Fields
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Fields::Named(_binding_0) => {
- crate::Fields::Named(f.fold_fields_named(_binding_0))
- }
- crate::Fields::Unnamed(_binding_0) => {
- crate::Fields::Unnamed(f.fold_fields_unnamed(_binding_0))
- }
- crate::Fields::Unit => crate::Fields::Unit,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_fields_named<F>(f: &mut F, node: crate::FieldsNamed) -> crate::FieldsNamed
- where
- F: Fold + ?Sized,
- {
- crate::FieldsNamed {
- brace_token: node.brace_token,
- named: crate::punctuated::fold(node.named, f, F::fold_field),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_fields_unnamed<F>(
- f: &mut F,
- node: crate::FieldsUnnamed,
- ) -> crate::FieldsUnnamed
- where
- F: Fold + ?Sized,
- {
- crate::FieldsUnnamed {
- paren_token: node.paren_token,
- unnamed: crate::punctuated::fold(node.unnamed, f, F::fold_field),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_file<F>(f: &mut F, node: crate::File) -> crate::File
- where
- F: Fold + ?Sized,
- {
- crate::File {
- shebang: node.shebang,
- attrs: f.fold_attributes(node.attrs),
- items: fold_vec(node.items, f, F::fold_item),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_fn_arg<F>(f: &mut F, node: crate::FnArg) -> crate::FnArg
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::FnArg::Receiver(_binding_0) => {
- crate::FnArg::Receiver(f.fold_receiver(_binding_0))
- }
- crate::FnArg::Typed(_binding_0) => {
- crate::FnArg::Typed(f.fold_pat_type(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_foreign_item<F>(f: &mut F, node: crate::ForeignItem) -> crate::ForeignItem
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::ForeignItem::Fn(_binding_0) => {
- crate::ForeignItem::Fn(f.fold_foreign_item_fn(_binding_0))
- }
- crate::ForeignItem::Static(_binding_0) => {
- crate::ForeignItem::Static(f.fold_foreign_item_static(_binding_0))
- }
- crate::ForeignItem::Type(_binding_0) => {
- crate::ForeignItem::Type(f.fold_foreign_item_type(_binding_0))
- }
- crate::ForeignItem::Macro(_binding_0) => {
- crate::ForeignItem::Macro(f.fold_foreign_item_macro(_binding_0))
- }
- crate::ForeignItem::Verbatim(_binding_0) => {
- crate::ForeignItem::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_foreign_item_fn<F>(
- f: &mut F,
- node: crate::ForeignItemFn,
- ) -> crate::ForeignItemFn
- where
- F: Fold + ?Sized,
- {
- crate::ForeignItemFn {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- sig: f.fold_signature(node.sig),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_foreign_item_macro<F>(
- f: &mut F,
- node: crate::ForeignItemMacro,
- ) -> crate::ForeignItemMacro
- where
- F: Fold + ?Sized,
- {
- crate::ForeignItemMacro {
- attrs: f.fold_attributes(node.attrs),
- mac: f.fold_macro(node.mac),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_foreign_item_static<F>(
- f: &mut F,
- node: crate::ForeignItemStatic,
- ) -> crate::ForeignItemStatic
- where
- F: Fold + ?Sized,
- {
- crate::ForeignItemStatic {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- static_token: node.static_token,
- mutability: f.fold_static_mutability(node.mutability),
- ident: f.fold_ident(node.ident),
- colon_token: node.colon_token,
- ty: Box::new(f.fold_type(*node.ty)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_foreign_item_type<F>(
- f: &mut F,
- node: crate::ForeignItemType,
- ) -> crate::ForeignItemType
- where
- F: Fold + ?Sized,
- {
- crate::ForeignItemType {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- type_token: node.type_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- semi_token: node.semi_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_generic_argument<F>(
- f: &mut F,
- node: crate::GenericArgument,
- ) -> crate::GenericArgument
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::GenericArgument::Lifetime(_binding_0) => {
- crate::GenericArgument::Lifetime(f.fold_lifetime(_binding_0))
- }
- crate::GenericArgument::Type(_binding_0) => {
- crate::GenericArgument::Type(f.fold_type(_binding_0))
- }
- crate::GenericArgument::Const(_binding_0) => {
- crate::GenericArgument::Const(f.fold_expr(_binding_0))
- }
- crate::GenericArgument::AssocType(_binding_0) => {
- crate::GenericArgument::AssocType(f.fold_assoc_type(_binding_0))
- }
- crate::GenericArgument::AssocConst(_binding_0) => {
- crate::GenericArgument::AssocConst(f.fold_assoc_const(_binding_0))
- }
- crate::GenericArgument::Constraint(_binding_0) => {
- crate::GenericArgument::Constraint(f.fold_constraint(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_generic_param<F>(f: &mut F, node: crate::GenericParam) -> crate::GenericParam
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::GenericParam::Lifetime(_binding_0) => {
- crate::GenericParam::Lifetime(f.fold_lifetime_param(_binding_0))
- }
- crate::GenericParam::Type(_binding_0) => {
- crate::GenericParam::Type(f.fold_type_param(_binding_0))
- }
- crate::GenericParam::Const(_binding_0) => {
- crate::GenericParam::Const(f.fold_const_param(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_generics<F>(f: &mut F, node: crate::Generics) -> crate::Generics
- where
- F: Fold + ?Sized,
- {
- crate::Generics {
- lt_token: node.lt_token,
- params: crate::punctuated::fold(node.params, f, F::fold_generic_param),
- gt_token: node.gt_token,
- where_clause: (node.where_clause).map(|it| f.fold_where_clause(it)),
- }
- }
- pub fn fold_ident<F>(f: &mut F, node: proc_macro2::Ident) -> proc_macro2::Ident
- where
- F: Fold + ?Sized,
- {
- let mut node = node;
- let span = f.fold_span(node.span());
- node.set_span(span);
- node
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_item<F>(f: &mut F, node: crate::ImplItem) -> crate::ImplItem
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::ImplItem::Const(_binding_0) => {
- crate::ImplItem::Const(f.fold_impl_item_const(_binding_0))
- }
- crate::ImplItem::Fn(_binding_0) => {
- crate::ImplItem::Fn(f.fold_impl_item_fn(_binding_0))
- }
- crate::ImplItem::Type(_binding_0) => {
- crate::ImplItem::Type(f.fold_impl_item_type(_binding_0))
- }
- crate::ImplItem::Macro(_binding_0) => {
- crate::ImplItem::Macro(f.fold_impl_item_macro(_binding_0))
- }
- crate::ImplItem::Verbatim(_binding_0) => {
- crate::ImplItem::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_item_const<F>(
- f: &mut F,
- node: crate::ImplItemConst,
- ) -> crate::ImplItemConst
- where
- F: Fold + ?Sized,
- {
- crate::ImplItemConst {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- defaultness: node.defaultness,
- const_token: node.const_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- colon_token: node.colon_token,
- ty: f.fold_type(node.ty),
- eq_token: node.eq_token,
- expr: f.fold_expr(node.expr),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_item_fn<F>(f: &mut F, node: crate::ImplItemFn) -> crate::ImplItemFn
- where
- F: Fold + ?Sized,
- {
- crate::ImplItemFn {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- defaultness: node.defaultness,
- sig: f.fold_signature(node.sig),
- block: f.fold_block(node.block),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_item_macro<F>(
- f: &mut F,
- node: crate::ImplItemMacro,
- ) -> crate::ImplItemMacro
- where
- F: Fold + ?Sized,
- {
- crate::ImplItemMacro {
- attrs: f.fold_attributes(node.attrs),
- mac: f.fold_macro(node.mac),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_item_type<F>(
- f: &mut F,
- node: crate::ImplItemType,
- ) -> crate::ImplItemType
- where
- F: Fold + ?Sized,
- {
- crate::ImplItemType {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- defaultness: node.defaultness,
- type_token: node.type_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- eq_token: node.eq_token,
- ty: f.fold_type(node.ty),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_impl_restriction<F>(
- f: &mut F,
- node: crate::ImplRestriction,
- ) -> crate::ImplRestriction
- where
- F: Fold + ?Sized,
- {
- match node {}
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_index<F>(f: &mut F, node: crate::Index) -> crate::Index
- where
- F: Fold + ?Sized,
- {
- crate::Index {
- index: node.index,
- span: f.fold_span(node.span),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item<F>(f: &mut F, node: crate::Item) -> crate::Item
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Item::Const(_binding_0) => {
- crate::Item::Const(f.fold_item_const(_binding_0))
- }
- crate::Item::Enum(_binding_0) => crate::Item::Enum(f.fold_item_enum(_binding_0)),
- crate::Item::ExternCrate(_binding_0) => {
- crate::Item::ExternCrate(f.fold_item_extern_crate(_binding_0))
- }
- crate::Item::Fn(_binding_0) => crate::Item::Fn(f.fold_item_fn(_binding_0)),
- crate::Item::ForeignMod(_binding_0) => {
- crate::Item::ForeignMod(f.fold_item_foreign_mod(_binding_0))
- }
- crate::Item::Impl(_binding_0) => crate::Item::Impl(f.fold_item_impl(_binding_0)),
- crate::Item::Macro(_binding_0) => {
- crate::Item::Macro(f.fold_item_macro(_binding_0))
- }
- crate::Item::Mod(_binding_0) => crate::Item::Mod(f.fold_item_mod(_binding_0)),
- crate::Item::Static(_binding_0) => {
- crate::Item::Static(f.fold_item_static(_binding_0))
- }
- crate::Item::Struct(_binding_0) => {
- crate::Item::Struct(f.fold_item_struct(_binding_0))
- }
- crate::Item::Trait(_binding_0) => {
- crate::Item::Trait(f.fold_item_trait(_binding_0))
- }
- crate::Item::TraitAlias(_binding_0) => {
- crate::Item::TraitAlias(f.fold_item_trait_alias(_binding_0))
- }
- crate::Item::Type(_binding_0) => crate::Item::Type(f.fold_item_type(_binding_0)),
- crate::Item::Union(_binding_0) => {
- crate::Item::Union(f.fold_item_union(_binding_0))
- }
- crate::Item::Use(_binding_0) => crate::Item::Use(f.fold_item_use(_binding_0)),
- crate::Item::Verbatim(_binding_0) => {
- crate::Item::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_const<F>(f: &mut F, node: crate::ItemConst) -> crate::ItemConst
- where
- F: Fold + ?Sized,
- {
- crate::ItemConst {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- const_token: node.const_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- colon_token: node.colon_token,
- ty: Box::new(f.fold_type(*node.ty)),
- eq_token: node.eq_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_enum<F>(f: &mut F, node: crate::ItemEnum) -> crate::ItemEnum
- where
- F: Fold + ?Sized,
- {
- crate::ItemEnum {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- enum_token: node.enum_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- brace_token: node.brace_token,
- variants: crate::punctuated::fold(node.variants, f, F::fold_variant),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_extern_crate<F>(
- f: &mut F,
- node: crate::ItemExternCrate,
- ) -> crate::ItemExternCrate
- where
- F: Fold + ?Sized,
- {
- crate::ItemExternCrate {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- extern_token: node.extern_token,
- crate_token: node.crate_token,
- ident: f.fold_ident(node.ident),
- rename: (node.rename).map(|it| ((it).0, f.fold_ident((it).1))),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_fn<F>(f: &mut F, node: crate::ItemFn) -> crate::ItemFn
- where
- F: Fold + ?Sized,
- {
- crate::ItemFn {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- sig: f.fold_signature(node.sig),
- block: Box::new(f.fold_block(*node.block)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_foreign_mod<F>(
- f: &mut F,
- node: crate::ItemForeignMod,
- ) -> crate::ItemForeignMod
- where
- F: Fold + ?Sized,
- {
- crate::ItemForeignMod {
- attrs: f.fold_attributes(node.attrs),
- unsafety: node.unsafety,
- abi: f.fold_abi(node.abi),
- brace_token: node.brace_token,
- items: fold_vec(node.items, f, F::fold_foreign_item),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_impl<F>(f: &mut F, node: crate::ItemImpl) -> crate::ItemImpl
- where
- F: Fold + ?Sized,
- {
- crate::ItemImpl {
- attrs: f.fold_attributes(node.attrs),
- defaultness: node.defaultness,
- unsafety: node.unsafety,
- impl_token: node.impl_token,
- generics: f.fold_generics(node.generics),
- trait_: (node.trait_).map(|it| ((it).0, f.fold_path((it).1), (it).2)),
- self_ty: Box::new(f.fold_type(*node.self_ty)),
- brace_token: node.brace_token,
- items: fold_vec(node.items, f, F::fold_impl_item),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_macro<F>(f: &mut F, node: crate::ItemMacro) -> crate::ItemMacro
- where
- F: Fold + ?Sized,
- {
- crate::ItemMacro {
- attrs: f.fold_attributes(node.attrs),
- ident: (node.ident).map(|it| f.fold_ident(it)),
- mac: f.fold_macro(node.mac),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_mod<F>(f: &mut F, node: crate::ItemMod) -> crate::ItemMod
- where
- F: Fold + ?Sized,
- {
- crate::ItemMod {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- unsafety: node.unsafety,
- mod_token: node.mod_token,
- ident: f.fold_ident(node.ident),
- content: (node.content).map(|it| ((it).0, fold_vec((it).1, f, F::fold_item))),
- semi: node.semi,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_static<F>(f: &mut F, node: crate::ItemStatic) -> crate::ItemStatic
- where
- F: Fold + ?Sized,
- {
- crate::ItemStatic {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- static_token: node.static_token,
- mutability: f.fold_static_mutability(node.mutability),
- ident: f.fold_ident(node.ident),
- colon_token: node.colon_token,
- ty: Box::new(f.fold_type(*node.ty)),
- eq_token: node.eq_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_struct<F>(f: &mut F, node: crate::ItemStruct) -> crate::ItemStruct
- where
- F: Fold + ?Sized,
- {
- crate::ItemStruct {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- struct_token: node.struct_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- fields: f.fold_fields(node.fields),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_trait<F>(f: &mut F, node: crate::ItemTrait) -> crate::ItemTrait
- where
- F: Fold + ?Sized,
- {
- crate::ItemTrait {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- unsafety: node.unsafety,
- auto_token: node.auto_token,
- restriction: (node.restriction).map(|it| f.fold_impl_restriction(it)),
- trait_token: node.trait_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- colon_token: node.colon_token,
- supertraits: crate::punctuated::fold(
- node.supertraits,
- f,
- F::fold_type_param_bound,
- ),
- brace_token: node.brace_token,
- items: fold_vec(node.items, f, F::fold_trait_item),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_trait_alias<F>(
- f: &mut F,
- node: crate::ItemTraitAlias,
- ) -> crate::ItemTraitAlias
- where
- F: Fold + ?Sized,
- {
- crate::ItemTraitAlias {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- trait_token: node.trait_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- eq_token: node.eq_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_type<F>(f: &mut F, node: crate::ItemType) -> crate::ItemType
- where
- F: Fold + ?Sized,
- {
- crate::ItemType {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- type_token: node.type_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- eq_token: node.eq_token,
- ty: Box::new(f.fold_type(*node.ty)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_union<F>(f: &mut F, node: crate::ItemUnion) -> crate::ItemUnion
- where
- F: Fold + ?Sized,
- {
- crate::ItemUnion {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- union_token: node.union_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- fields: f.fold_fields_named(node.fields),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_item_use<F>(f: &mut F, node: crate::ItemUse) -> crate::ItemUse
- where
- F: Fold + ?Sized,
- {
- crate::ItemUse {
- attrs: f.fold_attributes(node.attrs),
- vis: f.fold_visibility(node.vis),
- use_token: node.use_token,
- leading_colon: node.leading_colon,
- tree: f.fold_use_tree(node.tree),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_label<F>(f: &mut F, node: crate::Label) -> crate::Label
- where
- F: Fold + ?Sized,
- {
- crate::Label {
- name: f.fold_lifetime(node.name),
- colon_token: node.colon_token,
- }
- }
- pub fn fold_lifetime<F>(f: &mut F, node: crate::Lifetime) -> crate::Lifetime
- where
- F: Fold + ?Sized,
- {
- crate::Lifetime {
- apostrophe: f.fold_span(node.apostrophe),
- ident: f.fold_ident(node.ident),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_lifetime_param<F>(
- f: &mut F,
- node: crate::LifetimeParam,
- ) -> crate::LifetimeParam
- where
- F: Fold + ?Sized,
- {
- crate::LifetimeParam {
- attrs: f.fold_attributes(node.attrs),
- lifetime: f.fold_lifetime(node.lifetime),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_lifetime),
- }
- }
- pub fn fold_lit<F>(f: &mut F, node: crate::Lit) -> crate::Lit
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Lit::Str(_binding_0) => crate::Lit::Str(f.fold_lit_str(_binding_0)),
- crate::Lit::ByteStr(_binding_0) => {
- crate::Lit::ByteStr(f.fold_lit_byte_str(_binding_0))
- }
- crate::Lit::CStr(_binding_0) => crate::Lit::CStr(f.fold_lit_cstr(_binding_0)),
- crate::Lit::Byte(_binding_0) => crate::Lit::Byte(f.fold_lit_byte(_binding_0)),
- crate::Lit::Char(_binding_0) => crate::Lit::Char(f.fold_lit_char(_binding_0)),
- crate::Lit::Int(_binding_0) => crate::Lit::Int(f.fold_lit_int(_binding_0)),
- crate::Lit::Float(_binding_0) => crate::Lit::Float(f.fold_lit_float(_binding_0)),
- crate::Lit::Bool(_binding_0) => crate::Lit::Bool(f.fold_lit_bool(_binding_0)),
- crate::Lit::Verbatim(_binding_0) => crate::Lit::Verbatim(_binding_0),
- }
- }
- pub fn fold_lit_bool<F>(f: &mut F, node: crate::LitBool) -> crate::LitBool
- where
- F: Fold + ?Sized,
- {
- crate::LitBool {
- value: node.value,
- span: f.fold_span(node.span),
- }
- }
- pub fn fold_lit_byte<F>(f: &mut F, node: crate::LitByte) -> crate::LitByte
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_byte_str<F>(f: &mut F, node: crate::LitByteStr) -> crate::LitByteStr
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_cstr<F>(f: &mut F, node: crate::LitCStr) -> crate::LitCStr
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_char<F>(f: &mut F, node: crate::LitChar) -> crate::LitChar
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_float<F>(f: &mut F, node: crate::LitFloat) -> crate::LitFloat
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_int<F>(f: &mut F, node: crate::LitInt) -> crate::LitInt
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- pub fn fold_lit_str<F>(f: &mut F, node: crate::LitStr) -> crate::LitStr
- where
- F: Fold + ?Sized,
- {
- let span = f.fold_span(node.span());
- let mut node = node;
- node.set_span(span);
- node
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_local<F>(f: &mut F, node: crate::Local) -> crate::Local
- where
- F: Fold + ?Sized,
- {
- crate::Local {
- attrs: f.fold_attributes(node.attrs),
- let_token: node.let_token,
- pat: f.fold_pat(node.pat),
- init: (node.init).map(|it| f.fold_local_init(it)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_local_init<F>(f: &mut F, node: crate::LocalInit) -> crate::LocalInit
- where
- F: Fold + ?Sized,
- {
- crate::LocalInit {
- eq_token: node.eq_token,
- expr: Box::new(f.fold_expr(*node.expr)),
- diverge: (node.diverge).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_macro<F>(f: &mut F, node: crate::Macro) -> crate::Macro
- where
- F: Fold + ?Sized,
- {
- crate::Macro {
- path: f.fold_path(node.path),
- bang_token: node.bang_token,
- delimiter: f.fold_macro_delimiter(node.delimiter),
- tokens: f.fold_token_stream(node.tokens),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_macro_delimiter<F>(
- f: &mut F,
- node: crate::MacroDelimiter,
- ) -> crate::MacroDelimiter
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::MacroDelimiter::Paren(_binding_0) => {
- crate::MacroDelimiter::Paren(_binding_0)
- }
- crate::MacroDelimiter::Brace(_binding_0) => {
- crate::MacroDelimiter::Brace(_binding_0)
- }
- crate::MacroDelimiter::Bracket(_binding_0) => {
- crate::MacroDelimiter::Bracket(_binding_0)
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_member<F>(f: &mut F, node: crate::Member) -> crate::Member
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Member::Named(_binding_0) => {
- crate::Member::Named(f.fold_ident(_binding_0))
- }
- crate::Member::Unnamed(_binding_0) => {
- crate::Member::Unnamed(f.fold_index(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_meta<F>(f: &mut F, node: crate::Meta) -> crate::Meta
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Meta::Path(_binding_0) => crate::Meta::Path(f.fold_path(_binding_0)),
- crate::Meta::List(_binding_0) => crate::Meta::List(f.fold_meta_list(_binding_0)),
- crate::Meta::NameValue(_binding_0) => {
- crate::Meta::NameValue(f.fold_meta_name_value(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_meta_list<F>(f: &mut F, node: crate::MetaList) -> crate::MetaList
- where
- F: Fold + ?Sized,
- {
- crate::MetaList {
- path: f.fold_path(node.path),
- delimiter: f.fold_macro_delimiter(node.delimiter),
- tokens: f.fold_token_stream(node.tokens),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_meta_name_value<F>(
- f: &mut F,
- node: crate::MetaNameValue,
- ) -> crate::MetaNameValue
- where
- F: Fold + ?Sized,
- {
- crate::MetaNameValue {
- path: f.fold_path(node.path),
- eq_token: node.eq_token,
- value: f.fold_expr(node.value),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_parenthesized_generic_arguments<F>(
- f: &mut F,
- node: crate::ParenthesizedGenericArguments,
- ) -> crate::ParenthesizedGenericArguments
- where
- F: Fold + ?Sized,
- {
- crate::ParenthesizedGenericArguments {
- paren_token: node.paren_token,
- inputs: crate::punctuated::fold(node.inputs, f, F::fold_type),
- output: f.fold_return_type(node.output),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat<F>(f: &mut F, node: crate::Pat) -> crate::Pat
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Pat::Const(_binding_0) => crate::Pat::Const(f.fold_expr_const(_binding_0)),
- crate::Pat::Ident(_binding_0) => crate::Pat::Ident(f.fold_pat_ident(_binding_0)),
- crate::Pat::Lit(_binding_0) => crate::Pat::Lit(f.fold_expr_lit(_binding_0)),
- crate::Pat::Macro(_binding_0) => crate::Pat::Macro(f.fold_expr_macro(_binding_0)),
- crate::Pat::Or(_binding_0) => crate::Pat::Or(f.fold_pat_or(_binding_0)),
- crate::Pat::Paren(_binding_0) => crate::Pat::Paren(f.fold_pat_paren(_binding_0)),
- crate::Pat::Path(_binding_0) => crate::Pat::Path(f.fold_expr_path(_binding_0)),
- crate::Pat::Range(_binding_0) => crate::Pat::Range(f.fold_expr_range(_binding_0)),
- crate::Pat::Reference(_binding_0) => {
- crate::Pat::Reference(f.fold_pat_reference(_binding_0))
- }
- crate::Pat::Rest(_binding_0) => crate::Pat::Rest(f.fold_pat_rest(_binding_0)),
- crate::Pat::Slice(_binding_0) => crate::Pat::Slice(f.fold_pat_slice(_binding_0)),
- crate::Pat::Struct(_binding_0) => {
- crate::Pat::Struct(f.fold_pat_struct(_binding_0))
- }
- crate::Pat::Tuple(_binding_0) => crate::Pat::Tuple(f.fold_pat_tuple(_binding_0)),
- crate::Pat::TupleStruct(_binding_0) => {
- crate::Pat::TupleStruct(f.fold_pat_tuple_struct(_binding_0))
- }
- crate::Pat::Type(_binding_0) => crate::Pat::Type(f.fold_pat_type(_binding_0)),
- crate::Pat::Verbatim(_binding_0) => {
- crate::Pat::Verbatim(f.fold_token_stream(_binding_0))
- }
- crate::Pat::Wild(_binding_0) => crate::Pat::Wild(f.fold_pat_wild(_binding_0)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_ident<F>(f: &mut F, node: crate::PatIdent) -> crate::PatIdent
- where
- F: Fold + ?Sized,
- {
- crate::PatIdent {
- attrs: f.fold_attributes(node.attrs),
- by_ref: node.by_ref,
- mutability: node.mutability,
- ident: f.fold_ident(node.ident),
- subpat: (node.subpat).map(|it| ((it).0, Box::new(f.fold_pat(*(it).1)))),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_or<F>(f: &mut F, node: crate::PatOr) -> crate::PatOr
- where
- F: Fold + ?Sized,
- {
- crate::PatOr {
- attrs: f.fold_attributes(node.attrs),
- leading_vert: node.leading_vert,
- cases: crate::punctuated::fold(node.cases, f, F::fold_pat),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_paren<F>(f: &mut F, node: crate::PatParen) -> crate::PatParen
- where
- F: Fold + ?Sized,
- {
- crate::PatParen {
- attrs: f.fold_attributes(node.attrs),
- paren_token: node.paren_token,
- pat: Box::new(f.fold_pat(*node.pat)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_reference<F>(f: &mut F, node: crate::PatReference) -> crate::PatReference
- where
- F: Fold + ?Sized,
- {
- crate::PatReference {
- attrs: f.fold_attributes(node.attrs),
- and_token: node.and_token,
- mutability: node.mutability,
- pat: Box::new(f.fold_pat(*node.pat)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_rest<F>(f: &mut F, node: crate::PatRest) -> crate::PatRest
- where
- F: Fold + ?Sized,
- {
- crate::PatRest {
- attrs: f.fold_attributes(node.attrs),
- dot2_token: node.dot2_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_slice<F>(f: &mut F, node: crate::PatSlice) -> crate::PatSlice
- where
- F: Fold + ?Sized,
- {
- crate::PatSlice {
- attrs: f.fold_attributes(node.attrs),
- bracket_token: node.bracket_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_struct<F>(f: &mut F, node: crate::PatStruct) -> crate::PatStruct
- where
- F: Fold + ?Sized,
- {
- crate::PatStruct {
- attrs: f.fold_attributes(node.attrs),
- qself: (node.qself).map(|it| f.fold_qself(it)),
- path: f.fold_path(node.path),
- brace_token: node.brace_token,
- fields: crate::punctuated::fold(node.fields, f, F::fold_field_pat),
- rest: (node.rest).map(|it| f.fold_pat_rest(it)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_tuple<F>(f: &mut F, node: crate::PatTuple) -> crate::PatTuple
- where
- F: Fold + ?Sized,
- {
- crate::PatTuple {
- attrs: f.fold_attributes(node.attrs),
- paren_token: node.paren_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_tuple_struct<F>(
- f: &mut F,
- node: crate::PatTupleStruct,
- ) -> crate::PatTupleStruct
- where
- F: Fold + ?Sized,
- {
- crate::PatTupleStruct {
- attrs: f.fold_attributes(node.attrs),
- qself: (node.qself).map(|it| f.fold_qself(it)),
- path: f.fold_path(node.path),
- paren_token: node.paren_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_type<F>(f: &mut F, node: crate::PatType) -> crate::PatType
- where
- F: Fold + ?Sized,
- {
- crate::PatType {
- attrs: f.fold_attributes(node.attrs),
- pat: Box::new(f.fold_pat(*node.pat)),
- colon_token: node.colon_token,
- ty: Box::new(f.fold_type(*node.ty)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pat_wild<F>(f: &mut F, node: crate::PatWild) -> crate::PatWild
- where
- F: Fold + ?Sized,
- {
- crate::PatWild {
- attrs: f.fold_attributes(node.attrs),
- underscore_token: node.underscore_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_path<F>(f: &mut F, node: crate::Path) -> crate::Path
- where
- F: Fold + ?Sized,
- {
- crate::Path {
- leading_colon: node.leading_colon,
- segments: crate::punctuated::fold(node.segments, f, F::fold_path_segment),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_path_arguments<F>(
- f: &mut F,
- node: crate::PathArguments,
- ) -> crate::PathArguments
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::PathArguments::None => crate::PathArguments::None,
- crate::PathArguments::AngleBracketed(_binding_0) => {
- crate::PathArguments::AngleBracketed(
- f.fold_angle_bracketed_generic_arguments(_binding_0),
- )
- }
- crate::PathArguments::Parenthesized(_binding_0) => {
- crate::PathArguments::Parenthesized(
- f.fold_parenthesized_generic_arguments(_binding_0),
- )
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_path_segment<F>(f: &mut F, node: crate::PathSegment) -> crate::PathSegment
- where
- F: Fold + ?Sized,
- {
- crate::PathSegment {
- ident: f.fold_ident(node.ident),
- arguments: f.fold_path_arguments(node.arguments),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_pointer_mutability<F>(
- f: &mut F,
- node: crate::PointerMutability,
- ) -> crate::PointerMutability
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::PointerMutability::Const(_binding_0) => {
- crate::PointerMutability::Const(_binding_0)
- }
- crate::PointerMutability::Mut(_binding_0) => {
- crate::PointerMutability::Mut(_binding_0)
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_precise_capture<F>(
- f: &mut F,
- node: crate::PreciseCapture,
- ) -> crate::PreciseCapture
- where
- F: Fold + ?Sized,
- {
- crate::PreciseCapture {
- use_token: node.use_token,
- lt_token: node.lt_token,
- params: crate::punctuated::fold(node.params, f, F::fold_captured_param),
- gt_token: node.gt_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_predicate_lifetime<F>(
- f: &mut F,
- node: crate::PredicateLifetime,
- ) -> crate::PredicateLifetime
- where
- F: Fold + ?Sized,
- {
- crate::PredicateLifetime {
- lifetime: f.fold_lifetime(node.lifetime),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_lifetime),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_predicate_type<F>(
- f: &mut F,
- node: crate::PredicateType,
- ) -> crate::PredicateType
- where
- F: Fold + ?Sized,
- {
- crate::PredicateType {
- lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
- bounded_ty: f.fold_type(node.bounded_ty),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_qself<F>(f: &mut F, node: crate::QSelf) -> crate::QSelf
- where
- F: Fold + ?Sized,
- {
- crate::QSelf {
- lt_token: node.lt_token,
- ty: Box::new(f.fold_type(*node.ty)),
- position: node.position,
- as_token: node.as_token,
- gt_token: node.gt_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_range_limits<F>(f: &mut F, node: crate::RangeLimits) -> crate::RangeLimits
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::RangeLimits::HalfOpen(_binding_0) => {
- crate::RangeLimits::HalfOpen(_binding_0)
- }
- crate::RangeLimits::Closed(_binding_0) => crate::RangeLimits::Closed(_binding_0),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_receiver<F>(f: &mut F, node: crate::Receiver) -> crate::Receiver
- where
- F: Fold + ?Sized,
- {
- crate::Receiver {
- attrs: f.fold_attributes(node.attrs),
- reference: (node.reference)
- .map(|it| ((it).0, ((it).1).map(|it| f.fold_lifetime(it)))),
- mutability: node.mutability,
- self_token: node.self_token,
- colon_token: node.colon_token,
- ty: Box::new(f.fold_type(*node.ty)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_return_type<F>(f: &mut F, node: crate::ReturnType) -> crate::ReturnType
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::ReturnType::Default => crate::ReturnType::Default,
- crate::ReturnType::Type(_binding_0, _binding_1) => {
- crate::ReturnType::Type(_binding_0, Box::new(f.fold_type(*_binding_1)))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_signature<F>(f: &mut F, node: crate::Signature) -> crate::Signature
- where
- F: Fold + ?Sized,
- {
- crate::Signature {
- constness: node.constness,
- asyncness: node.asyncness,
- unsafety: node.unsafety,
- abi: (node.abi).map(|it| f.fold_abi(it)),
- fn_token: node.fn_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- paren_token: node.paren_token,
- inputs: crate::punctuated::fold(node.inputs, f, F::fold_fn_arg),
- variadic: (node.variadic).map(|it| f.fold_variadic(it)),
- output: f.fold_return_type(node.output),
- }
- }
- pub fn fold_span<F>(f: &mut F, node: proc_macro2::Span) -> proc_macro2::Span
- where
- F: Fold + ?Sized,
- {
- node
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_static_mutability<F>(
- f: &mut F,
- node: crate::StaticMutability,
- ) -> crate::StaticMutability
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::StaticMutability::Mut(_binding_0) => {
- crate::StaticMutability::Mut(_binding_0)
- }
- crate::StaticMutability::None => crate::StaticMutability::None,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_stmt<F>(f: &mut F, node: crate::Stmt) -> crate::Stmt
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Stmt::Local(_binding_0) => crate::Stmt::Local(f.fold_local(_binding_0)),
- crate::Stmt::Item(_binding_0) => crate::Stmt::Item(f.fold_item(_binding_0)),
- crate::Stmt::Expr(_binding_0, _binding_1) => {
- crate::Stmt::Expr(f.fold_expr(_binding_0), _binding_1)
- }
- crate::Stmt::Macro(_binding_0) => {
- crate::Stmt::Macro(f.fold_stmt_macro(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_stmt_macro<F>(f: &mut F, node: crate::StmtMacro) -> crate::StmtMacro
- where
- F: Fold + ?Sized,
- {
- crate::StmtMacro {
- attrs: f.fold_attributes(node.attrs),
- mac: f.fold_macro(node.mac),
- semi_token: node.semi_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_trait_bound<F>(f: &mut F, node: crate::TraitBound) -> crate::TraitBound
- where
- F: Fold + ?Sized,
- {
- crate::TraitBound {
- paren_token: node.paren_token,
- modifier: f.fold_trait_bound_modifier(node.modifier),
- lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
- path: f.fold_path(node.path),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_trait_bound_modifier<F>(
- f: &mut F,
- node: crate::TraitBoundModifier,
- ) -> crate::TraitBoundModifier
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::TraitBoundModifier::None => crate::TraitBoundModifier::None,
- crate::TraitBoundModifier::Maybe(_binding_0) => {
- crate::TraitBoundModifier::Maybe(_binding_0)
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_trait_item<F>(f: &mut F, node: crate::TraitItem) -> crate::TraitItem
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::TraitItem::Const(_binding_0) => {
- crate::TraitItem::Const(f.fold_trait_item_const(_binding_0))
- }
- crate::TraitItem::Fn(_binding_0) => {
- crate::TraitItem::Fn(f.fold_trait_item_fn(_binding_0))
- }
- crate::TraitItem::Type(_binding_0) => {
- crate::TraitItem::Type(f.fold_trait_item_type(_binding_0))
- }
- crate::TraitItem::Macro(_binding_0) => {
- crate::TraitItem::Macro(f.fold_trait_item_macro(_binding_0))
- }
- crate::TraitItem::Verbatim(_binding_0) => {
- crate::TraitItem::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_trait_item_const<F>(
- f: &mut F,
- node: crate::TraitItemConst,
- ) -> crate::TraitItemConst
- where
- F: Fold + ?Sized,
- {
- crate::TraitItemConst {
- attrs: f.fold_attributes(node.attrs),
- const_token: node.const_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- colon_token: node.colon_token,
- ty: f.fold_type(node.ty),
- default: (node.default).map(|it| ((it).0, f.fold_expr((it).1))),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_trait_item_fn<F>(f: &mut F, node: crate::TraitItemFn) -> crate::TraitItemFn
- where
- F: Fold + ?Sized,
- {
- crate::TraitItemFn {
- attrs: f.fold_attributes(node.attrs),
- sig: f.fold_signature(node.sig),
- default: (node.default).map(|it| f.fold_block(it)),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_trait_item_macro<F>(
- f: &mut F,
- node: crate::TraitItemMacro,
- ) -> crate::TraitItemMacro
- where
- F: Fold + ?Sized,
- {
- crate::TraitItemMacro {
- attrs: f.fold_attributes(node.attrs),
- mac: f.fold_macro(node.mac),
- semi_token: node.semi_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_trait_item_type<F>(
- f: &mut F,
- node: crate::TraitItemType,
- ) -> crate::TraitItemType
- where
- F: Fold + ?Sized,
- {
- crate::TraitItemType {
- attrs: f.fold_attributes(node.attrs),
- type_token: node.type_token,
- ident: f.fold_ident(node.ident),
- generics: f.fold_generics(node.generics),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- default: (node.default).map(|it| ((it).0, f.fold_type((it).1))),
- semi_token: node.semi_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type<F>(f: &mut F, node: crate::Type) -> crate::Type
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Type::Array(_binding_0) => {
- crate::Type::Array(f.fold_type_array(_binding_0))
- }
- crate::Type::BareFn(_binding_0) => {
- crate::Type::BareFn(f.fold_type_bare_fn(_binding_0))
- }
- crate::Type::Group(_binding_0) => {
- crate::Type::Group(f.fold_type_group(_binding_0))
- }
- crate::Type::ImplTrait(_binding_0) => {
- crate::Type::ImplTrait(f.fold_type_impl_trait(_binding_0))
- }
- crate::Type::Infer(_binding_0) => {
- crate::Type::Infer(f.fold_type_infer(_binding_0))
- }
- crate::Type::Macro(_binding_0) => {
- crate::Type::Macro(f.fold_type_macro(_binding_0))
- }
- crate::Type::Never(_binding_0) => {
- crate::Type::Never(f.fold_type_never(_binding_0))
- }
- crate::Type::Paren(_binding_0) => {
- crate::Type::Paren(f.fold_type_paren(_binding_0))
- }
- crate::Type::Path(_binding_0) => crate::Type::Path(f.fold_type_path(_binding_0)),
- crate::Type::Ptr(_binding_0) => crate::Type::Ptr(f.fold_type_ptr(_binding_0)),
- crate::Type::Reference(_binding_0) => {
- crate::Type::Reference(f.fold_type_reference(_binding_0))
- }
- crate::Type::Slice(_binding_0) => {
- crate::Type::Slice(f.fold_type_slice(_binding_0))
- }
- crate::Type::TraitObject(_binding_0) => {
- crate::Type::TraitObject(f.fold_type_trait_object(_binding_0))
- }
- crate::Type::Tuple(_binding_0) => {
- crate::Type::Tuple(f.fold_type_tuple(_binding_0))
- }
- crate::Type::Verbatim(_binding_0) => {
- crate::Type::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_array<F>(f: &mut F, node: crate::TypeArray) -> crate::TypeArray
- where
- F: Fold + ?Sized,
- {
- crate::TypeArray {
- bracket_token: node.bracket_token,
- elem: Box::new(f.fold_type(*node.elem)),
- semi_token: node.semi_token,
- len: f.fold_expr(node.len),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_bare_fn<F>(f: &mut F, node: crate::TypeBareFn) -> crate::TypeBareFn
- where
- F: Fold + ?Sized,
- {
- crate::TypeBareFn {
- lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
- unsafety: node.unsafety,
- abi: (node.abi).map(|it| f.fold_abi(it)),
- fn_token: node.fn_token,
- paren_token: node.paren_token,
- inputs: crate::punctuated::fold(node.inputs, f, F::fold_bare_fn_arg),
- variadic: (node.variadic).map(|it| f.fold_bare_variadic(it)),
- output: f.fold_return_type(node.output),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_group<F>(f: &mut F, node: crate::TypeGroup) -> crate::TypeGroup
- where
- F: Fold + ?Sized,
- {
- crate::TypeGroup {
- group_token: node.group_token,
- elem: Box::new(f.fold_type(*node.elem)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_impl_trait<F>(
- f: &mut F,
- node: crate::TypeImplTrait,
- ) -> crate::TypeImplTrait
- where
- F: Fold + ?Sized,
- {
- crate::TypeImplTrait {
- impl_token: node.impl_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_infer<F>(f: &mut F, node: crate::TypeInfer) -> crate::TypeInfer
- where
- F: Fold + ?Sized,
- {
- crate::TypeInfer {
- underscore_token: node.underscore_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_macro<F>(f: &mut F, node: crate::TypeMacro) -> crate::TypeMacro
- where
- F: Fold + ?Sized,
- {
- crate::TypeMacro {
- mac: f.fold_macro(node.mac),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_never<F>(f: &mut F, node: crate::TypeNever) -> crate::TypeNever
- where
- F: Fold + ?Sized,
- {
- crate::TypeNever {
- bang_token: node.bang_token,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_param<F>(f: &mut F, node: crate::TypeParam) -> crate::TypeParam
- where
- F: Fold + ?Sized,
- {
- crate::TypeParam {
- attrs: f.fold_attributes(node.attrs),
- ident: f.fold_ident(node.ident),
- colon_token: node.colon_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- eq_token: node.eq_token,
- default: (node.default).map(|it| f.fold_type(it)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_param_bound<F>(
- f: &mut F,
- node: crate::TypeParamBound,
- ) -> crate::TypeParamBound
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::TypeParamBound::Trait(_binding_0) => {
- crate::TypeParamBound::Trait(f.fold_trait_bound(_binding_0))
- }
- crate::TypeParamBound::Lifetime(_binding_0) => {
- crate::TypeParamBound::Lifetime(f.fold_lifetime(_binding_0))
- }
- crate::TypeParamBound::PreciseCapture(_binding_0) => {
- crate::TypeParamBound::PreciseCapture(
- full!(f.fold_precise_capture(_binding_0)),
- )
- }
- crate::TypeParamBound::Verbatim(_binding_0) => {
- crate::TypeParamBound::Verbatim(f.fold_token_stream(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_paren<F>(f: &mut F, node: crate::TypeParen) -> crate::TypeParen
- where
- F: Fold + ?Sized,
- {
- crate::TypeParen {
- paren_token: node.paren_token,
- elem: Box::new(f.fold_type(*node.elem)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_path<F>(f: &mut F, node: crate::TypePath) -> crate::TypePath
- where
- F: Fold + ?Sized,
- {
- crate::TypePath {
- qself: (node.qself).map(|it| f.fold_qself(it)),
- path: f.fold_path(node.path),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_ptr<F>(f: &mut F, node: crate::TypePtr) -> crate::TypePtr
- where
- F: Fold + ?Sized,
- {
- crate::TypePtr {
- star_token: node.star_token,
- const_token: node.const_token,
- mutability: node.mutability,
- elem: Box::new(f.fold_type(*node.elem)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_reference<F>(
- f: &mut F,
- node: crate::TypeReference,
- ) -> crate::TypeReference
- where
- F: Fold + ?Sized,
- {
- crate::TypeReference {
- and_token: node.and_token,
- lifetime: (node.lifetime).map(|it| f.fold_lifetime(it)),
- mutability: node.mutability,
- elem: Box::new(f.fold_type(*node.elem)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_slice<F>(f: &mut F, node: crate::TypeSlice) -> crate::TypeSlice
- where
- F: Fold + ?Sized,
- {
- crate::TypeSlice {
- bracket_token: node.bracket_token,
- elem: Box::new(f.fold_type(*node.elem)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_trait_object<F>(
- f: &mut F,
- node: crate::TypeTraitObject,
- ) -> crate::TypeTraitObject
- where
- F: Fold + ?Sized,
- {
- crate::TypeTraitObject {
- dyn_token: node.dyn_token,
- bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_type_tuple<F>(f: &mut F, node: crate::TypeTuple) -> crate::TypeTuple
- where
- F: Fold + ?Sized,
- {
- crate::TypeTuple {
- paren_token: node.paren_token,
- elems: crate::punctuated::fold(node.elems, f, F::fold_type),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_un_op<F>(f: &mut F, node: crate::UnOp) -> crate::UnOp
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::UnOp::Deref(_binding_0) => crate::UnOp::Deref(_binding_0),
- crate::UnOp::Not(_binding_0) => crate::UnOp::Not(_binding_0),
- crate::UnOp::Neg(_binding_0) => crate::UnOp::Neg(_binding_0),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_glob<F>(f: &mut F, node: crate::UseGlob) -> crate::UseGlob
- where
- F: Fold + ?Sized,
- {
- crate::UseGlob {
- star_token: node.star_token,
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_group<F>(f: &mut F, node: crate::UseGroup) -> crate::UseGroup
- where
- F: Fold + ?Sized,
- {
- crate::UseGroup {
- brace_token: node.brace_token,
- items: crate::punctuated::fold(node.items, f, F::fold_use_tree),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_name<F>(f: &mut F, node: crate::UseName) -> crate::UseName
- where
- F: Fold + ?Sized,
- {
- crate::UseName {
- ident: f.fold_ident(node.ident),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_path<F>(f: &mut F, node: crate::UsePath) -> crate::UsePath
- where
- F: Fold + ?Sized,
- {
- crate::UsePath {
- ident: f.fold_ident(node.ident),
- colon2_token: node.colon2_token,
- tree: Box::new(f.fold_use_tree(*node.tree)),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_rename<F>(f: &mut F, node: crate::UseRename) -> crate::UseRename
- where
- F: Fold + ?Sized,
- {
- crate::UseRename {
- ident: f.fold_ident(node.ident),
- as_token: node.as_token,
- rename: f.fold_ident(node.rename),
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_use_tree<F>(f: &mut F, node: crate::UseTree) -> crate::UseTree
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::UseTree::Path(_binding_0) => {
- crate::UseTree::Path(f.fold_use_path(_binding_0))
- }
- crate::UseTree::Name(_binding_0) => {
- crate::UseTree::Name(f.fold_use_name(_binding_0))
- }
- crate::UseTree::Rename(_binding_0) => {
- crate::UseTree::Rename(f.fold_use_rename(_binding_0))
- }
- crate::UseTree::Glob(_binding_0) => {
- crate::UseTree::Glob(f.fold_use_glob(_binding_0))
- }
- crate::UseTree::Group(_binding_0) => {
- crate::UseTree::Group(f.fold_use_group(_binding_0))
- }
- }
- }
- #[cfg(feature = "full")]
- #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
- pub fn fold_variadic<F>(f: &mut F, node: crate::Variadic) -> crate::Variadic
- where
- F: Fold + ?Sized,
- {
- crate::Variadic {
- attrs: f.fold_attributes(node.attrs),
- pat: (node.pat).map(|it| (Box::new(f.fold_pat(*(it).0)), (it).1)),
- dots: node.dots,
- comma: node.comma,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_variant<F>(f: &mut F, node: crate::Variant) -> crate::Variant
- where
- F: Fold + ?Sized,
- {
- crate::Variant {
- attrs: f.fold_attributes(node.attrs),
- ident: f.fold_ident(node.ident),
- fields: f.fold_fields(node.fields),
- discriminant: (node.discriminant).map(|it| ((it).0, f.fold_expr((it).1))),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_vis_restricted<F>(
- f: &mut F,
- node: crate::VisRestricted,
- ) -> crate::VisRestricted
- where
- F: Fold + ?Sized,
- {
- crate::VisRestricted {
- pub_token: node.pub_token,
- paren_token: node.paren_token,
- in_token: node.in_token,
- path: Box::new(f.fold_path(*node.path)),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_visibility<F>(f: &mut F, node: crate::Visibility) -> crate::Visibility
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::Visibility::Public(_binding_0) => crate::Visibility::Public(_binding_0),
- crate::Visibility::Restricted(_binding_0) => {
- crate::Visibility::Restricted(f.fold_vis_restricted(_binding_0))
- }
- crate::Visibility::Inherited => crate::Visibility::Inherited,
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_where_clause<F>(f: &mut F, node: crate::WhereClause) -> crate::WhereClause
- where
- F: Fold + ?Sized,
- {
- crate::WhereClause {
- where_token: node.where_token,
- predicates: crate::punctuated::fold(node.predicates, f, F::fold_where_predicate),
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
- pub fn fold_where_predicate<F>(
- f: &mut F,
- node: crate::WherePredicate,
- ) -> crate::WherePredicate
- where
- F: Fold + ?Sized,
- {
- match node {
- crate::WherePredicate::Lifetime(_binding_0) => {
- crate::WherePredicate::Lifetime(f.fold_predicate_lifetime(_binding_0))
- }
- crate::WherePredicate::Type(_binding_0) => {
- crate::WherePredicate::Type(f.fold_predicate_type(_binding_0))
- }
- }
- }
- #[cfg(any(feature = "derive", feature = "full"))]
- fn fold_vec<T, V, F>(vec: Vec<T>, fold: &mut V, mut f: F) -> Vec<T>
- where
- V: ?Sized,
- F: FnMut(&mut V, T) -> T,
- {
- vec.into_iter().map(|it| f(fold, it)).collect()
- }
|