]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #51335 - mark-i-m:allocator, r=oli-obk
authorbors <bors@rust-lang.org>
Mon, 25 Jun 2018 08:54:16 +0000 (08:54 +0000)
committerbors <bors@rust-lang.org>
Mon, 25 Jun 2018 08:54:16 +0000 (08:54 +0000)
Prohibit `global_allocator` in submodules

Background: #44113 is caused by weird interactions with hygiene. Hygiene is hard. After a lot of playing around, we decided that the best path forward would be to prohibit `global_allocator`s from being in submodules for now. When somebody gets it working, we can re-enable it.

This PR contains the following
- Some hygiene "fixes" -- things I suspect are the correct thing to do that will make life easier in the future. This includes using call_site hygiene for the generated module and passing the correct crate name to the expansion config.
- Comments and minor formatting fixes
- Some debugging code
- Code to prohibit `global_allocator` in submodules
- Test checking that the proper error occurs.

cc #44113 #49320 #51241

r? @alexcrichton


Trivial merge