Tell the compiler to tell us that deriving is dead.
I'm beginning to suspect it's impossible to avoid accidentally writing `#[deriving]` at least once in every program, and it results in non-intuitive error messages: "Foo doesn't have any method in scope `clone`" despite there being a `#[deriv...(Clone)]` attribute! Also, lots of documentation around the internet uses `#[deriving]` so providing this guidance is very helpful (lots of people ask in #rust about this error). Fixes #21166.
This commit is contained in:
@@ -467,6 +467,8 @@ fn initial_syntax_expander_table(ecfg: &expand::ExpansionConfig) -> SyntaxEnv {
|
||||
ext::log_syntax::expand_syntax_ext));
|
||||
syntax_expanders.insert(intern("derive"),
|
||||
Decorator(box ext::deriving::expand_meta_derive));
|
||||
syntax_expanders.insert(intern("deriving"),
|
||||
Decorator(box ext::deriving::expand_deprecated_deriving));
|
||||
|
||||
if ecfg.enable_quotes {
|
||||
// Quasi-quoting expanders
|
||||
|
||||
Reference in New Issue
Block a user