Skip to content

Commit 50acfd9

Browse files
committed
Auto merge of serde-deprecated#71 - dtolnay:cfg, r=erickt
Reimplement derive to work with cfg_attr Fixes serde-rs/serde#148. The implementation expands `cfg_attr` and `derive` in-line during decorator expansion rather than as pre/post-expansion passes. I think this is a simpler and more correct design, but at the expense of being more invasive into the libsyntax code.
2 parents 4f96f88 + b57c45d commit 50acfd9

File tree

7 files changed

+206
-378
lines changed

7 files changed

+206
-378
lines changed

syntex/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
extern crate syntex_syntax;
22

3-
mod squash_derive;
4-
53
use std::fs::File;
64
use std::io::{self, Write};
75
use std::path::Path;
@@ -175,7 +173,6 @@ impl Registry {
175173
let ecx = ExtCtxt::new(&sess, cfg, ecfg, &mut gated_cfgs, &mut macro_loader);
176174

177175
let (krate, _) = expand::expand_crate(ecx, self.syntax_exts, krate);
178-
let krate = squash_derive::squash_derive(krate);
179176

180177
let krate = self.post_expansion_passes.iter()
181178
.fold(krate, |krate, f| (f)(krate));

syntex/src/squash_derive.rs

Lines changed: 0 additions & 219 deletions
This file was deleted.

syntex_syntax/src/ext/base.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,6 @@ fn initial_syntax_expander_table<'feat>(ecfg: &expand::ExpansionConfig<'feat>)
469469
syntax_expanders.insert(intern("macro_rules"), MacroRulesTT);
470470
*/
471471

472-
ext::deriving::register_all(&mut syntax_expanders);
473-
474472
if ecfg.enable_quotes() {
475473
// Quasi-quoting expanders
476474
syntax_expanders.insert(intern("quote_tokens"),

0 commit comments

Comments
 (0)