Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e02f133
move intrinsics codegen tests into a seperate folder
lcnr Jun 4, 2019
4c44d4a
improve test indentation
lcnr Jun 4, 2019
36601f6
Windows 10 SDK is also required now.
sfengyuan Jun 5, 2019
1cf662e
rephrase
sfengyuan Jun 7, 2019
3d6070d
Neutralize link
sfengyuan Jun 7, 2019
50e0c6c
Delete Rustbook step
Mark-Simulacrum Jun 7, 2019
e70e9c4
Delete unnecessary command
Mark-Simulacrum Jun 7, 2019
0e64a94
Inline prepare_tool_cmd
Mark-Simulacrum Jun 7, 2019
147246c
Make RemoteTestServer a bootstrap tool
Mark-Simulacrum Jun 7, 2019
b15cb0f
Delete unused fields on Crate struct
Mark-Simulacrum Jun 7, 2019
e4c44c7
Remove unnecessary Std dependency
Mark-Simulacrum Jun 7, 2019
41e976b
Azure: retry failed awscli installs
wesleywiser Jun 10, 2019
e3516a1
librustc_errors: Add some more documentation
phansch Jun 9, 2019
33137ff
Address review comments
phansch Jun 10, 2019
7b97cf9
make sure to_ascii_lowercase actually leaves upper-case non-ASCII cha…
RalfJung Jun 10, 2019
9ed4674
typeck: Fix const generic in repeat param ICE.
davidtwco Jun 9, 2019
d3461bf
core: use memcmp optimization for 128 bit integer slices
aschampion Jun 10, 2019
8eb7f36
std: Remove internal definitions of `cfg_if!` macro
alexcrichton Jun 10, 2019
97f4e70
syntax: Remove `SyntaxExtension::IdentTT` and `IdentMacroExpander`
petrochenkov Jun 6, 2019
5a6ebec
syntax: Remove `SyntaxExtension::MultiDecorator` and `MultiItemDecora…
petrochenkov Jun 6, 2019
edb925a
syntax: Use `MultiItemModifier` for built-in derives
petrochenkov Jun 6, 2019
8edbbac
syntax: Remove `SyntaxExtension::DeclMacro`
petrochenkov Jun 6, 2019
0468eb6
syntax: Improve documentation of `SyntaxExtension`
petrochenkov Jun 6, 2019
93eb63c
syntax: Rename variants of `SyntaxExtension` for consistency
petrochenkov Jun 6, 2019
c127f53
Use `for_each` in `Iterator::partition`
cuviper Jun 10, 2019
44033a7
Rollup merge of #61526 - lcnr:test_reorder, r=nikomatsakis
Centril Jun 11, 2019
c426fa5
Rollup merge of #61550 - jacobsun:patch-1, r=alexcrichton
Centril Jun 11, 2019
c6c9f66
Rollup merge of #61606 - petrochenkov:legclean, r=pnkfelix
Centril Jun 11, 2019
d3abd6c
Rollup merge of #61639 - Mark-Simulacrum:bootstrap-cleanup, r=alexcri…
Centril Jun 11, 2019
2c642de
Rollup merge of #61686 - phansch:librustc_errors_docs, r=estebank
Centril Jun 11, 2019
4f6aa0d
Rollup merge of #61698 - davidtwco:ice-const-generic-length, r=varkor
Centril Jun 11, 2019
a845141
Rollup merge of #61707 - wesleywiser:awscli_retry, r=alexcrichton
Centril Jun 11, 2019
503a790
Rollup merge of #61715 - RalfJung:test-ascii-lowercase, r=varkor
Centril Jun 11, 2019
5fa30ca
Rollup merge of #61720 - alexcrichton:libstd-cfg-if-dep, r=sfackler
Centril Jun 11, 2019
e294c42
Rollup merge of #61724 - aschampion:128-bit-memcmp, r=sfackler
Centril Jun 11, 2019
5837b9f
Rollup merge of #61726 - cuviper:partition-for_each, r=scottmcm
Centril Jun 11, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
syntax: Remove SyntaxExtension::IdentTT and IdentMacroExpander
  • Loading branch information
petrochenkov committed Jun 10, 2019
commit 97f4e700c20ccc95f4e9ed3d2c9d368cbc4be445
5 changes: 1 addition & 4 deletions src/librustc_plugin/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc::lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint};
use rustc::session::Session;
use rustc::util::nodemap::FxHashMap;

use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT, IdentTT};
use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT};
use syntax::ext::base::MacroExpanderFn;
use syntax::symbol::{Symbol, sym};
use syntax::ast;
Expand Down Expand Up @@ -109,9 +109,6 @@ impl<'a> Registry<'a> {
edition,
}
}
IdentTT { expander, span: _, allow_internal_unstable } => {
IdentTT { expander, span: Some(self.krate_span), allow_internal_unstable }
}
_ => extension,
}));
}
Expand Down
38 changes: 0 additions & 38 deletions src/libsyntax/ext/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,34 +288,6 @@ impl<F> TTMacroExpander for F
}
}

pub trait IdentMacroExpander {
fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt<'_>,
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree>)
-> Box<dyn MacResult+'cx>;
}

pub type IdentMacroExpanderFn =
for<'cx> fn(&'cx mut ExtCtxt<'_>, Span, ast::Ident, Vec<tokenstream::TokenTree>)
-> Box<dyn MacResult+'cx>;

impl<F> IdentMacroExpander for F
where F : for<'cx> Fn(&'cx mut ExtCtxt<'_>, Span, ast::Ident,
Vec<tokenstream::TokenTree>) -> Box<dyn MacResult+'cx>
{
fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt<'_>,
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree>)
-> Box<dyn MacResult+'cx>
{
(*self)(cx, sp, ident, token_tree)
}
}

// Use a macro because forwarding to a simple function has type system issues
macro_rules! make_stmts_default {
($me:expr) => {
Expand Down Expand Up @@ -658,14 +630,6 @@ pub enum SyntaxExtension {
edition: Edition,
},

/// A function-like syntax extension that has an extra ident before
/// the block.
IdentTT {
expander: Box<dyn IdentMacroExpander + sync::Sync + sync::Send>,
span: Option<Span>,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
},

/// An attribute-like procedural macro. TokenStream -> TokenStream.
/// The input is the annotated item.
/// Allows generating code to implement a Trait for a given struct
Expand All @@ -691,7 +655,6 @@ impl SyntaxExtension {
match *self {
SyntaxExtension::DeclMacro { .. } |
SyntaxExtension::NormalTT { .. } |
SyntaxExtension::IdentTT { .. } |
SyntaxExtension::ProcMacro { .. } =>
MacroKind::Bang,
SyntaxExtension::NonMacroAttr { .. } |
Expand Down Expand Up @@ -725,7 +688,6 @@ impl SyntaxExtension {
SyntaxExtension::ProcMacroDerive(.., edition) => edition,
// Unstable legacy stuff
SyntaxExtension::NonMacroAttr { .. } |
SyntaxExtension::IdentTT { .. } |
SyntaxExtension::MultiDecorator(..) |
SyntaxExtension::MultiModifier(..) |
SyntaxExtension::BuiltinDerive(..) => default_edition,
Expand Down
22 changes: 0 additions & 22 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,28 +791,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
}
}

IdentTT { ref expander, span: tt_span, ref allow_internal_unstable } => {
if ident.name == kw::Invalid {
self.cx.span_err(path.span,
&format!("macro {}! expects an ident argument", path));
self.cx.trace_macros_diag();
kind.dummy(span)
} else {
invoc.expansion_data.mark.set_expn_info(ExpnInfo {
call_site: span,
def_site: tt_span,
format: macro_bang_format(path),
allow_internal_unstable: allow_internal_unstable.clone(),
allow_internal_unsafe: false,
local_inner_macros: false,
edition: self.cx.parse_sess.edition,
});

let input: Vec<_> = mac.node.stream().into_trees().collect();
kind.make_from(expander.expand(self.cx, span, ident, input))
}
}

MultiDecorator(..) | MultiModifier(..) |
AttrProcMacro(..) | SyntaxExtension::NonMacroAttr { .. } => {
self.cx.span_err(path.span,
Expand Down