about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-12-12Use a `newtype_index!` within `Symbol`.Nicholas Nethercote-0/+4
This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks `Token` from 24 bytes to 16 bytes. This reduces instruction counts by up to 1% across a range of benchmarks.
2018-12-10improve diagnostics for invalid external docsAndy Russell-10/+26
2018-12-10reject invalid external doc attributesAndy Russell-2/+30
Also, provide a suggestion for the correct syntax.
2018-12-10Auto merge of #56369 - nnethercote:rm-Delimited, r=petrochenkovbors-185/+168
Remove `tokenstream::Delimited`. Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-10Remove `tokenstream::Delimited`.Nicholas Nethercote-185/+168
Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-09Add missing, non-panicking `maybe_new_parser_from_file` variantIgor Matuszewski-8/+29
2018-12-10Upgrade `smallvec` to 0.6.7 and use the new `may_dangle` feature.Nicholas Nethercote-1/+1
2018-12-08Rollup merge of #56248 - estebank:suggest-bare-pub, r=petrochenkovMazdak Farrokhzad-20/+48
Suggest an appropriate token when encountering `pub Ident<'a>` Fix #55403. Follow up to #45997.
2018-12-08Auto merge of #56578 - alexreg:cosmetic-1, r=alexregbors-382/+381
Various minor/cosmetic improvements to code r? @Centril 😄
2018-12-07Fixed incorrect reference to issue #23121.Alexander Regueiro-1/+1
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-382/+381
2018-12-07use top level `fs` functions where appropriateAndy Russell-58/+49
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-07Add suggestion for underscore binding fix.David Wood-0/+9
This commit emits a suggestion for adding an underscore binding to arguments in trait methods that previously did not have a argument name specified.
2018-12-07Add context for RFC 1685 change in 2018 edition.David Wood-4/+6
This commit adds a note providing context for the change to argument names being required in the 2018 edition for trait methods.
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-1/+1
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-07Unsupport `#[derive(Trait)]` sugar for `#[derive_Trait]` legacy plugin ↵Vadim Petrochenkov-37/+3
attributes
2018-12-06Auto merge of #56392 - petrochenkov:regensym, r=oli-obkbors-14/+13
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion. Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695. Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118). Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983). Add more tests for `use foo as _` imports.
2018-12-06Auto merge of #56557 - pietroalbini:rollup, r=pietroalbinibors-60/+47
Rollup of 11 pull requests Successful merges: - #56315 (Rustdoc inline macro reexport) - #56332 ([rustdoc] Specific crate search) - #56362 (Stabilise exhaustive integer patterns) - #56426 (libsyntax_pos: A few tweaks) - #56441 (rustbuild: Fix issues with compiler docs) - #56446 (pass the parameter environment to `traits::find_associated_item`) - #56500 (cleanup: remove static lifetimes from consts) - #56525 (Avoid extra copy and syscall in std::env::current_exe) - #56528 (Remove unused dependency (rustc_lint -> rustc_mir)) - #56548 (Optimized string FromIterator + Extend impls) - #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set) Failed merges: r? @ghost
2018-12-06Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakisbors-0/+3
Allow calling `const unsafe fn` in `const fn` behind a feature gate cc #55607 r? @Centril
2018-12-06Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavisPietro Albini-21/+20
cleanup: remove static lifetimes from consts A follow-up to https://github.com/rust-lang/rust/pull/56497.
2018-12-06Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakisPietro Albini-37/+23
libsyntax_pos: A few tweaks
2018-12-06Rollup merge of #56362 - varkor:stabilise-exhaustive-integer-patterns, ↵Pietro Albini-2/+4
r=nikomatsakis Stabilise exhaustive integer patterns This is dependent on the FCP for https://github.com/rust-lang/rfcs/pull/2591 being completed, but that should happen tomorrow, so there's little harm in opening this PR early. Closes #50907.
2018-12-06Auto merge of #54517 - mcr431:53956-panic-on-include_bytes-of-own-file, ↵bors-63/+74
r=michaelwoerister 53956 panic on include bytes of own file fix #53956 When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
2018-12-05Rollup merge of #56452 - sinkuu:redundant_clone, r=nikicPietro Albini-1/+1
Remove redundant clones
2018-12-05Auto merge of #55466 - sinkuu:cleanup, r=petrochenkovbors-63/+34
syntax: Use iterator and pattern APIs instead of `char_at` Iterating over chars with the `char_at(str, i)` `i += ch.len_utf8()` loop seems unidiomatic.
2018-12-05Fix pretty testShotaro Yamada-1/+1
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-34/+21
fixes remaining test failures
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-13/+16
2018-12-04new_source_file no longer enters duplicate files, expand_include_bytes ↵Matthew Russo-19/+40
includes the source if it can convert bytes to string
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-1/+1
2018-12-04cleanup: remove static lifetimes from constsljedrz-21/+20
2018-12-04Tidy fixupOliver Scherer-1/+1
2018-12-04Allow calling `const unsafe fn` in `const fn` behind a feature gateOliver Scherer-0/+3
2018-12-04Remove redundant cloneShotaro Yamada-1/+1
2018-12-04Fix testShotaro Yamada-1/+2
2018-12-04Use iterator and pattern APIs instead of `char_at`Shotaro Yamada-62/+32
2018-12-04Address review commentsVadim Petrochenkov-23/+10
2018-12-04syntax: Remove `#[non_exhaustive]` from `Edition`Vadim Petrochenkov-1/+0
`Edition` is not a public API, we want users to break when a new edition is added
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-13/+13
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now `SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-03Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkovkennytm-6/+1
Remove not used `DotEq` token Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-03Rollup merge of #56433 - yui-knk:update_comment_of_parse_visibility, ↵kennytm-3/+4
r=petrochenkov Add description about `crate` for parse_visibility's comment This rule was introduced by https://github.com/rust-lang/rust/pull/45401.
2018-12-03Rollup merge of #56419 - mark-i-m:remove-try, r=Centrilkennytm-5/+3
Remove some uses of try!
2018-12-03Rollup merge of #56412 - petrochenkov:extself, r=Centrilkennytm-1/+1
Update tracking issue for `extern_crate_self`
2018-12-03Rollup merge of #56366 - alexreg:stabilise-self_in_typedefs, r=Centrilkennytm-6/+5
Stabilize self_in_typedefs feature [**Tracking Issue**](https://github.com/rust-lang/rust/issues/49303) r? @centril
2018-12-02Remove not used `DotEq` tokenyui-knk-6/+1
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-02Delay gensym creation for "underscore items" until name resolutionVadim Petrochenkov-14/+13
Prohibit `static _` Fis unused import warnings for `use foo as _` Add more tests for `use foo as _`
2018-12-02Fix "line longer than 100 chars"yui-knk-3/+4
2018-12-02Add description about `crate` for parse_visibility's commentyui-knk-1/+1
This rule was introduced by https://github.com/rust-lang/rust/pull/45401.
2018-12-01remove some uses of try!Mark Mansi-5/+3
2018-12-01Update tracking issue for `extern_crate_self`Vadim Petrochenkov-1/+1