Taylor Cramer
07f51fb868
Implement non-mod.rs mod statements
2017-12-19 14:58:51 -08:00
Vadim Petrochenkov
a4aa26aaa0
syntax: Rename P::unwrap
into P::into_inner
2017-12-17 02:21:29 +03:00
Jeffrey Seyfried
9c7969d3df
Use hygiene to access the injected crate (core
or std
) from builtin macros.
2017-12-09 17:22:07 -08:00
QuietMisdreavus
f9f3611f5c
allow loading external files in documentation
...
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990
(needs error reporting work)
cc #44732
2017-11-21 15:46:49 -06:00
Zack M. Davis
083f053294
suggest an outer attribute when #![derive(...)]
(predictably) fails
2017-09-21 21:20:31 -07:00
Tim Neumann
bc638b8635
Rollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried
...
Fix "new trace_macros doesn't work if there's an error during expansion"
Fixes #43493
2017-09-17 13:19:00 +02:00
bjorn3
8b71e0bbd5
Better trace-macro and less span_err_fatal
2017-09-02 18:13:25 +02:00
Vadim Petrochenkov
3da868dcb6
Make fields of Span
private
2017-08-30 01:38:54 +03:00
Zack M. Davis
1b6c9605e4
use field init shorthand EVERYWHERE
...
Like #43008 (f668999
), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Eduard-Mihai Burtescu
8a4facc3c3
syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.
2017-08-12 09:14:50 +03:00
Oliver Schneider
970c78094f
Reexport all SyntaxExtension variants
2017-08-07 10:22:28 +02:00
Vadim Petrochenkov
1e8a7f68e9
Avoid duplicated errors for generic arguments in macro paths
2017-07-27 23:01:17 +03:00
Jeffrey Seyfried
7d493bdd2a
Add LazyTokenStream
.
2017-06-26 02:06:31 +00:00
Jeffrey Seyfried
e42836b208
Implement quote!
and other proc_macro
API.
2017-06-26 02:06:26 +00:00
Jeffrey Seyfried
d4488b7df9
Simplify hygiene::Mark
application, and
...
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-26 02:05:45 +00:00
est31
602036370f
Extend the unused macro lint to macros 2.0
2017-05-31 17:03:41 +02:00
Jeffrey Seyfried
1f175fa35d
Hygienize librustc_resolve
.
2017-05-25 05:51:50 +00:00
Mark Simulacrum
8b93680d28
Rollup merge of #42006 - jseyfried:fix_include_regression, r=nrc
...
Fix ICE on `include!(line!())` (regression)
Fixes #41776 .
r? @nrc
2017-05-19 14:16:15 -06:00
bors
d8215fc238
Auto merge of #42049 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
...
Rollup of 5 pull requests
- Successful merges: #41937 , #41957 , #42017 , #42039 , #42046
- Failed merges:
2017-05-17 01:57:45 +00:00
Andre Bogus
958c67d9c8
adressed comments by @kennytm and @petrochenkov
2017-05-15 23:56:09 +02:00
Jeffrey Seyfried
4f2f27014d
Fix regression on include!(line!())
.
2017-05-15 09:41:05 +00:00
est31
d14d194f61
Support #[allow] etc logic on a per macro level
...
This commit extends the current unused macro linter
to support directives like #[allow(unused_macros)]
or #[deny(unused_macros)] directly next to the macro
definition, or in one of the modules the macro is
inside. Before, we only supported such directives
at a per crate level, due to the crate's NodeId
being passed to session.add_lint.
We also had to implement handling of the macro's
NodeId in the lint visitor.
2017-05-13 16:02:29 +02:00
est31
df188b8f97
Add lint for unused macros
2017-05-13 16:02:29 +02:00
Andre Bogus
a9c163ebe9
Fix some clippy warnings in libsyntax
...
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-12 20:05:39 +02:00
Esteban Küber
8c9ad8d72c
Group "macro expansion" notes per call span
2017-05-06 00:55:42 -07:00
Esteban Küber
56411443f2
Use diagnostics for trace_macro instead of println
2017-05-05 15:51:48 -07:00
Jeffrey Seyfried
8fde04b4a2
Improve Path
spans.
2017-03-30 05:44:56 +00:00
Jeffrey Seyfried
ec7c0aece1
Merge ExpnId
and SyntaxContext
.
2017-03-29 00:41:10 +00:00
Jeffrey Seyfried
e839486318
Move resolve_invoc
from syntax
to resolve
.
2017-03-10 08:08:32 -08:00
Jeffrey Seyfried
212b6c2550
Refactor out ast::ItemKind::MacroDef
.
2017-03-10 08:08:32 -08:00
Jeffrey Seyfried
f6eaaf350e
Integrate TokenStream
.
2017-03-03 02:15:37 +00:00
bors
5907ed63d3
Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakis
...
suggest doubling recursion limit in more situations
Fixes #38852 .
r? @bluss
2017-03-02 17:44:17 +00:00
Alex Burka
6e259dc778
note -> help
2017-03-02 07:11:22 +00:00
Josh Driver
4ecdc68153
Move MacroKind into Def::Macro
2017-02-23 20:12:33 +10:30
Josh Driver
2d91e7aab8
Refactor macro resolution errors + add derive macro suggestions
2017-02-16 22:03:15 +10:30
Jeffrey Seyfried
2cc61eebb7
Allow using inert attributes from proc_macro_derive
s with #![feature(proc_macro)]
.
2017-02-12 07:20:04 +00:00
Alex Burka
b4993ec863
suggest doubling recursion limit in more situations
2017-02-09 06:40:23 +00:00
Josh Driver
fbdd038866
Move derive macro expansion into the MacroExpander
...
This removes the expand_derives function, and sprinkles
the functionality throughout the Invocation Collector,
Expander and Resolver.
2017-02-05 09:31:02 +10:30
Josh Driver
0a7380d7fc
Rename CustomDerive to ProcMacroDerive for macros 1.1
2017-02-05 09:31:02 +10:30
Josh Driver
0477daf9f0
Make builtin derives a SyntaxExtension
...
This allows builtin derives to be registered and
resolved, just like other derive types.
2017-02-05 09:31:01 +10:30
Jeffrey Seyfried
debcbf0b8e
Refactor the parser to consume token trees.
2017-01-17 08:17:26 +00:00
Jeffrey Seyfried
c12fc66a9d
Allow legacy custom derive authors to disable warnings in downstream crates.
2016-12-23 05:49:34 +00:00
Jeffrey Seyfried
6f040b48ef
Avoid including attributes in bang macro invocations.
2016-12-18 23:26:31 +00:00
Jeffrey Seyfried
421c5d11c1
Remove scope placeholders, remove method add_macro
of ext::base::Resolver
.
2016-12-18 23:26:30 +00:00
Jeffrey Seyfried
e80d1a8faf
Remove MacroDef
's fields imported_from
and allow_internal_unstable
,
...
remove `export` argument of `resolver.add_macro()`.
2016-12-18 23:26:29 +00:00
Jeffrey Seyfried
5675d9d280
Clean up directory ownership semantics.
2016-11-22 01:48:10 +00:00
Jeffrey Seyfried
36c8f6b0d3
Cleanup InternedString
.
2016-11-21 09:00:56 +00:00
Jeffrey Seyfried
e85a0d70b8
Use Symbol
instead of InternedString
in the AST, HIR, and various other places.
2016-11-21 09:00:55 +00:00
Jeffrey Seyfried
d2f8fb0a0a
Move syntax::util::interner
-> syntax::symbol
, cleanup.
2016-11-20 23:40:20 +00:00
Jeffrey Seyfried
641274f907
Resolve imports during expansion.
2016-11-17 08:07:44 +00:00