Skip to content

Commit efb8f71

Browse files
committed
chore: Remove unneeded code, adapt TODOs for pr-time
1 parent fdc7d63 commit efb8f71

File tree

6 files changed

+6
-21
lines changed

6 files changed

+6
-21
lines changed

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ impl fmt::Debug for LazyAttrTokenStream {
142142

143143
impl<S: SpanEncoder> Encodable<S> for LazyAttrTokenStream {
144144
fn encode(&self, s: &mut S) {
145-
// TODO: welp
146-
// TODO: (also) `.flattened()` here?
145+
// TODO(pr-time): welp, do we really want this impl? maybe newtype wrapper?
146+
// TODO(pr-time): (also) `.flattened()` here?
147147
self.to_attr_token_stream().encode(s)
148148
}
149149
}

compiler/rustc_expand/src/base.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,6 @@ pub trait ResolverExpand {
11161116
trait_def_id: DefId,
11171117
impl_def_id: LocalDefId,
11181118
) -> Result<Vec<(Ident, Option<Ident>)>, Indeterminate>;
1119-
1120-
fn register_proc_macro_invoc(&mut self, invoc_id: LocalExpnId, ext: Lrc<SyntaxExtension>);
1121-
fn unregister_proc_macro_invoc(&mut self, invoc_id: LocalExpnId);
11221119
}
11231120

11241121
pub trait LintStoreExpand {

compiler/rustc_expand/src/derive_macro_expansion.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(super) fn provide_derive_macro_expansion<'tcx>(
2525
let strategy = crate::proc_macro::exec_strategy(ecx);
2626
let server = crate::proc_macro_server::Rustc::new(ecx);
2727
let res = match client.run(&strategy, server, input.clone(), proc_macro_backtrace) {
28-
// TODO: without flattened some (weird) tests fail, but no idea if it's correct/enough
28+
// TODO(pr-time): without flattened some (weird) tests fail, but no idea if it's correct/enough
2929
Ok(stream) => Ok(tcx.arena.alloc(stream.flattened()) as &TokenStream),
3030
Err(e) => {
3131
ecx.dcx().emit_err({
@@ -99,11 +99,11 @@ where
9999
} else {
100100
// We could get an `CONTEXT` pointer from another thread.
101101
// Ensure that `CONTEXT` is `DynSync`.
102-
// TODO: we should not be able to?
102+
// TODO(pr-time): we should not be able to?
103103
// sync::assert_dyn_sync::<CONTEXT<'_>>();
104104

105105
// prevent double entering, as that would allow creating two `&mut ExtCtxt`s
106-
// TODO: probably use a RefCell instead (which checks this properly)?
106+
// TODO(pr-time): probably use a RefCell instead (which checks this properly)?
107107
enter_context_erased((ptr::null_mut(), None), || unsafe {
108108
let ectx = downcast(ectx);
109109
f(Some(&mut (ectx, client_opt.unwrap())))

compiler/rustc_expand/src/expand.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,14 +818,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
818818
span,
819819
path,
820820
};
821-
self.cx
822-
.resolver
823-
.register_proc_macro_invoc(invoc.expansion_data.id, ext.clone());
824821
invoc.expansion_data.id.expn_data();
825822
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
826823
ExpandResult::Ready(items) => items,
827824
ExpandResult::Retry(item) => {
828-
self.cx.resolver.unregister_proc_macro_invoc(invoc.expansion_data.id);
829825
// Reassemble the original invocation for retrying.
830826
return ExpandResult::Retry(Invocation {
831827
kind: InvocationKind::Derive { path: meta.path, item, is_const },

compiler/rustc_expand/src/proc_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl MultiItemModifier for DeriveProcMacro {
126126
crate::base::ann_pretty_printing_compatibility_hack(&item, &ecx.sess.psess);
127127
let input = item.to_tokens();
128128
let res = ty::tls::with(|tcx| {
129-
// TODO: without flattened some (weird) tests fail, but no idea if it's correct/enough
129+
// TODO(pr-time): without flattened some (weird) tests fail, but no idea if it's correct/enough
130130
let input = tcx.arena.alloc(input.flattened()) as &TokenStream;
131131
let invoc_id = ecx.current_expansion.id;
132132

compiler/rustc_resolve/src/macros.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,6 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
508508
});
509509
Ok(idents)
510510
}
511-
512-
fn register_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId, _ext: Lrc<SyntaxExtension>) {
513-
// TODO: dunno if need this yet
514-
}
515-
516-
fn unregister_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId) {
517-
// TODO: dunno if need this yet
518-
}
519511
}
520512

521513
impl<'ra, 'tcx> Resolver<'ra, 'tcx> {

0 commit comments

Comments
 (0)