summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-05-06Fix assertion message generationShotaro Yamada-1/+2
2018-04-30Remove new enum variant from #50092 backportPietro Albini-9/+0
ExpansionKind::ForeignItems was added in #49350, which is not included in the 1.26 beta.
2018-04-30Warn on pointless `#[derive]` in more placesAustin Bonander-14/+86
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes #49934
2018-04-27Feature gate where clauses on associated typesMatthew Jasper-2/+6
2018-04-21Revert stabilization of `feature(never_type)`.Felix S. Klock II-0/+7
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-20Remove `underscore_lifetimes` and `match_default_bindings` from active ↵kennytm-6/+0
feature list These are already stabilized in 1.26.
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-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-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
2018-03-26Stabilize i128_typeMark Mansi-16/+3
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-3/+2
2018-03-26Stabilize universal_impl_traitTaylor Cramer-3/+2
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-23/+3
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25Rollup merge of #49268 - ordovicia:dotdot-pattern-diag, r=petrochenkovkennytm-1/+7
Better diagnostics for '..' pattern fragment not in the last position Fixes #49257.
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-6/+8
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-24Better diagnostics for '..' pattern fragment not in the last positionHidehito Yabuuchi-1/+7
2018-03-23Merge branch '49001_epoch' of https://github.com/klnusbaum/rust into rollupAlex Crichton-36/+36
2018-03-23Merge branch 'master' of https://github.com/Lymia/rust into rollupAlex Crichton-128/+224
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-23/+3
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-0/+7
This commit adds a new attribute to the Rust compiler specific to the wasm target (and no other targets). The `#[wasm_import_module]` attribute is used to specify the module that a name is imported from, and is used like so: #[wasm_import_module = "./foo.js"] extern { fn some_js_function(); } Here the import of the symbol `some_js_function` is tagged with the `./foo.js` module in the wasm output file. Wasm-the-format includes two fields on all imports, a module and a field. The field is the symbol name (`some_js_function` above) and the module has historically unconditionally been `"env"`. I'm not sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd like the ability to configure it! The proposed ES module integration with wasm (aka a wasm module is "just another ES module") requires that the import module of wasm imports is interpreted as an ES module import, meaning that you'll need to encode paths, NPM packages, etc. As a result, we'll need this to be something other than `"env"`! Unfortunately neither our version of LLVM nor LLD supports custom import modules (aka anything not `"env"`). My hope is that by the time LLVM 7 is released both will have support, but in the meantime this commit adds some primitive encoding/decoding of wasm files to the compiler. This way rustc postprocesses the wasm module that LLVM emits to ensure it's got all the imports we'd like to have in it. Eventually I'd ideally like to unconditionally require this attribute to be placed on all `extern { ... }` blocks. For now though it seemed prudent to add it as an unstable attribute, so for now it's not required (as that'd force usage of a feature gate). Hopefully it doesn't take too long to "stabilize" this! cc rust-lang-nursery/rust-wasm#29
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+8
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Use FunctionRetTy::Default rather than an explicit TyKind::Infer for ↵varkor-6/+6
lambda-building This prevents explicit `-> _` return type annotations for closures generated by `lambda`.
2018-03-22Clarify description of raw_identifiers feature flag.Lymia Aluysia-1/+1
2018-03-22Clean up raw identifier handling when recovering tokens from AST.Lymia Aluysia-4/+5
2018-03-22Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebankkennytm-9/+14
address some FIXME whose associated issues were marked as closed part of #44366
2018-03-20Revert "Stabilize termination_trait in 1.25, not 1.26"Tyler Mandry-2/+2
This reverts commit e5a55e74405dedf8bc0744300a8c506eea94bc18.
2018-03-20change all appropriate EPOCH to EDITIONKurtis Nusbaum-1/+1
2018-03-20rename epoch to editionKurtis Nusbaum-36/+36
2018-03-20Auto merge of #49190 - kennytm:rollup, r=kennytmbors-60/+57
Rollup of 17 pull requests - Successful merges: #46518, #48810, #48834, #48902, #49004, #49092, #49096, #49099, #49104, #49125, #49139, #49152, #49157, #49161, #49166, #49176, #49184 - Failed merges:
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-12/+6
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-20Rollup merge of #49104 - csmoe:semicolon_error, r=petrochenkovkennytm-10/+1
improve error message of inner attribute syntax Fixes #49040
2018-03-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-4/+6
Replace many of the last references to readmes In particular, this removes the dep track readme, so it should not be merged before https://github.com/rust-lang-nursery/rustc-guide/pull/92 Fix #47935 cc #48478 r? @nikomatsakis
2018-03-20Rollup merge of #48834 - ysiraichi:suggest-remove-ref, r=estebankkennytm-46/+50
Suggest removing `&`s This implements the error message discussed in #47744. We check whether removing each `&` yields a type that satisfies the requested obligation. Also, it was created a new `NodeId` field in `ObligationCause` in order to iterate through the `&`s. The way it's implemented now, it iterates through the obligation snippet and counts the number of `&`. r? @estebank
2018-03-19Stabilize termination_trait in 1.25, not 1.26Tyler Mandry-2/+2
2018-03-19Stabilize termination_traitTyler Mandry-3/+2
This stabilizes `main` with non-() return types; see #48453.
2018-03-19Split out termination_trait_test feature gateTyler Mandry-4/+7
2018-03-18CodeMap functions refactored.Yukio Siraichi-50/+38
- Using `span_take_while` to implement others.
2018-03-18Review fixes.Yukio Siraichi-0/+16
- `span_suggestion` changed to `span_suggestion_short`; - `Span` used changed to contain only `&` refs; - Tests passing.
2018-03-18Allow raw identifiers in diagnostic macros.Lymia Aluysia-5/+5