about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-39/+109
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-12Rollup merge of #61654 - Electron-libre:use_slice_patterns_in_rustc, ↵Mazdak Farrokhzad-54/+43
r=oli-obk,Centril use pattern matching for slices destructuring refs #61542 Use slices pattern where it seems to make sense .
2019-06-11Auto merge of #61741 - Centril:rollup-fgro5kz, r=Centrilbors-273/+166
Rollup of 11 pull requests Successful merges: - #61518 (Add loops to doc list of things not stable in const fn) - #61526 (move some tests into subfolders) - #61550 (Windows 10 SDK is also required now.) - #61606 (Remove some legacy proc macro flavors) - #61652 (Mention slice patterns in array) - #61686 (librustc_errors: Add some more documentation) - #61698 (typeck: Fix const generic in repeat param ICE.) - #61707 (Azure: retry failed awscli installs) - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone) - #61724 (core: use memcmp optimization for 128 bit integer slices) - #61726 (Use `for_each` in `Iterator::partition`) Failed merges: r? @ghost
2019-06-11Auto merge of #61735 - eddyb:must-use-life, r=oli-obkbors-0/+1
Add deny(unused_lifetimes) to all the crates that have deny(internal). @Zoxc brought up, regarding #61722, that we don't force the removal of unused lifetimes. Turns out that it's not that bad to enable for compiler crates (I wonder why it's not `warn` by default?). I would've liked to enable `single_use_lifetimes` as well, but https://github.com/rust-lang/rust/issues/53738 makes it unusable for now. For the `rustfmt` commit, I used https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, and manually filtered out some noise. r? @oli-obk cc @rust-lang/compiler
2019-06-11Rollup merge of #61606 - petrochenkov:legclean, r=pnkfelixMazdak Farrokhzad-273/+166
Remove some legacy proc macro flavors Namely - `IdentTT` (`foo! ident { ... }`). Can be replaced with `foo! { ident ... }` or something similar. - `MultiDecorator`. Can be replaced by `MultiModifier` (aka `LegacyAttr` after renaming). - `DeclMacro`. It was a less powerful duplicate of `NormalTT` (aka `LegacyBang` after renaming) and can be replaced by it. Stuff like this slows down any attempts to refactor the expansion infra, so it's desirable to retire it already. I'm not sure whether a lang team decision is necessary, but would be nice to land this sooner because I have some further work in this area scheduled. The documentation commit (https://github.com/rust-lang/rust/commit/a9397fd0d5eede4bbc0ada94bf92657ca8084cb3) describes how the remaining variants are different from each other and shows that there's actually some system behind them. The last commit renames variants of `SyntaxExtension` in more systematic way. - `ProcMacro` -> `Bang` - `NormalTT` -> `LegacyBang` - `AttrProcMacro` -> `Attr` - `MultiModifier` -> `LegacyAttr` - `ProcMacroDerive` -> `Derive` - `BuiltinDerive` -> `LegacyDerive` All the `Legacy*` variants are AST-based, as opposed to "modern" token-based variants.
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-06-11Auto merge of #60463 - mjbshaw:transparent, r=varkor,rkruppebors-0/+6
Implement RFC 2645 (transparent enums and unions) Tracking issue: #60405
2019-06-10Implement RFC 2645 (transparent enums and unions)Michael Bradshaw-0/+6
Tracking issue: #60405
2019-06-10Auto merge of #60793 - Xanewok:raw-string-cleanup, r=petrochenkovbors-128/+161
lexer: Disallow bare CR in raw byte strings Handles bare CR ~but doesn't translate `\r\n` to `\n` yet in raw strings yet~ and translates CRLF to LF in raw strings. As a side-note I think it'd be good to change the `unescape_` to return plain iterators to reduce some boilerplate (e.g. `has_error` could benefit from collecting `Result<T>` and aborting early on errors) but will do that separately, unless I missed something here that prevents it. @matklad @petrochenkov thoughts?
2019-06-10syntax: Rename variants of `SyntaxExtension` for consistencyVadim Petrochenkov-45/+41
2019-06-10syntax: Improve documentation of `SyntaxExtension`Vadim Petrochenkov-36/+54
2019-06-10syntax: Remove `SyntaxExtension::DeclMacro`Vadim Petrochenkov-77/+61
It's a less powerful duplicate of `SyntaxExtension::NormalTT`
2019-06-10syntax: Use `MultiItemModifier` for built-in derivesVadim Petrochenkov-25/+22
2019-06-10syntax: Remove `SyntaxExtension::MultiDecorator` and `MultiItemDecorator`Vadim Petrochenkov-43/+1
2019-06-10syntax: Remove `SyntaxExtension::IdentTT` and `IdentMacroExpander`Vadim Petrochenkov-60/+0
2019-06-10Don't suggest using \r in raw stringsIgor Matuszewski-1/+7
2019-06-10Stabilize underscore_const_names.Mazdak Farrokhzad-11/+3
2019-06-10Special-case literals in `parse_bottom_expr`.Nicholas Nethercote-10/+22
This makes parsing faster, particularly for code with large constants, for two reasons: - it skips all the keyword comparisons for literals; - it replaces the unnecessary `parse_literal_maybe_minus` call with `parse_lit`, avoiding an unnecessary allocation via `mk_expr`.
2019-06-09Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisabors-14/+3
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0 On an `enum` item, you may now write: ```rust #[repr(align(X))] enum Foo { // ... } ``` This has equivalent effects to first defining: ```rust #[repr(align(X))] struct AlignX<T>(T); ``` and then using `AlignX<Foo>` in `Foo`'s stead. r? @nagisa
2019-06-09Use char byte calculation using existing iteratorIgor Matuszewski-11/+13
2019-06-09Actually translate CRLF in raw byte strings and unify unescape implIgor Matuszewski-25/+69
2019-06-09Add a doc comment for scan_raw_stringIgor Matuszewski-0/+2
2019-06-09Allow attributes in formal function parametersCaio-39/+109
2019-06-09pacify tidy.Mazdak Farrokhzad-1/+1
2019-06-09Some more cleanup in libsyntax::ext::tt::quotedMazdak Farrokhzad-11/+8
2019-06-09Cleanups in parse_sep_and_kleene_op.Mazdak Farrokhzad-12/+4
2019-06-09Support ? Kleene operator in 2015.Mazdak Farrokhzad-167/+4
2019-06-09Translate CRLF -> LF in raw (byte) stringsIgor Matuszewski-34/+18
2019-06-09Rollup merge of #61669 - petrochenkov:tokderef2, r=oli-obkMazdak Farrokhzad-228/+160
syntax: Remove `Deref` impl from `Token` Follow up to https://github.com/rust-lang/rust/pull/61541 r? @oli-obk
2019-06-09Rollup merge of #61660 - petrochenkov:nocusta, r=CentrilMazdak Farrokhzad-6/+14
Minimize use of `#![feature(custom_attribute)]` Some preparations before resurrecting https://github.com/rust-lang/rust/pull/57921.
2019-06-09Rollup merge of #61646 - L117:master, r=CentrilMazdak Farrokhzad-15/+15
Remove useless allocations in macro_rules follow logic. Closes #61543
2019-06-08Prohibit bare CRs in raw byte stringsIgor Matuszewski-70/+53
2019-06-08Validate and transcribe raw strings via unescape moduleIgor Matuszewski-46/+59
2019-06-08Introduce `#[rustc_dummy]` attribute and use it in testsVadim Petrochenkov-6/+9
Unlike other built-in attributes, this attribute accepts any input
2019-06-08Turn `#[allocator]` into a built-in attribute and rename it to ↵Vadim Petrochenkov-0/+5
`#[rustc_allocator]`
2019-06-08syntax: Move some `Token` methods aroundVadim Petrochenkov-48/+40
2019-06-08syntax: Remove `Deref` impl from `Token`Vadim Petrochenkov-66/+45
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-99/+65
2019-06-08fix libsyntax testCedric-4/+4
2019-06-08Remove redundant, commented out codeIgor Matuszewski-6/+0
It was commented out as part of https://github.com/rust-lang/rust/commit/8a8e497ae786ffc032c1e68fc23da0edcf6fa5e3. Done probably by accident, since the code in question was moved to a match arm, along with newly introduced logic to detect bare CRs in raw strings.
2019-06-08Separate a `scan_raw_string` (similar `raw_byte` variant)Igor Matuszewski-77/+82
2019-06-08Clean up minor bitsIgor Matuszewski-2/+2
2019-06-08syntax: Keep full `Token`s for `macro_rules` separatorsVadim Petrochenkov-35/+30
2019-06-08cast vec to slicesCedric-5/+5
2019-06-08use default binding mode in match clausesCedric-10/+10
2019-06-08fix bad style for structsCedric-13/+19
2019-06-08improve styleCedric-13/+10
2019-06-08use pattern matching for slices destructuringCedric-46/+32
2019-06-08Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obkMazdak Farrokhzad-262/+252
parser: Remove `Deref` impl from `Parser` Follow up to https://github.com/rust-lang/rust/pull/61541 You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess. Not sure. Probably still better than people using both and being confused about the definition point of `span`. r? @oli-obk @estebank
2019-06-08Remove useless allocations in macro_rules follow logic.L117-15/+15