about summary refs log tree commit diff
path: root/src/libsyntax/attr
AgeCommit message (Collapse)AuthorLines
2019-10-18Change `Lit::tokens()` to `Lit::token_tree()`.Nicholas Nethercote-4/+5
Because most of the call sites have an easier time working with a `TokenTree` instead of a `TokenStream`.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+2
2019-10-16attr: remove dep on ExtCtxtMazdak Farrokhzad-9/+5
2019-10-16syntax: reduce visibilitiesMazdak Farrokhzad-3/+3
2019-10-16syntax: extract parse_cfg_attrMazdak Farrokhzad-1/+0
2019-10-16syntax: extract parse_derive_pathsMazdak Farrokhzad-15/+3
2019-10-15syntax::parse::sess -> syntax::sessMazdak Farrokhzad-2/+3
2019-10-14Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkovTyler Mandry-1/+1
Remove `Option` from `TokenStream` A code simplification. r? @petrochenkov
2019-10-14Remove the `Option` in `TokenStream`.Nicholas Nethercote-1/+1
It means an allocation is required to create an empty `TokenStream`, but all other operations are simpler and marginally faster due to not having to check for `None`. Overall it simplifies the code for a negligible performance effect. The commit also removes `TokenStream::empty` by implementing `Default`, which is now possible.
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-9/+25
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-09-30syntax: Support modern attribute syntax in the `meta` matcherVadim Petrochenkov-5/+11
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-7/+7
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-25/+25
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-2/+2
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-8/+8
2019-09-24Stabilize `str::len`, `[T]::len`, `is_empty` and `str::as_bytes` as const fnOliver Scherer-0/+24
2019-09-08Rollup merge of #64066 - petrochenkov:softstab, r=matthewjasperMazdak Farrokhzad-16/+12
Support "soft" feature-gating using a lint Use it for feature-gating `#[bench]`. Closes https://github.com/rust-lang/rust/issues/63798.
2019-09-07Support "soft" feature-gating using a lintVadim Petrochenkov-16/+12
Use it for feature-gating `#[bench]`
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: libsyntaxAlexander Regueiro-21/+22
2019-09-06Move injection of attributes from command line to `libsyntax_ext`Vadim Petrochenkov-46/+13
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-1/+1
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-2/+2
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-15Remove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_string`Vadim Petrochenkov-5/+7
2019-08-14Merge Variant and Variant_Caio-1/+1
2019-08-05Make mk_attr_id private to libsyntaxMark Rousskov-1/+1
2019-08-05Drop explicit span argument from mk_name_value_itemMark Rousskov-2/+3
2019-08-05Drop span argument from mk_list_itemMark Rousskov-2/+2
2019-07-31Replace AstBuilder with inherent methodsMark Rousskov-1/+0
2019-07-31Remove span argument from mk_attr_{inner,outer}Mark Rousskov-4/+4
Always the same as the passed MetaItem
2019-07-31Remove Span argument from ExtCtxt::attributeMark Rousskov-1/+1
MetaItem.span was always equivalent
2019-07-31Remove AttrId from Attribute constructorsMark Rousskov-14/+16
2019-07-31Unify spanned and non-spanned Attribute ctorsMark Rousskov-14/+4
There is no difference in the code/arguments, so go with the shorter name throughout the code.
2019-07-25Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichtonMazdak Farrokhzad-0/+97
Turn `#[global_allocator]` into a regular attribute macro It was a 99% macro with exception of some diagnostic details. As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks. Fixes https://github.com/rust-lang/rust/issues/44113 Fixes https://github.com/rust-lang/rust/issues/58072
2019-07-24Demote template check error to a lint for `#[test]` and `#[bench]`Vadim Petrochenkov-1/+2
2019-07-24syntax_ext: Reuse built-in attribute template checking for macro attributesVadim Petrochenkov-0/+96
2019-07-23Normalize use of backticks in compiler messages for libsyntax/*Samy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-07syntax: Migrate built-in macros to the regular stability checkingVadim Petrochenkov-0/+13
2019-07-07syntax: Keep full `Stability` in `SyntaxExtension`Vadim Petrochenkov-1/+2
2019-07-06privacy: Only opaque macros leak private thingsVadim Petrochenkov-5/+34
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-1/+1
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) :thinking: 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-03Remove needless lifetimesJeremy Stucki-3/+3
2019-06-24Use symbols in lint tool listflip1995-1/+1
2019-06-24Turn internal lints into tool lintsflip1995-1/+1
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-1/+1
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-09Allow attributes in formal function parametersCaio-1/+1
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-3/+2
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-2/+2
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-3/+6
2019-06-06syntax: Switch function parameter order in `TokenTree::token`Vadim Petrochenkov-5/+5
2019-06-06syntax: Use `Token` in some more placesVadim Petrochenkov-2/+2