]> git.lizzy.rs Git - rust.git/commitdiff
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)
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


Trivial merge