Jeffrey Seyfried
0a998b86e9
Support #[macro_reexport]
ing custom derives.
2016-11-10 11:19:34 +00:00
Jeffrey Seyfried
872943c317
Improve macro reexports.
2016-11-10 10:04:24 +00:00
Jeffrey Seyfried
85f74c0eea
Add variants Def::Macro
and Namespace::MacroNS
.
2016-11-10 09:21:44 +00:00
Jeffrey Seyfried
dd0781ea25
Register and stability check #[no_link]
crates.
2016-11-10 09:21:29 +00:00
Jeffrey Seyfried
624a9b7311
Avoid building multiple reduced graphs for a crate
...
that is referenced by multiple `extern crate` items.
2016-11-10 09:20:55 +00:00
Jeffrey Seyfried
b0e13dc5ba
Treat extern crate
s more like imports (pure refactoring).
2016-11-10 06:04:40 +00:00
Jeffrey Seyfried
8021ede601
nit: clean up some redundant code.
2016-11-10 06:03:51 +00:00
Eduard Burtescu
de0ffadb67
rustc: unify and simplify managing associated items.
2016-11-10 02:06:34 +02:00
Nicholas Nethercote
00e48affde
Replace FnvHasher use with FxHasher.
...
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-11-08 15:14:59 +11:00
Jeffrey Seyfried
0d30325286
Avoid false positive unused_extern_crates
.
2016-10-25 20:38:58 +00:00
Jeffrey Seyfried
04ca378b89
Support use $crate;
with a future compatibility warning.
2016-10-25 20:26:00 +00:00
Jeffrey Seyfried
9c514a1cc1
Refactor away CrateLoader::load_macros
.
2016-10-24 00:45:12 +00:00
Jeffrey Seyfried
e4baeaa30d
Import macros in resolve
instead of in metadata::macro_import
.
2016-10-24 00:43:12 +00:00
bors
da5b6467c3
Auto merge of #37247 - jseyfried:future_proof_no_link, r=nrc
...
macros: Future proof `#[no_link]`
This PR future proofs `#[no_link]` for macro modularization (cc #35896 ).
First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example,
```rust
```
Any breakage can be fixed by simply removing the `#[no_link] extern crate`.
Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example:
```rust
mod syntax {} //< This becomes a duplicate error.
```
r? @nrc
2016-10-21 01:48:31 -07:00
Jeffrey Seyfried
b283aaf0ff
Future proof #[no_link]
.
2016-10-19 10:05:03 +00:00
Jeffrey Seyfried
8b0c292a72
Improve $crate
.
2016-10-19 10:03:06 +00:00
Jeffrey Seyfried
7b81106a85
Use Ident
s instead of Name
s in ImportDirective
's paths.
2016-10-19 09:58:12 +00:00
Jeffrey Seyfried
aac6dca21e
Treat custom derive extern crates like empty modules.
2016-10-15 22:55:21 +00:00
Jeffrey Seyfried
33e3da831c
Use the macro namespace for custom derives.
2016-10-15 22:55:19 +00:00
Jeffrey Seyfried
111caef9a3
Clean up the scopes of expanded #[macro_use]
imports.
2016-10-11 05:14:08 +00:00
Jeffrey Seyfried
d5281ef681
Merge branch 'persistent_macro_scopes' into cleanup_expanded_macro_use_scopes
2016-10-11 03:41:18 +00:00
Jeffrey Seyfried
fbc96e18ad
Persistent macro scopes.
2016-10-08 03:41:55 +00:00
Jeffrey Seyfried
a23bdd2769
Rename resolve::macros::{ExpansionData -> InvocationData}
.
2016-10-07 21:54:37 +00:00
Jeffrey Seyfried
2cf964967c
Immutable ExpansionData
.
2016-10-07 21:54:05 +00:00
bors
ca76c7e014
Auto merge of #36945 - alexcrichton:proc-macro-rename, r=nrc
...
rustc: Rename rustc_macro to proc_macro
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`,
which reflects the general consensus of #35900 . A follow up PR to Cargo will be
required to purge the `rustc-macro` name as well.
2016-10-07 07:58:27 -07:00
Alex Crichton
2148bdfcc7
rustc: Rename rustc_macro to proc_macro
...
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`,
which reflects the general consensus of #35900 . A follow up PR to Cargo will be
required to purge the `rustc-macro` name as well.
2016-10-06 11:07:23 -07:00
Vadim Petrochenkov
bc0eabd7a7
Remove some unused methods from metadata
...
Address comments + Fix rebase
2016-10-04 23:53:51 +03:00
Vadim Petrochenkov
75d6522b9a
Eliminate ty::VariantKind in favor of def::CtorKind
2016-10-04 22:22:36 +03:00
Vadim Petrochenkov
e8ea38e42a
Further cleanup in resolve
...
`try_define` is not used in build_reduced_graph anymore
Collection of field names for error reporting is optimized
Some comments added
2016-10-04 22:20:37 +03:00
Vadim Petrochenkov
d19c16acfb
Fix cross-crate resolution of half-items created by export shadowing
2016-10-04 22:20:37 +03:00
Vadim Petrochenkov
da7b1c984c
Separate Def::StructCtor/Def::VariantCtor from Def::Struct/Def::Variant
2016-10-04 22:20:37 +03:00
Nicholas Nethercote
78579034ec
Fix an ICE in BuildReducedGraphVisitor::visit_trait_item.
...
This ICE occurs in the futures-rs-test-all benchmark in
rustc-benchmarks.
2016-10-04 16:41:53 +11:00
Jeffrey Seyfried
ed1e00268b
Enforce the weakened shadowing restriction.
2016-10-02 08:25:27 +00:00
Jeffrey Seyfried
72544afd71
Record macro import site spans.
2016-10-02 06:07:49 +00:00
Jeffrey Seyfried
797eb57aa8
Refactor field expansion_data
of Resolver
to use a Mark
instead of a u32
.
2016-10-02 04:25:31 +00:00
Jeffrey Seyfried
634ecf038d
Merge ModuleData
and ModuleS
.
2016-09-27 06:43:43 +00:00
Jeffrey Seyfried
b3a81ee844
Build the reduced graph during expansion.
2016-09-27 06:42:10 +00:00
Jeffrey Seyfried
7b5c59ea65
Load extern crates in resolve
.
2016-09-23 06:35:33 +00:00
Jeffrey Seyfried
272cf4e61d
Refactor no_implicit_prelude: Cell<bool>
-> no_implicit_prelude: bool
.
2016-09-22 07:45:11 +00:00
Jeffrey Seyfried
85bfd82be6
Avoid reconstructing the BuildReducedGraphVisitor
.
2016-09-22 07:18:16 +00:00
Jeffrey Seyfried
a344f14caa
Refactor out BuildReducedGraphVisitor::visit_trait_item
.
2016-09-22 07:17:23 +00:00
Jeffrey Seyfried
9a0e88a339
Refactor away ParentLink
.
2016-09-22 07:13:54 +00:00
Eduard Burtescu
521d3ea193
rustc_resolve: bring back "struct called like a function" cross-crate.
2016-09-20 20:08:07 +03:00
Eduard Burtescu
dadbaa48ac
rustc_metadata: move opt_item_name to TyCtxt::item_name.
2016-09-20 20:08:06 +03:00
Eduard Burtescu
24aef24e1a
rustc_metadata: split the Def description of a DefId from item_children.
2016-09-20 20:08:05 +03:00
Eduard Burtescu
ef4352fba6
rustc_metadata: group information into less tags.
2016-09-20 20:08:04 +03:00
Eduard Burtescu
89736e8671
rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.
2016-09-20 20:08:03 +03:00
Eduard Burtescu
8734aaa33e
rustc_metadata: move more RBML tags to auto-serialization.
2016-09-20 20:08:02 +03:00
Vadim Petrochenkov
4b6c4c08df
Remove some ancient code providing special support for newtypes
2016-09-13 23:33:50 +03:00
Vadim Petrochenkov
e05e74ac83
Replace _, _
with ..
2016-09-04 12:30:33 +03:00