Skip to content

Commit fe36059

Browse files
committed
chore: Remove unneeded code, adapt TODOs for pr-time
1 parent 209fd8a commit fe36059

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
@@ -1074,9 +1074,6 @@ pub trait ResolverExpand {
10741074
trait_def_id: DefId,
10751075
impl_def_id: LocalDefId,
10761076
) -> Result<Vec<(Ident, Option<Ident>)>, Indeterminate>;
1077-
1078-
fn register_proc_macro_invoc(&mut self, invoc_id: LocalExpnId, ext: Lrc<SyntaxExtension>);
1079-
fn unregister_proc_macro_invoc(&mut self, invoc_id: LocalExpnId);
10801077
}
10811078

10821079
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
@@ -796,14 +796,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
796796
span,
797797
path,
798798
};
799-
self.cx
800-
.resolver
801-
.register_proc_macro_invoc(invoc.expansion_data.id, ext.clone());
802799
invoc.expansion_data.id.expn_data();
803800
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
804801
ExpandResult::Ready(items) => items,
805802
ExpandResult::Retry(item) => {
806-
self.cx.resolver.unregister_proc_macro_invoc(invoc.expansion_data.id);
807803
// Reassemble the original invocation for retrying.
808804
return ExpandResult::Retry(Invocation {
809805
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)