about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-04-17Auto merge of #49664 - alexcrichton:stable-simd, r=BurntSushibors-11/+16
Stabilize x86/x86_64 SIMD This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably this commit is stabilizing: * The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside. * The `is_x86_feature_detected!` macro in the standard library * The `#[target_feature(enable = "...")]` attribute * The `#[cfg(target_feature = "...")]` matcher Stabilization of the module and intrinsics were primarily done in rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in this commit. The standard library is also tweaked a bit with the new way that stdsimd is integrated. Note that other architectures like `std::arch::arm` are not stabilized as part of this commit, they will likely stabilize in the future after they've been implemented and fleshed out. Similarly the `std::simd` module is also not being stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64` is stabilized in this commit either (MMX), only SSE and up types and intrinsics are stabilized. Closes #29717 Closes #44839 Closes #48556
2018-04-16Separately gate each target_feature featureAlex Crichton-0/+11
Use an explicit whitelist for what features are actually stable and can be enabled.
2018-04-17Remove `underscore_lifetimes` and `match_default_bindings` from active ↵kennytm-6/+0
feature list These are already stabilized in 1.26.
2018-04-16Stabilize x86/x86_64 SIMDAlex Crichton-11/+5
This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably this commit is stabilizing: * The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside. * The `is_x86_feature_detected!` macro in the standard library * The `#[target_feature(enable = "...")]` attribute * The `#[cfg(target_feature = "...")]` matcher Stabilization of the module and intrinsics were primarily done in rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in this commit. The standard library is also tweaked a bit with the new way that stdsimd is integrated. Note that other architectures like `std::arch::arm` are not stabilized as part of this commit, they will likely stabilize in the future after they've been implemented and fleshed out. Similarly the `std::simd` module is also not being stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64` is stabilized in this commit either (MMX), only SSE and up types and intrinsics are stabilized. Closes #29717 Closes #44839 Closes #48556
2018-04-16Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkovbors-67/+22
Update `?` repetition disambiguation. **Do not merge** (yet) This is a test implementation of some ideas from discussion in https://github.com/rust-lang/rust/issues/48075 . This PR - disallows `?` repetition from taking a separator, since the separator is never used. - disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach? cc @durka @alexreg @nikomatsakis
2018-04-15Auto merge of #48173 - GuillaumeGomez:error-codes-libsyntax_ext, r=estebankbors-1/+4
Add error codes for libsyntax_ext I intend to add error codes for `libsyntax_ext` as well. However, they cannot be used at stage 0 directly so I thought it might be possible to enable them at the stage 1 only so we can have access to the macros. However, the error code registration seems to not work this way. Currently I get the following error: ``` error: used diagnostic code E0660 not registered --> libsyntax_ext/asm.rs:93:25 | 93 | span_err!(cx, sp, E0660, "malformed inline assembly"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: used diagnostic code E0661 not registered --> libsyntax_ext/asm.rs:151:33 | 151 | / span_err!(cx, sp, E0661, 152 | | "output operand constraint lacks '=' or '+'"); | |________________________________________________________________________________________^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 2 previous errors error: Could not compile `syntax_ext`. ``` If anyone has an idea, I'd gladly take it. I'm trying to figure this out on my side as well. I also opened this PR to know if it was worth it to continue (maybe we don't want this?). Anyway, any answer for both questions is very welcome! cc @rust-lang/compiler
2018-04-14Add error codes for libsyntax_extGuillaume Gomez-1/+4
2018-04-14Rollup merge of #49852 - alexcrichton:fix-more-proc-macros, r=nrckennytm-12/+27
proc_macro: Avoid cached TokenStream more often This commit adds even more pessimization to use the cached `TokenStream` inside of an AST node. As a reminder the `proc_macro` API requires taking an arbitrary AST node and transforming it back into a `TokenStream` to hand off to a procedural macro. Such functionality isn't actually implemented in rustc today, so the way `proc_macro` works today is that it stringifies an AST node and then reparses for a list of tokens. This strategy unfortunately loses all span information, so we try to avoid it whenever possible. Implemented in #43230 some AST nodes have a `TokenStream` cache representing the tokens they were originally parsed from. This `TokenStream` cache, however, has turned out to not always reflect the current state of the item when it's being tokenized. For example `#[cfg]` processing or macro expansion could modify the state of an item. Consequently we've seen a number of bugs (#48644 and #49846) related to using this stale cache. This commit tweaks the usage of the cached `TokenStream` to compare it to our lossy stringification of the token stream. If the tokens that make up the cache and the stringified token stream are the same then we return the cached version (which has correct span information). If they differ, however, then we will return the stringified version as the cache has been invalidated and we just haven't figured that out. Closes #48644 Closes #49846
2018-04-14macros: Do not match on "complex" nonterminals requiring AST comparisonsVadim Petrochenkov-1/+17
2018-04-13Auto merge of #49718 - petrochenkov:fieldcmp, r=eddybbors-59/+9
Hygiene 2.0: Avoid comparing fields by name There are two separate commits here (not counting tests): - The first one unifies named (`obj.name`) and numeric (`obj.0`) field access expressions in AST and HIR. Before field references in these expressions are resolved it doesn't matter whether the field is named or numeric (it's just a symbol) and 99% of code is common. After field references are resolved we work with them by index for all fields (see the second commit), so it's again not important whether the field was named or numeric (this includes MIR where all fields were already by index). (This refactoring actually fixed some bugs in HIR-based borrow checker where borrows through names (`S { 0: ref x }`) and indices (`&s.0`) weren't considered overlapping.) - The second commit removes all by-name field comparison and instead resolves field references to their indices once, and then uses those resolutions. (There are still a few name comparisons in save-analysis, because save-analysis is weird, but they are made correctly hygienic). Thus we are fixing a bunch of "secondary" field hygiene bugs (in borrow checker, lints). Fixes https://github.com/rust-lang/rust/issues/46314
2018-04-12Avoid comparing fields by name when possibleVadim Petrochenkov-5/+4
Resolve them into field indices once and then use those resolutions + Fix rebase
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-58/+9
2018-04-12Implement inferring outlives requirements for references, structs, enum, ↵toidiu-0/+9
union, and projection types. added a feature gate and tests for these scenarios.
2018-04-12Auto merge of #48528 - bitshifter:repr_packed, r=eddybbors-20/+45
Implementation of `#[repr(packed(n))]` RFC 1399. Tracking issue https://github.com/rust-lang/rust/issues/33158.
2018-04-12Auto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichtonbors-3/+3
Merge the std_unicode crate into the core crate [The standard library facade](https://github.com/rust-lang/rust/issues/27783) has historically contained a number of crates with different roles, but that number has decreased over time. `rand` and `libc` have moved to crates.io, and [`collections` was merged into `alloc`](https://github.com/rust-lang/rust/pull/42648). Today we have `core` that applies everywhere, `std` that expects a full operating system, and `alloc` in-between that only requires a memory allocator (which can be provided by users)… and `std_unicode`, which doesn’t really have a reason to be separate anymore. It contains functionality based on Unicode data tables that can be large, but as long as relevant functions are not called the tables should be removed from binaries by linkers. This deprecates the unstable `std_unicode` crate and moves all of its contents into `core`, replacing them with `pub use` reexports. The crate can be removed later. This also removes the `CharExt` trait (replaced with inherent methods in libcore) and `UnicodeStr` trait (merged into `StrExt`). There traits were both unstable and not intended to be used or named directly. A number of new items are newly-available in libcore and instantly stable there, but only if they were already stable in libstd. Fixes #49319.
2018-04-12Mark the rest of the `unicode` feature flag as perma-unstable.Simon Sapin-1/+1
2018-04-12Deprecate the std_unicode crateSimon Sapin-2/+2
2018-04-11Implementation of `#[repr(packed(n))]` RFC 1399.Cameron Hart-20/+45
2018-04-11Rollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scottmcmkennytm-1/+2
Use sort_by_cached_key where appropriate A follow-up to https://github.com/rust-lang/rust/pull/48639, converting various slice sorting calls to `sort_by_cached_key` when the key functions are more expensive.
2018-04-11Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichtonbors-1/+0
Move deny(warnings) into rustbuild This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-10proc_macro: Avoid cached TokenStream more oftenAlex Crichton-12/+27
This commit adds even more pessimization to use the cached `TokenStream` inside of an AST node. As a reminder the `proc_macro` API requires taking an arbitrary AST node and transforming it back into a `TokenStream` to hand off to a procedural macro. Such functionality isn't actually implemented in rustc today, so the way `proc_macro` works today is that it stringifies an AST node and then reparses for a list of tokens. This strategy unfortunately loses all span information, so we try to avoid it whenever possible. Implemented in #43230 some AST nodes have a `TokenStream` cache representing the tokens they were originally parsed from. This `TokenStream` cache, however, has turned out to not always reflect the current state of the item when it's being tokenized. For example `#[cfg]` processing or macro expansion could modify the state of an item. Consequently we've seen a number of bugs (#48644 and #49846) related to using this stale cache. This commit tweaks the usage of the cached `TokenStream` to compare it to our lossy stringification of the token stream. If the tokens that make up the cache and the stringified token stream are the same then we return the cached version (which has correct span information). If they differ, however, then we will return the stringified version as the cache has been invalidated and we just haven't figured that out. Closes #48644 Closes #49846
2018-04-10Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoeristerbors-38/+31
More thread-safety changes r? @michaelwoerister
2018-04-09in which `!` is suggested for erroneous identifier `not`Zack M. Davis-2/+52
Impressing confused Python users with magical diagnostics is perhaps worth this not-grossly-unreasonable (only 40ish lines) extra complexity in the parser? Thanks to Vadim Petrochenkov for guidance. This resolves #46836.
2018-04-09don't suggest placing code in block if next token is open-braceZack M. Davis-0/+5
Thanks to the inestimably inimitable Esteban "Estebank" Küber for pointing this out. This is relevant to #46836.
2018-04-09Convert sort_by to sort_by_cached_keyvarkor-1/+2
2018-04-09Auto merge of #49673 - ollie27:stab, r=sfacklerbors-1/+1
Correct a few stability attributes * `const_indexing` language feature was stabilized in 1.26.0 by #46882 * `Display` impls for `PanicInfo` and `Location` were stabilized in 1.26.0 by #47687 * `TrustedLen` is still unstable so its impls should be as well even though `RangeInclusive` was stabilized by #47813 * `!Send` and `!Sync` for `Args` and `ArgsOs` were stabilized in 1.26.0 by #48005 * `EscapeDefault` has been stable since 1.0.0 so should continue to show that even though it was moved to core in #48735 This could be backported to beta like #49612
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-07Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakisbors-2/+0
Bump the bootstrap compiler to 1.26.0 beta Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-07Inject the `compiler_builtins` crate whenever the `core` crate is injectedOliver Schneider-16/+27
2018-04-06Fix feature gating for crate/extern in pathsVadim Petrochenkov-2/+10
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-96/+77
2018-04-06Make lifetime nonterminals closer to identifier nonterminalsVadim Petrochenkov-47/+47
2018-04-06Remove more duplicated spansVadim Petrochenkov-97/+79
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-18/+14
2018-04-06Use `Span::apply_mark` where possibleVadim Petrochenkov-5/+5
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-117/+95
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-44/+40
2018-04-06Use `Span` instead of `SyntaxContext` in `Ident`Vadim Petrochenkov-15/+12
2018-04-05No separator for `?`. No `?` as a separator.Mark Mansi-67/+22
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-58/+209
Expand macros in `extern {}` blocks This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature. A tracking issue is now open at #49476 closes #48747
2018-04-05Correct a few stability attributesOliver Middleton-1/+1
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-2/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-05Auto merge of #49684 - kennytm:rollup, r=kennytmbors-6/+6
Rollup of 9 pull requests Successful merges: - #48658 (Add a generic CAS loop to std::sync::Atomic*) - #49253 (Take the original extra-filename passed to a crate into account when resolving it as a dependency) - #49345 (RFC 2008: Finishing Touches) - #49432 (Flush executables to disk after linkage) - #49496 (Add more vec![... ; n] optimizations) - #49563 (add a dist builder to build rust-std components for the THUMB targets) - #49654 (Host compiler documentation: Include private items) - #49667 (Add more features to rust_2018_preview) - #49674 (ci: Remove x86_64-gnu-incremental builder) Failed merges:
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-18/+2
2018-04-04Add more features to rust_2018_previewManish Goregaokar-6/+6
2018-04-03expand macro invocations in `extern {}` blocksAustin Bonander-58/+209
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-53/+4
Closes #22181, #27779
2018-04-02Auto merge of #49252 - Manishearth:easy-feature-flag, r=nikomatsakisbors-13/+30
Easy edition feature flag We no longer gate features on epochs; instead we have a `#![feature(rust_2018_preview)]` that flips on a bunch of features (currently dyn_trait). Based on #49001 to avoid merge conflicts r? @nikomatsakis
2018-04-02Auto merge of #49124 - abonander:attr-macro-stmt-expr, r=abonanderbors-30/+106
Expand Attributes on Statements and Expressions This enables attribute-macro expansion on statements and expressions while retaining the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356 @petrochenkov @jseyfried r? @nrc
2018-04-02Expand attribute macros on statements and expressions.Austin Bonander-30/+106
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356