Skip to content

Commit b680c58

Browse files
committed
chore: Remove unneeded code, adapt TODOs for pr-time
1 parent 903d6d3 commit b680c58

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
@@ -141,8 +141,8 @@ impl fmt::Debug for LazyAttrTokenStream {
141141

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

compiler/rustc_expand/src/base.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,9 +1073,6 @@ pub trait ResolverExpand {
10731073
trait_def_id: DefId,
10741074
impl_def_id: LocalDefId,
10751075
) -> Result<Vec<(Ident, Option<Ident>)>, Indeterminate>;
1076-
1077-
fn register_proc_macro_invoc(&mut self, invoc_id: LocalExpnId, ext: Lrc<SyntaxExtension>);
1078-
fn unregister_proc_macro_invoc(&mut self, invoc_id: LocalExpnId);
10791076
}
10801077

10811078
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
@@ -797,14 +797,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
797797
span,
798798
path,
799799
};
800-
self.cx
801-
.resolver
802-
.register_proc_macro_invoc(invoc.expansion_data.id, ext.clone());
803800
invoc.expansion_data.id.expn_data();
804801
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
805802
ExpandResult::Ready(items) => items,
806803
ExpandResult::Retry(item) => {
807-
self.cx.resolver.unregister_proc_macro_invoc(invoc.expansion_data.id);
808804
// Reassemble the original invocation for retrying.
809805
return ExpandResult::Retry(Invocation {
810806
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
@@ -534,14 +534,6 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
534534
});
535535
Ok(idents)
536536
}
537-
538-
fn register_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId, _ext: Lrc<SyntaxExtension>) {
539-
// TODO: dunno if need this yet
540-
}
541-
542-
fn unregister_proc_macro_invoc(&mut self, _invoc_id: LocalExpnId) {
543-
// TODO: dunno if need this yet
544-
}
545537
}
546538

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

0 commit comments

Comments
 (0)