about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2021-07-11Add diagnostics test for mistyped inclusive rangesinquisitivecrystal-0/+20
2021-07-08Rollup merge of #86932 - rylev:fix-ice-86895, r=estebankYuki Okushi-0/+11
Fix ICE when misplaced visibility cannot be properly parsed Fixes #86895 The issue was that a failure to parse the visibility was causing the original error to be dropped before being emitted. The resulting error isn't quite as nice as when the visibility is parsed properly, but I'm not sure which error to prioritize here. Displaying both errors might be too confusing. r? ```@estebank```
2021-07-07Fix ICE when misplaced visibility cannot be properly parsedRyan Levick-0/+11
2021-07-02Recover from `&dyn mut ...` parse errorsFabian Wolff-0/+24
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+193
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-1/+1
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-25Address PR feedbackRyan Levick-32/+32
2021-06-25Change how edition based future compatibility warnings are handledRyan Levick-32/+32
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-22Auto merge of #85193 - pnkfelix:readd-support-for-inner-attrs-within-match, ↵bors-10/+2
r=nikomatsakis Re-add support for parsing (and pretty-printing) inner-attributes in match body Re-add support for parsing (and pretty-printing) inner-attributes within body of a `match`. In other words, we can do `match EXPR { #![inner_attr] ARM_1 ARM_2 ... }` again. I believe this unbreaks the only four crates that crater flagged as broken by PR #83312. (I am putting this up so that the lang-team can check it out and decide whether it changes their mind about what to do regarding PR #83312.)
2021-06-20Update rustfix for compiletest.Eric Huss-9/+11
2021-06-17Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwcobors-40/+40
Handle C-variadic arguments properly when reporting region errors This pull request fixes #86053. The issue is that for a C-variadic function ```rust #![feature(c_variadic)] unsafe extern "C" fn foo(_: (), ...) {} ``` `foo`'s signature will contain only the first parameter (and have `c_variadic` set to `true`), whereas its body has a second argument (a `hir::Pat` for the `...`). The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the `...` (though not in the example above, because there are no region errors to report). I have simply restricted the iteration over the body parameters to exclude `...`, which is fine because `...` cannot cause a region error.
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-34/+0
position.
2021-06-09Handle C-variadic arguments properly when reporting region errorsFabian Wolff-40/+40
2021-06-05Fix handling of unmatched angle brackets in parserFabian Wolff-0/+73
2021-06-04Remove incorrect assertion in type parsing codeFabian Wolff-0/+62
2021-05-30Don't drop `PResult` without handling the errorLeSeulArtichaut-0/+34
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-28/+28
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-11Recover from invalid `struct` item syntaxEsteban Küber-0/+162
Parse unsupported "default field const values": ```rust struct S { field: Type = const_val, } ``` Recover from small `:` typo and provide suggestion: ```rust struct S { field; Type, field2= Type, } ```
2021-05-11Updates to tests.Felix S. Klock II-10/+2
2021-05-09remove const_fn feature gateRalf Jung-21/+20
2021-05-07Rollup merge of #84896 - estebank:issue-84772, r=jackh726Dylan DPC-0/+94
Handle incorrect placement of parentheses in trait bounds more gracefully Fix #84772. CC ``````@jonhoo``````
2021-05-06E0583: Include secondary path in error messageDeadbeef-3/+3
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-77/+139
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03Handle incorrect placement of parentheses in trait bounds more gracefullyEsteban Küber-0/+94
Fix #84772.
2021-05-03parser: Remove support for inner attributes on non-block expressionsVadim Petrochenkov-1/+73
2021-04-18Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearthbors-26/+4
Stablize `non-ascii-idents` This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467). r? `@Manishearth`
2021-04-18Auto merge of #84065 - c410-f3r:tests-tests-tests, r=petrochenkovbors-0/+25
Move some tests to more reasonable directories - 6 cc #73494 r? `@petrochenkov` git mv bad/bad-const-type.* static/ git mv bad/bad-crate-name.* extern git mv bad/bad-env-capture* fn/ git mv bad/bad-expr-lhs.* expr/ git mv bad/bad-expr-path* expr/ git mv bad/bad-extern-link-attrs.* extern/ git mv bad/bad-intrinsic-monomorphization.* intrinsics/ git mv bad/bad-lint-cap* lint/ git mv bad/bad-main.* fn git mv bad/bad-method-typaram-kind.* type/ git mv bad/bad-mid-path-type-params.* fn git mv bad/bad-module.* modules/ git mv bad/bad-sized.* type/ git mv bad/bad-type-env-capture.* fn
2021-04-17Move some tests to more reasonable directories - 6Caio-0/+25
2021-04-16Fix testsRyan Levick-77/+139
2021-04-13Rollup merge of #84140 - b-naber:parser_past_eof, r=varkorDylan DPC-0/+58
Don't call bump in check_mistyped_turbofish_with_multiple_type_params Fixes https://github.com/rust-lang/rust/issues/84117
2021-04-12add testb-naber-0/+58
2021-04-12Turn old edition lints (anonymous-parameters, keyword-idents) into ↵Manish Goregaokar-34/+35
warn-by-default on 2015
2021-04-10Auto merge of #84024 - estebank:unclosed-brace-use, r=jackh726bors-3/+42
Avoid `;` -> `,` recovery and unclosed `}` recovery from being too verbose Those two recovery attempts have a very bad interaction that causes too unnecessary output. Add a simple gate to avoid interpreting a `;` as a `,` when there are unclosed braces. Fix #83498.
2021-04-09Avoid `;` -> `,` recovery and unclosed `}` recovery from being too verboseEsteban Küber-144/+18
Those two recovery attempts have a very bad interaction that causes too unnecessary output. Add a simple gate to avoid interpreting a `;` as a `,` when there are unclosed braces.
2021-04-08Add unclosed brace in use tree testEsteban Küber-0/+165
2021-04-08rustc: Add a new `wasm` ABIAlex Crichton-1/+1
This commit implements the idea of a new ABI for the WebAssembly target, one called `"wasm"`. This ABI is entirely of my own invention and has no current precedent, but I think that the addition of this ABI might help solve a number of issues with the WebAssembly targets. When `wasm32-unknown-unknown` was first added to Rust I naively "implemented an abi" for the target. I then went to write `wasm-bindgen` which accidentally relied on details of this ABI. Turns out the ABI definition didn't match C, which is causing issues for C/Rust interop. Currently the compiler has a "wasm32 bindgen compat" ABI which is the original implementation I added, and it's purely there for, well, `wasm-bindgen`. Another issue with the WebAssembly target is that it's not clear to me when and if the default C ABI will change to account for WebAssembly's multi-value feature (a feature that allows functions to return multiple values). Even if this does happen, though, it seems like the C ABI will be guided based on the performance of WebAssembly code and will likely not match even what the current wasm-bindgen-compat ABI is today. This leaves a hole in Rust's expressivity in binding WebAssembly where given a particular import type, Rust may not be able to import that signature with an updated C ABI for multi-value. To fix these issues I had the idea of a new ABI for WebAssembly, one called `wasm`. The definition of this ABI is "what you write maps straight to wasm". The goal here is that whatever you write down in the parameter list or in the return values goes straight into the function's signature in the WebAssembly file. This special ABI is for intentionally matching the ABI of an imported function from the environment or exporting a function with the right signature. With the addition of a new ABI, this enables rustc to: * Eventually remove the "wasm-bindgen compat hack". Once this ABI is stable wasm-bindgen can switch to using it everywhere. Afterwards the wasm32-unknown-unknown target can have its default ABI updated to match C. * Expose the ability to precisely match an ABI signature for a WebAssembly function, regardless of what the C ABI that clang chooses turns out to be. * Continue to evolve the definition of the default C ABI to match what clang does on all targets, since the purpose of that ABI will be explicitly matching C rather than generating particular function imports/exports. Naturally this is implemented as an unstable feature initially, but it would be nice for this to get stabilized (if it works) in the near-ish future to remove the wasm32-unknown-unknown incompatibility with the C ABI. Doing this, however, requires the feature to be on stable because wasm-bindgen works with stable Rust.
2021-04-08Stablize `non_ascii_idents` feature.Charles Lew-26/+4
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-12/+6
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-20Move some tests to more reasonable directories - 5Caio-0/+51
2021-03-18Auto merge of #76447 - pickfire:async-pub, r=estebankbors-17/+121
Detect async visibility wrong order, `async pub` Partially address #76437.
2021-03-17Add pub as optional check_front_matterIvan Tham-17/+22
async-pub check created a regression for default
2021-03-17Add help assertion for async pub testIvan Tham-0/+6
2021-03-17Detect pub fn attr wrong order like `async pub`Ivan Tham-39/+132
Redirects `const? async? unsafe? pub` to `pub const? async? unsafe?`. Fix #76437
2021-03-17Fix bad diagnostics for anon params with refYuki Okushi-0/+14
2021-03-13Improve the wording for the `can't reassign` errorYuki Okushi-0/+6
2021-03-09rustc_target: add "unwind" payloads to `Abi`katelyn a. martin-1/+1
### Overview This commit begins the implementation work for RFC 2945. For more information, see the rendered RFC [1] and tracking issue [2]. A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. ### Feature Gate and Unstable Book This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. ### Further Work To Be Done This commit does not proceed to implement the new unwinding ABIs, and is intentionally scoped specifically to *defining* the ABIs and their feature flag. ### One Note on Test Churn This will lead to some test churn, in re-blessing hash tests, as the deleted comment in `src/librustc_target/spec/abi.rs` mentioned, because we can no longer guarantee the ordering of the `Abi` variants. While this is a downside, this decision was made bearing in mind that RFC 2945 states the following, in the "Other `unwind` Strings" section [3]: > More unwind variants of existing ABI strings may be introduced, > with the same semantics, without an additional RFC. Adding a new variant for each of these cases, rather than specifying a payload for a given ABI, would quickly become untenable, and make working with the `Abi` enum prone to mistakes. This approach encodes the unwinding information *into* a given ABI, to account for the future possibility of other `-unwind` ABI strings. ### Ignore Directives `ignore-*` directives are used in two of our `*-unwind` ABI test cases. Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases ignore architectures that do not support `stdcall` and `thiscall`, respectively. These directives are cribbed from `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and `src/test/ui/extern/extern-thiscall.rs` for `thiscall`. This would otherwise fail on some targets, see: https://github.com/rust-lang-ci/rust/commit/fcf697f90206e9c87b39d494f94ab35d976bfc60 ### Footnotes [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md [2]: https://github.com/rust-lang/rust/issues/74990 [3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-08Rollup merge of #82800 - jyn514:group-rustdoc-tests, r=Mark-SimulacrumMara Bos-0/+47
Move rustdoc UI tests into a subdirectory Helps with https://github.com/rust-lang/rust/issues/73494.
2021-03-08Move rustdoc UI tests into a subdirectoryJoshua Nelson-0/+47
This also adds a little leeway to the test limit.
2021-03-08Rollup merge of #82415 - petrochenkov:modin3, r=davidtwcoDylan DPC-11/+13
expand: Refactor module loading This is an accompanying PR to https://github.com/rust-lang/rust/pull/82399, but they can be landed independently. See individual commits for more details. Anyone should be able to review this equally well because all people actually familiar with this code left the project.