Commit Graph

61 Commits

Author SHA1 Message Date
bors
1581278534 Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb
Cleanup `rmeta::MacroDef`

Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`.

The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well.

Fixes #49511.

r? @eddyb
cc @matthewjasper @estebank @petrochenkov
2020-03-10 17:12:48 +00:00
Mazdak Farrokhzad
fd302f46dc Store TokenStream in rmeta::MacroDef.
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-10 07:26:27 +01:00
John Kåre Alsaker
f4450772ed Remove the no_force query attribute 2020-03-09 14:50:40 +01:00
John Kåre Alsaker
cbce21767b Remove the need for no_force 2020-03-09 14:50:40 +01:00
Matthias Krüger
136ad015b6 fix various typos 2020-03-06 15:19:31 +01:00
Matthias Krüger
1892ff7aa6 librustc_macros: remove redundant single component path import 2020-02-24 14:56:30 +01:00
John Kåre Alsaker
8a2ad75a60 Add a storage query modifier to override the query cache 2020-02-19 16:03:19 +01:00
Andreas Jonson
3b23d22e75 remove some dependencies on itertools 2020-02-11 19:28:38 +01:00
Dylan DPC
3fe4c0ddf9
Rollup merge of #68815 - matthiaskrgr:redundant_imports, r=alexcrichton
remove redundant imports (clippy::single_component_path_imports)
2020-02-04 21:51:55 +01:00
Mark Rousskov
dbc9894095 Drop unused extern crates 2020-02-04 08:14:08 -05:00
Matthias Krüger
697ef95c9f remove redundant imports (clippy::single_component_path_imports) 2020-02-04 01:05:45 +01:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Camille GILLOT
ce301075c0 Rename StableHashingContextLike to HashStableContext. 2019-11-23 17:57:00 +01:00
Camille GILLOT
1de5fdb5ba Add StableHashingContextLike to HashStable_Generic derive. 2019-11-22 19:56:20 +01:00
bors
083b5a0a1b Auto merge of #66460 - cjgillot:hashstable_generic, r=Zoxc
Add a proc-macro to derive HashStable in librustc dependencies

A second proc-macro is added to derive HashStable for crates librustc depends on.
This proc-macro HashStable_Generic (to bikeshed) allows to decouple code and some librustc's boilerplate.

Not everything is migrated, because `Span` and `TokenKind` require to be placed inside librustc.
Types using them stay there too.

Split out of #66279
r? @Zoxc
2019-11-22 13:54:41 +00:00
Camille GILLOT
a65091ffff Rename generated lifetime. 2019-11-18 08:41:28 +01:00
Camille GILLOT
2add2075de Create derive proc-macro for Lift trait. 2019-11-18 08:41:28 +01:00
Camille GILLOT
5b0e702f6c Create a generic HashStable derive. 2019-11-17 22:37:01 +01:00
Camille GILLOT
9e28e9c545 Create TypeFoldable derive proc-macro. 2019-11-13 20:49:04 +01:00
Mazdak Farrokhzad
0d17de89ba
Rollup merge of #65176 - nnethercote:rm-query-macros, r=michaelwoerister
Remove query-related macros

The query system has a few macros that only have one or two call sites, and I find they hurt readability. This PR removes them.

r? @michaelwoerister
2019-10-08 15:45:32 +02:00
Nicholas Nethercote
9267d9fe5b Remove force_ex!. 2019-10-07 11:59:28 +11:00
Mateusz Mikuła
d89608829c Upgrade librustc_macros dependencies 2019-10-04 14:43:23 +02:00
Vadim Petrochenkov
5ae38bbc7c Stabilize proc macros in type positions 2019-09-30 21:59:35 +03:00
Mark Rousskov
14a5aefb01 Switch over all StableHash impls to new format 2019-09-28 11:47:36 -04:00
Mark Rousskov
d540d44c71 Remove global_tcx from TyCtxt
The non-global context was removed; there's only one context now. This
is a noop method that only serves to confuse readers -- remove it.
2019-09-27 13:33:48 -04:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Vadim Petrochenkov
434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Mazdak Farrokhzad
485a084b45
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Implement another internal lints

cc #49509

This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~

~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~

TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) 🤔 cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros

r? @oli-obk
2019-07-05 20:26:51 +02:00
John Kåre Alsaker
b9344e31f5 Derive which queries to save using the proc macro 2019-07-02 17:31:46 +02:00
John Kåre Alsaker
930ad86e3d Clean up query cache code 2019-06-30 11:18:44 +02:00
John Kåre Alsaker
11221d120f Inform the query system about properties of queries at compile time 2019-06-25 04:38:04 +02:00
flip1995
7de6f54728
Turn internal lints into tool lints 2019-06-24 10:45:21 +02:00
flip1995
65c81dee75
Allow default_hash_types in some crates 2019-06-24 10:45:20 +02:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Oliver Scherer
e84c9f3799
Rollup merge of #60885 - euclio:strip-synstructure-consts, r=GuillaumeGomez
strip synstructure consts from compiler docs

Fixes #60150.

Unfortunately this PR depends on the use of the deprecated `--passes` flag in bootstrap to keep the `--strip-hidden` pass while still documenting private items. I've opened #60884 to track stabilization of a new flag that encapsulates this behavior.

r? @QuietMisdreavus
2019-05-29 14:41:03 +02:00
Nicholas Nethercote
9c7d28d4fd Pre-intern "0", "1", ..., "9", and use where appropriate. 2019-05-27 13:58:38 +10:00
Vadim Petrochenkov
59a382122f Simplify use of keyword symbols 2019-05-22 19:48:56 +03:00
Andy Russell
c95be3d033
strip synstructure consts from compiler docs 2019-05-16 14:32:28 -04:00
Nicholas Nethercote
a8245f5a38 Add lots of static Symbols.
These will be used in the subsequent commits. Many of them are
attributes.

The commit also adds the ability to handle symbols that aren't
identifiers (e.g. "proc-macro").
2019-05-13 09:26:43 +10:00
Alexey Shmalko
56c0125568
Promote regular comments to rustdoc comments 2019-04-17 12:03:39 +03:00
John Kåre Alsaker
f598091c05 Use colon for keyword defs 2019-04-15 07:23:04 +02:00
John Kåre Alsaker
baebf79057 Move modules outside the proc macro 2019-04-15 07:23:04 +02:00
John Kåre Alsaker
10855a36b5 Use a proc macro to declare preallocated symbols 2019-04-15 07:23:01 +02:00
John Kåre Alsaker
012884419e Allow unused query arguments 2019-03-30 18:43:25 +01:00
John Kåre Alsaker
0b170cd540 Add cycle_delay_bug to proc macro 2019-03-30 18:37:00 +01:00
John Kåre Alsaker
75677c45c3 Fix whitespace 2019-03-20 18:00:08 +01:00
John Kåre Alsaker
4d0a1e418c Add eval_always to query macro and move a query over 2019-03-20 17:22:16 +01:00