Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Auto merge of #17 - erickt:master, r=erickt
Browse files Browse the repository at this point in the history
fix(syntex_syntax): Don't expand builtin derive decorators
  • Loading branch information
homu committed Nov 1, 2015
2 parents f721e3e + dc176ef commit 80b52b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion syntex_syntax/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "syntex_syntax"
version = "0.19.0"
version = "0.19.1"
authors = [ "[email protected]" ]
license = "MIT/Apache-2.0"
description = "Export of libsyntax for code generation"
Expand Down
6 changes: 5 additions & 1 deletion syntex_syntax/src/ext/deriving/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use ast::{MetaItem, MetaWord};
use attr::AttrMetaMethods;
use ext::base::{ExtCtxt, SyntaxEnv, MultiDecorator, MultiItemDecorator, MultiModifier, Annotatable};
use ext::base::{ExtCtxt, SyntaxEnv, MultiModifier, Annotatable};
use ext::build::AstBuilder;
use feature_gate;
use codemap::Span;
Expand Down Expand Up @@ -127,6 +127,7 @@ macro_rules! derive_traits {
($( $name:expr => $func:path, )+) => {
pub fn register_all(env: &mut SyntaxEnv) {
// Define the #[derive_*] extensions.
/* Syntex shouldn't expand the builtin decorators.
$({
struct DeriveExtension;
Expand All @@ -145,6 +146,7 @@ macro_rules! derive_traits {
env.insert(intern(concat!("derive_", $name)),
MultiDecorator(Box::new(DeriveExtension)));
})+
*/

env.insert(intern("derive"),
MultiModifier(Box::new(expand_derive)));
Expand Down Expand Up @@ -188,6 +190,7 @@ derive_traits! {
"Decodable" => decodable::expand_deriving_decodable,
}

/*
#[inline] // because `name` is a compile-time constant
fn warn_if_deprecated(ecx: &mut ExtCtxt, sp: Span, name: &str) {
if let Some(replacement) = match name {
Expand All @@ -199,3 +202,4 @@ fn warn_if_deprecated(ecx: &mut ExtCtxt, sp: Span, name: &str) {
name, replacement));
}
}
*/

0 comments on commit 80b52b0

Please sign in to comment.