about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-04-12Change the hashcounts in raw `Lit` variants from usize to u16.Nicholas Nethercote-11/+16
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
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-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-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-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
2018-04-01Auto merge of #49478 - Phlosioneer:fix-windows-file-not-found, r=petrochenkovbors-1/+1
Fix escaped backslash in windows file not found message When a module is declared, but no matching file exists, rustc gives an error like `help: name the file either foo.rs or foo/mod.rs inside the directory "src/bar"`. However, at on windows, the backslash was double-escaped when naming the directory. It did this because the string was printed in debug mode (`"{:?}"`) to surround it with quotes. However, it should just be printed like any other directory in an error message and surrounded by escaped quotes, rather than relying on the debug print to add quotes (`"\"{}\""`). I also checked the test suite to see if this output is being correctly tested. It's not - it only tests up to the word "directory". Presumably this is so that the test is not dependent on its exact position in the source tree. I don't know a better way to test this, unless the test suite supports regex?
2018-03-29Fix escaped backslash in windows file not found messagePhlosioneer-1/+1
When a module is declared, but no matching file exists, rustc gives an error like 'help: name the file either foo.rs or foo/mod.rs inside the directory "src/bar"'. However, at on windows, the backslash was double-escaped when naming the directory. It did this because the string was printed in debug mode ( "{:?}" ) to surround it with quotes. However, it should just be printed like any other directory in an error message and surrounded by escaped quotes, rather than relying on the debug print to add quotes ( "\"{}\"" ).
2018-03-29Add easy edition feature flagManish Goregaokar-13/+30
2018-03-29Stabilize underscore lifetimesTaylor Cramer-8/+5
2018-03-28Stabilize match_default_bindingsTaylor Cramer-4/+3
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-28Make ParseSess thread-safeJohn Kåre Alsaker-14/+12
2018-03-28Make SyntaxExtension thread-safeJohn Kåre Alsaker-9/+13
2018-03-28Make LazyTokenStream thread-safeJohn Kåre Alsaker-15/+6
2018-03-27Rollup merge of #49417 - TimNN:fix-ios, r=alexcrichtonkennytm-6/+6
Update compiler-rt with fix for 32bit iOS ARM
2018-03-27Rollup merge of #49395 - petrochenkov:obsolete, r=alexcrichtonkennytm-74/+0
libsyntax: Remove obsolete.rs This little piece of infra is obsolete (ha-ha) and is unlikely to be used in the future, even if new obsolete syntax appears.
2018-03-27Rollup merge of #49369 - petrochenkov:rprint, r=oli-obkkennytm-2/+13
Fix pretty-printing for raw identifiers
2018-03-27Auto merge of #49279 - varkor:generated-closure-return-type, r=alexcrichtonbors-6/+6
Fix implicit closure return type generation for libsyntax The `lambda` function for constructing closures in libsyntax was explicitly setting the return type to `_`, which resulted in incorrect corresponding syntax (as `|| -> _ x` is not valid, without the enclosing brackets). This meant the generated code, when printed, was invalid. I also took the opportunity to slightly improve the generated code for the `RustcEncodable::encode` method for unit structs. Fixes #42213.
2018-03-27libsyntax: Remove obsolete.rsVadim Petrochenkov-74/+0
2018-03-27Fix pretty-printing for raw identifiersVadim Petrochenkov-2/+13
2018-03-26Fix missed i128 feature gatesMark Mansi-2/+2
2018-03-26Stabilize i128 feature tooMark Mansi-4/+8