about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-27/+53
2018-08-14Feature gate where clauses on associated type implsvarkor-4/+9
2018-08-14Adddressed #51602Pramod Bisht-1/+7
2018-08-14Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrzbors-268/+131
Move SmallVector and ThinVec out of libsyntax - move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec` - remove `libsyntax::util::SmallVector` - move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec` Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.
2018-08-14rustc_resolve: fix special-case for one-segment import paths.Eduard-Mihai Burtescu-1/+1
2018-08-14syntax: gensym the injected std/core extern crates in the Rust 2018 edition.Eduard-Mihai Burtescu-7/+30
2018-08-13Address review of RcVecDavid Tolnay-10/+5
2018-08-14syntax: add `uniform_paths` feature-gate.Eduard-Mihai Burtescu-0/+3
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-268/+131
2018-08-13Auto merge of #53270 - petrochenkov:macuse-regr, r=alexcrichtonbors-21/+25
Fix a few regressions from enabling macro modularization The first commit restores the old behavior for some minor unstable stuff (`rustc_*` and `derive_*` attributes) and adds a new feature gate for arbitrary tokens in non-macro attributes. The second commit fixes https://github.com/rust-lang/rust/issues/53205 The third commit fixes https://github.com/rust-lang/rust/issues/53144. Same technique is used as for other things blocking expansion progress - if something causes indeterminacy too often, then prohibit it. In this case referring to crate-local macro-expanded `#[macro_export]` macros via module-relative paths is prohibited, see comments in code for more details. cc https://github.com/rust-lang/rust/pull/50911
2018-08-13A few cleanups and minor improvements for the lexerljedrz-74/+134
2018-08-12TokenStream::extendDavid Tolnay-16/+270
2018-08-13Auto merge of #53051 - varkor:trait-method-pattern-arguments-error, ↵bors-15/+54
r=petrochenkov Emit error for pattern arguments in trait methods The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors. This improves the error message described in https://github.com/rust-lang/rust/issues/53046. r? @petrochenkov
2018-08-12Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakisGuillaume Gomez-0/+1
[nll] enable feature(nll) on various crates for bootstrap: part 4 #53172 r? @nikomatsakis
2018-08-12Rollup merge of #53019 - ljedrz:bad_collects, r=estebankGuillaume Gomez-1/+5
Don't collect() when size_hint is useless This adjusts PRs #52738 and #52697 by falling back to calculating capacity and extending or pushing in a loop where `collect()` can't be trusted to calculate the right capacity. It is a performance win.
2018-08-11Clean up and add extra testsvarkor-12/+3
2018-08-11Add E0642 to parser errorvarkor-3/+6
2018-08-11Emit an error during parsingvarkor-42/+62
2018-08-11Improve diagnosticsvarkor-1/+1
2018-08-11Fix handling of trait methods with bodies and improve efficiencyvarkor-19/+30
2018-08-11Emit error for pattern arguments in trait methodsvarkor-20/+34
The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors.
2018-08-11Feature gate arbitrary tokens in non-macro attributes with a separate gateVadim Petrochenkov-21/+25
Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
2018-08-10Rollup merge of #53183 - estebank:println-comma, r=oli-obkkennytm-15/+37
Suggest comma when missing in macro call When missing a comma in a macro call, suggest it, regardless of position. When a macro call doesn't match any of the patterns, check if the call's token stream could be missing a comma between two idents, and if so, create a new token stream containing the comma and try to match against the macro patterns. If successful, emit the suggestion. This works on arbitrary macros, with no need of special support from the macro writers. ``` error: no rules expected the token `d` --> $DIR/missing-comma.rs:26:18 | LL | foo!(a, b, c d, e); | -^ | | | help: missing comma here ``` Follow up to #52397.
2018-08-10Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichtonkennytm-0/+1
Whitelist wasm32 simd128 target feature r? @alexcrichton
2018-08-09[nll] libsyntax: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-09Rollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakiskennytm-1/+1
Avoid unnecessary pattern matching against Option and Result
2018-08-08Auto merge of #53053 - petrochenkov:custattr, r=alexcrichtonbors-103/+45
resolve: Support custom attributes when macro modularization is enabled Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute. Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`). Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it). The first two commits are preliminary cleanups/refactorings.
2018-08-07Suggest comma when missing in macro callEsteban Küber-15/+37
When missing a comma in a macro call, suggest it, regardless of position. When a macro call doesn't match any of the patterns, check if the call's token stream could be missing a comma between two idents, and if so, create a new token stream containing the comma and try to match against the macro patterns. If successful, emit the suggestion.
2018-08-08add wasm_target_feature feature gategnzlbg-0/+1
2018-08-07Auto merge of #52397 - estebank:println-comma, r=oli-obkbors-1/+51
Suggest comma when writing `println!("{}" a);` Fix #49370.
2018-08-07Auto merge of #51990 - oli-obk:unstable_union, r=nikomatsakisbors-0/+12
Place unions, pointer casts and pointer derefs behind extra feature gates To ensure we don't stabilize these things together with const fn stabilization (or any other stabilization) This PR moves union field accesses inside `const fn` behind a feature gate. It was possible without a feature gate before, but since `const fn` was behind a feature gate we can do this change. While "dereferencing raw pointers" and "casting raw pointers to usize" were hard errors before this PR, one could work around them by abusing unions: ```rust // deref union Foo<T> { x: &'static T, y: *const T, } const FOO: u32 = unsafe { *Foo { y: 42 as *const T }.x }; // as usize cast union Bar<T> { x: usize, y: *const T, } const BAR: usize = unsafe { Bar { y: &1u8 }.x }; ``` r? @eddyb cc @nikomatsakis
2018-08-07Also put comparing raw pointers behind a feature gateOliver Schneider-0/+3
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-0/+9
2018-08-07Rollup merge of #53135 - joshtriplett:remove-catch-from-2018-preview, ↵kennytm-1/+1
r=Mark-Simulacrum Rust 2018: Disable catch_expr, not targeted for 2018 edition Fixes #52604
2018-08-07Rollup merge of #53093 - 0e4ef622:issue-52169-fix, r=petrochenkovkennytm-0/+4
Enable macros to pass $:literal to another macro Fixes #52169.
2018-08-07Avoid unnecessary pattern matching against Option and Resultljedrz-1/+1
2018-08-06fix typoEsteban Küber-1/+1
2018-08-06Suggest comma when writing `println!("{}" a);`Esteban Küber-1/+51
2018-08-06Auto merge of #53016 - scottmcm:impl-header-lifetime-elision, r=nikomatsakisbors-1/+5
Extract impl_header_lifetime_elision out of in_band_lifetimes This way we can experiment with `impl Debug for &MyType` separately from `impl Debug for &'a MyType`. I can't say I know what the code in here is doing, so please let me know if there's a better way :slightly_smiling_face: I marked this as enabled in 2018 so that edition code continues to work without another flag. Actual feature PR https://github.com/rust-lang/rust/pull/49251; Tracking Issue https://github.com/rust-lang/rust/issues/15872; In-band lifetimes tracking issue https://github.com/rust-lang/rust/issues/44524. cc @aturon, per discussion on discord earlier cc @cramertj & @nikomatsakis, who actually wrote these features
2018-08-06Rust 2018: Disable catch_expr, not targeted for 2018 editionJosh Triplett-1/+1
Fixes #52604
2018-08-06Address review commentsVadim Petrochenkov-30/+12
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-08-06Enable macro modularization implicitly if one of "advanced" macro features ↵Vadim Petrochenkov-4/+8
is enabled Do not mark all builtin attributes as used when macro modularization is enabled
2018-08-06Support custom attributes when macro modularization is enabledVadim Petrochenkov-54/+27
2018-08-06Avoid modifying invocations in place for derive helper attributesVadim Petrochenkov-21/+4
2018-08-05Fix diagnostic_list errorvarkor-1/+1
2018-08-05Enable macros to pass $:literal to another macroMatthew Tran-0/+4
2018-08-05Change feature edition error into a warningvarkor-1/+1
2018-08-05Fix 2018 edition testsvarkor-1/+1
2018-08-05Add an error when declaring features that are stable in the current Rust editionvarkor-22/+52
2018-08-05Add special support for libcvarkor-1/+0