Skip to content

Commit 2a0d576

Browse files
committed
chore: Remove unneeded code, adapt TODOs for pr-time
1 parent 178ff99 commit 2a0d576

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
@@ -1072,9 +1072,6 @@ pub trait ResolverExpand {
10721072
trait_def_id: DefId,
10731073
impl_def_id: LocalDefId,
10741074
) -> Result<Vec<(Ident, Option<Ident>)>, Indeterminate>;
1075-
1076-
fn register_proc_macro_invoc(&mut self, invoc_id: LocalExpnId, ext: Lrc<SyntaxExtension>);
1077-
fn unregister_proc_macro_invoc(&mut self, invoc_id: LocalExpnId);
10781075
}
10791076

10801077
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
@@ -794,14 +794,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
794794
span,
795795
path,
796796
};
797-
self.cx
798-
.resolver
799-
.register_proc_macro_invoc(invoc.expansion_data.id, ext.clone());
800797
invoc.expansion_data.id.expn_data();
801798
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
802799
ExpandResult::Ready(items) => items,
803800
ExpandResult::Retry(item) => {
804-
self.cx.resolver.unregister_proc_macro_invoc(invoc.expansion_data.id);
805801
// Reassemble the original invocation for retrying.
806802
return ExpandResult::Retry(Invocation {
807803
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);
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
@@ -526,14 +526,6 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
526526
});
527527
Ok(idents)
528528
}
529-
530-
fn register_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId, _ext: Lrc<SyntaxExtension>) {
531-
// TODO: dunno if need this yet
532-
}
533-
534-
fn unregister_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId) {
535-
// TODO: dunno if need this yet
536-
}
537529
}
538530

539531
impl<'a, 'tcx> Resolver<'a, 'tcx> {

0 commit comments

Comments
 (0)