]> git.lizzy.rs Git - rust.git/commit
Auto merge of #37787 - michaelwoerister:macro-def-ich, r=nikomatsakis
authorbors <bors@rust-lang.org>
Sat, 19 Nov 2016 03:21:47 +0000 (19:21 -0800)
committerGitHub <noreply@github.com>
Sat, 19 Nov 2016 03:21:47 +0000 (19:21 -0800)
commit49d3fd3b38cd838b241858baaaa6162666badba1
treea09068946f0e895c38a65086ae7b9241eec30fce
parentac635aa95ba851898e125b047ad7b8d6a8fecf8e
parentc722a1eb9992ac76f5c3dd0aee36b8734d613f11
Auto merge of #37787 - michaelwoerister:macro-def-ich, r=nikomatsakis

ICH: Handle MacroDef HIR instances.

As of recently, `hir::MacroDef` instances are exported in crate metadata, which means we also store their ICH when doing incremental compilation. Even though exported macro definitions should not (yet) interact with incremental compilation, the ICH is also used for the general purpose crate hash, where macros should be included.

This PR implements ICH computation for `MacroDef`. In theory, the ICH of these MacroDefs is less stable than that of other HIR items, since I opted to just call the compiler-generated `Hash::hash()` for `Token::Interpolated` variants. `Token::Interpolated` contains AST data structures and it would have been a lot of effort to expand ICH computation to the AST too. Since quasi-quoting is rarely used *and* it would only make a difference if incremental compilation was extended to macros, the simpler implementation seemed like a good idea.

This fixes the problem reported in https://github.com/rust-lang/rust/issues/37756. The test still fails because of broken codegen-unit support though.

r? @nikomatsakis