about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-06-23let_chains: note re. back-compat wrt. expr beginning.Mazdak Farrokhzad-1/+3
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-6/+6
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-23let_chains: More accurately describe `ast::ExprKind::Let`.Mazdak Farrokhzad-1/+1
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2019-06-23let_chains: Fix bugs in pretty printing.Mazdak Farrokhzad-14/+46
2019-06-23let_chains: Refactor parse_{if,while}_expr a bit.Mazdak Farrokhzad-9/+12
2019-06-23let_chains: Move feature gating to pre-expansion.Mazdak Farrokhzad-28/+28
2019-06-23let_chains: Inline visit_expr_with_let_maybe_allowed.Mazdak Farrokhzad-0/+1
2019-06-23let_chains: readd kw::let to ident_can_begin_expr.Mazdak Farrokhzad-3/+2
2019-06-23let_chains: scrutinee -> conditionMazdak Farrokhzad-1/+1
2019-06-23let_chains: Fix outdated doc-comment re. 'parse_if_expr'.Mazdak Farrokhzad-1/+1
2019-06-23let_chains: Improve documentation for ast::ExprKind::Let(..).Mazdak Farrokhzad-1/+4
2019-06-23let_chains: Comment out Let in ident_can_begin_expr.Mazdak Farrokhzad-1/+2
2019-06-23let_chains: Add feature gate.Mazdak Farrokhzad-1/+30
2019-06-23let_chains: Add support for parsing let expressions.Mazdak Farrokhzad-53/+22
2019-06-23let_chains: Handle it in AST pretty printing.Mazdak Farrokhzad-40/+14
2019-06-23let_chains: Remove ast::ExprKind::{IfLet, WhileLet} from visitors and ↵Mazdak Farrokhzad-26/+8
introduce ::Let.
2019-06-23let_chains: Remove ast::ExprKind::{IfLet, WhileLet} and introduce ::Let.Mazdak Farrokhzad-15/+5
2019-06-22Lint empty 'derive()' as unused attribute.Mazdak Farrokhzad-4/+0
2019-06-22Lint on 'cfg_attr(,).'Mazdak Farrokhzad-10/+11
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-41/+75
2019-06-20Rollup merge of #61996 - Xanewok:unescape-raw-strings, r=matkladMazdak Farrokhzad-0/+30
Add unit tests for unescaping raw (byte) strings Adds unit tests for functionality introduced in #60793. r? @matklad @petrochenkov
2019-06-20Add unit tests for unescaping raw (byte) stringsIgor Matuszewski-0/+30
2019-06-20Rollup merge of #61968 - eddyb:hir-noclone, r=petrochenkovMazdak Farrokhzad-2/+11
rustc: disallow cloning HIR nodes. Besides being inefficient, cloning also risks creating broken HIR (without properly recreating all the IDs and whatnot, in which case you might as well reconstruct the entire node without ever `Clone`-ing anything). We detect *some* detrimental situations (based on the occurrence of `HirId`s, I believe?), but it's better to statically disallow it, IMO. One of the examples that is fixed by this PR is `tcx.hir().fn_decl{,_by_hir_id}`, which was cloning an entire `hir::FnDecl` *every single time it was called*. r? @petrochenkov cc @rust-lang/compiler
2019-06-19rustc: replace `GenericArgs::with_generic_args` hack with a plain getter.Eduard-Mihai Burtescu-2/+11
2019-06-19Rollup merge of #61547 - petrochenkov:cfgen, r=CentrilMazdak Farrokhzad-19/+7
Support `cfg` and `cfg_attr` on generic parameters `cfg` attributes are supported in all other positions where attributes are accepted at all. They were previously prohibited in https://github.com/rust-lang/rust/pull/51283 because they weren't implemented correctly before that and were simply ignored.
2019-06-19Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkorbors-7/+1
Improve the explicit_outlives_requirements lint * Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible * Remove unnecessary bounds in rustc crates
2019-06-19Support `cfg` and `cfg_attr` on generic parametersVadim Petrochenkov-19/+7
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-263/+141
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-7/+1
Also give them a span in the HIR
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-5/+5
2019-06-18resolve/expand: Move expansion info setting to a single earlier pointVadim Petrochenkov-30/+4
2019-06-18syntax: Move `default_transparency` into `ExpnInfo`Vadim Petrochenkov-1/+2
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-27/+11
2019-06-18syntax: Remove `DummyResolver`Vadim Petrochenkov-25/+0
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-200/+144
2019-06-17don't ICE on large filesAleksey Kladov-3/+16
This is an extremely marginal error, so the cost of properly threading `Handler` everywhere just not seemed justified. However, it's useful to panic when we create a file, and not when we slice strings with overflown indexes somewhere in the guts of the compiler. For this reason, while we provide safe `try_new_source_file`, we don't change the existing public interface and just panic more or less cleanly.
2019-06-16Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkovbors-11/+3
Stabilize underscore_const_names in 1.37.0 You are now permitted to write: ```rust const _: $type_expression = $term_expression; ``` That is, we change the [grammar of items](https://github.com/rust-lang-nursery/wg-grammar/blob/9d1984d7ae8d6576f943566539a31a5800644c57/grammar/item.lyg#L3-L42), as written in [the *`.lyg`* notation](https://github.com/rust-lang/gll/tree/263bf161dad903e67aa65fc591ced3cab18afa2a#grammar), from: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" } | ... ; ``` into: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" } | ... ; IdentOrUnderscore = | Named:IDENT | NoName:"_" ; ``` r? @petrochenkov
2019-06-16Auto merge of #61754 - nikomatsakis:trait-caching-perf-3, r=pnkfelixbors-2/+2
create a "provisional cache" to restore performance in the case of cycles Introduce a "provisional cache" that caches the results of auto trait resolutions but keeps them from entering the *main* cache until everything is ready. This turned out a bit more complex than I hoped, but I don't see another short term fix -- happy to take suggestions! In the meantime, it's very clear we need to rework the trait solver. This resolves the extreme performance slowdown experienced in #60846 -- I plan to add a perf.rust-lang.org regression test to track this. Caveat: I've not run `x.py test` in full yet. r? @pnkfelix cc @arielb1 Fixes #60846
2019-06-16Rollup merge of #61869 - Centril:cleanup-feature-gates, r=alexregMazdak Farrokhzad-3/+2
Cleanup some new active feature gates r? @alexreg
2019-06-16Rollup merge of #61866 - sinkuu:redundant_clone, r=petrochenkovMazdak Farrokhzad-2/+3
Remove redundant `clone()`s
2019-06-15cleanup some new active feature gates.Mazdak Farrokhzad-3/+2
2019-06-15Stabilize type_alias_enum_variants.Mazdak Farrokhzad-3/+2
2019-06-15Rollup merge of #61844 - AaronKutch:master, r=CentrilMazdak Farrokhzad-2/+2
Change `...` to `..=` where applicable This is mainly to fix #61816, but I decided to manually check a few thousand `...` throughout the code base to check for any other cases. I think I found a documentation bug in `src\libsyntax\ast.rs` where both `1..` and `1...` where mentioned. If there is internal support for both `1..` and `1..=` (that can exist before error handling gets to it), then I can add that back. There were some other cases that look like `// struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> {`, `// <P0 as Trait<P1...Pn>>::Foo: 'a`, and `assert!(min <= max, "discriminant range is {}...{}", min, max);`, but I am not sure if I should change those. There are a bunch of cases in the `/test/` directory that could be changed, but I presume I should just leave those be.
2019-06-15Rollup merge of #61813 - matthewjasper:remove-unnecessary-symbol-ops, ↵Mazdak Farrokhzad-26/+14
r=petrochenkov Remove some unnecessary symbol interner ops * Don't gensym symbols that don't need to worry about colliding with other symbols * Use symbol constants instead of interning string literals in a few places. * Don't generate a module in `__register_diagnostic` r? @petrochenkov
2019-06-15Use `slice::from_ref` instead of cloningShotaro Yamada-2/+3
2019-06-14Avoid some unnecessary symbol interner operationsMatthew Jasper-26/+14
2019-06-14Change `...` to `..=` where applicableAaron Kutch-2/+2
2019-06-14put back the workarounds for #60846Felix S Klock II-0/+11
based on https://github.com/rust-lang/rust/pull/61754#issuecomment-501743750 I am adding `bootstrap` to the cfg-preconditions for the two manual `unsafe impls`'s of `Send` and `Sync` for `TokenTree`.
2019-06-12remove hacks that are no longer neededNiko Matsakis-11/+0
2019-06-12Auto merge of #61612 - nnethercote:improve-parse_bottom_expr, r=petrochenkovbors-10/+22
Special-case literals in `parse_bottom_expr`. This makes parsing faster, particularly for code with large constants, for two reasons: - it skips all the keyword comparisons for literals; - it skips the allocation done by the `mk_expr` call in `parse_literal_maybe_minus`. r? @petrochenkov