summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2020-12-27Make recursion limit fatal in projectMatthew Jasper-2/+1
This avoid the hang/oom from #79714
2020-11-12Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=petrochenkovMara Bos-10/+38
Implement destructuring assignment for structs and slices This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: #71126). This PR is the second part of #71156, which was split up to allow for easier review. Note that the first PR (#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If ``@petrochenkov`` prefers to wait until the first PR is merged, I totally understand, of course. This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following *parser change* was necessary: struct expressions are not required to have a base expression, i.e. `Struct { a: 1, .. }` becomes legal (in order to act like a struct pattern). Unfortunately, this PR slightly regresses the diagnostics implemented in #77283. However, it is only a missing help message in `src/test/ui/issues/issue-77218.rs`. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR. Thanks to ``@varkor`` who helped with the implementation, particularly around the struct rest changes. r? ``@petrochenkov``
2020-11-11Implement destructuring assignment for structs and slicesFabian Zaiser-10/+38
Co-authored-by: varkor <github@varkor.com>
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-0/+83
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-09Update src/test/ui/issues/issue-76547.rsTyler Mandry-1/+1
Co-authored-by: Camelid <camelidcamel@gmail.com>
2020-11-09add nll compare mode stderr fileGus Wynn-0/+20
2020-11-09Add `#[cfg(panic = "...")]`David Hewitt-2/+2
2020-11-01Add delay_span_bug to no longer ICEkadmin-0/+16
2020-11-01Auto merge of #78553 - Nadrieril:fix-78549, r=varkorbors-6/+6
Fix #78549 Before #78430, this worked because `specialize_constructor` didn't actually care too much which constructor was passed to it unless needed. That PR however handles `&str` as a special case, and I did not anticipate patterns for the `&str` type other than string literals. I am not very confident there are not other similar oversights left, but hopefully only `&str` was different enough to break my assumptions. Fixes https://github.com/rust-lang/rust/issues/78549
2020-11-01Fix #78549Nadrieril-6/+6
Before #78430, string literals worked because `specialize_constructor` didn't actually care too much which constructor was passed to it unless needed. Since then, string literals are special cased and a bit hacky. I did not anticipate patterns for the `&str` type other than string literals, hence this bug. This makes string literals less hacky.
2020-10-31Auto merge of #76257 - JulianKnodt:i75777, r=Dylan-DPCbors-0/+60
Add regression test This adds a regression test for #75777, effectively closing it since it is solved on nightly and beta. Closes #75777
2020-10-30Rollup merge of #78545 - jackh726:anonymous, r=oli-obkYuki Okushi-5/+5
Make anonymous binders start at 0 A few changes to some test outputs, but these actually look *more* correct to me.
2020-10-30Add regression testkadmin-0/+60
2020-10-30Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakisbors-0/+45
Handle type errors in closure/generator upvar_tys Fixes #77993
2020-10-29Make anonymous binders start at 0Jack Huey-5/+5
2020-10-29Rollup merge of #78422 - estebank:fix-78372, r=pnkfelixJonas Schievink-0/+76
Do not ICE on invalid input Fix #78372.
2020-10-29Auto merge of #78430 - Nadrieril:taking-constructors-seriously2, r=varkorbors-6/+6
Clarify main code paths in exhaustiveness checking This PR massively clarifies the main code paths of exhaustiveness checking, by using the `Constructor` enum to a fuller extent. I've been itching to write it for more than a year, but the complexity of matching consts had prevented me. Behold a massive simplification :D. This in particular removes a fair amount of duplication between various parts, localizes code into methods of relevant types when applicable, makes some implicit assumptions explicit, and overall improves legibility a lot (or so I hope). Additionally, after my changes undoing #76918 turned out to be a noticeable perf gain. As usual I tried my best to make the commits self-contained and easy to follow. I've also tried to keep the code well-commented, but I tend to forget how complex this file is; I'm happy to clarify things as needed. My measurements show good perf improvements on the two match-heavy benchmarks (-18.0% on `unicode_normalization-check`! :D); I'd like a perf run to check the overall impact. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-10-28Rollup merge of #78401 - ↵Dylan DPC-11/+45
davidtwco:issue-75906-tuple-construct-private-field, r=estebank resolve: private fields in tuple struct ctor diag Fixes #75906. This PR improves the diagnostic emitted when a tuple struct is being constructed which has private fields so that private fields are labelled and the message is improved. r? @estebank
2020-10-28Rollup merge of #78379 - estebank:fn-signature-parse, r=varkorDylan DPC-11/+4
Tweak invalid `fn` header and body parsing * Rely on regular "expected"/"found" parser error for `fn`, fix #77115 * Recover empty `fn` bodies when encountering `}` * Recover trailing `>` in return types * Recover from non-type in array type `[<BAD TOKEN>; LEN]`
2020-10-27Add unsized_fn_params featureSantiago Pastorino-10/+10
2020-10-27Disable "optimization to avoid load of address" in InstCombineJonas Schievink-0/+17
2020-10-27Handle type errors in closure/generator upvar_tysAman Arora-0/+45
Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2020-10-27Be honest about being able to list constructorsNadrieril-6/+6
The test change is because we used to treat `&str` like other `&T`s, ie as having a single constructor. That's not quite true though since we consider `&str` constants as atomic instead of refs to `str` constants.
2020-10-26Do not ICE on invalid inputEsteban Küber-0/+76
2020-10-27Rollup merge of #78388 - camelid:regression-tests, r=lcnrYuki Okushi-0/+34
Add some regression tests Closes #75763. Closes #76179.
2020-10-26Auto merge of #77187 - TimDiekmann:box-alloc, r=Amanieubors-9/+9
Support custom allocators in `Box` r? `@Amanieu` This pull request requires a crater run. ### Prior work: - #71873 - #58457 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate Currently blocked on: - ~#77118~ - ~https://github.com/rust-lang/chalk/issues/615 (#77515)~
2020-10-26Add FIXME note to const generics testCamelid-0/+1
Co-authored-by: lcnr <bastian_kauschke@hotmail.de>
2020-10-26Add some regression testsCamelid-0/+33
2020-10-26resolve: private fields in tuple struct ctor diagDavid Wood-11/+45
This commit improves the diagnostic emitted when a tuple struct is being constructed which has private fields so that private fields are labelled and the message is improved. Signed-off-by: David Wood <david@davidtw.co>
2020-10-26Auto merge of #78387 - Dylan-DPC:rollup-ch0st6z, r=Dylan-DPCbors-0/+134
Rollup of 10 pull requests Successful merges: - #74477 (`#[deny(unsafe_op_in_unsafe_fn)]` in sys/wasm) - #77836 (transmute_copy: explain that alignment is handled correctly) - #78126 (Properly define va_arg and va_list for aarch64-apple-darwin) - #78137 (Initialize tracing subscriber in compiletest tool) - #78161 (Add issue template link to IRLO) - #78214 (Tweak match arm semicolon removal suggestion to account for futures) - #78247 (Fix #78192) - #78252 (Add codegen test for #45964) - #78268 (Do not try to report on closures to avoid ICE) - #78295 (Add some regression tests) Failed merges: r? `@ghost`
2020-10-26Rollup merge of #78295 - Alexendoo:ice-regression-tests, r=nagisaDylan DPC-0/+134
Add some regression tests Closes #56229 Closes #59494 Closes #70746 Closes #73229
2020-10-26Auto merge of #77283 - estebank:if-let-sugg, r=Mark-Simulacrumbors-0/+21
Tweak `if let` suggestion to be more liberal with suggestion and to not ICE Fix #77218. Fix #77238.
2020-10-25Tweak invalid `fn` header and body parsingEsteban Küber-8/+1
* Recover empty `fn` bodies when encountering `}` * Recover trailing `>` in return types * Recover from non-type in array type `[<BAD TOKEN>; LEN]`
2020-10-25Tweak `if let` suggestion to be more liberal with suggestion and to not ICEEsteban Küber-0/+21
Fix #77218. Fix #77238.
2020-10-25Rely on regular "expected"/"found" parser error for `fn`Esteban Küber-6/+6
2020-10-25Merge remote-tracking branch 'upstream/master' into box-allocTim Diekmann-197/+362
2020-10-24Rollup merge of #78072 - Nadrieril:cleanup-constant-matching, r=varkorJonas Schievink-50/+0
Cleanup constant matching in exhaustiveness checking This supercedes https://github.com/rust-lang/rust/pull/77390. I made the `Opaque` constructor work. I have opened two issues https://github.com/rust-lang/rust/issues/78071 and https://github.com/rust-lang/rust/issues/78057 from the discussion we had on the previous PR. They are not regressions nor directly related to the current PR so I thought we'd deal with them separately. I left a FIXME somewhere because I didn't know how to compare string constants for equality. There might even be some unicode things that need to happen there. In the meantime I preserved previous behavior. EDIT: I accidentally fixed #78071
2020-10-24Rollup merge of #77930 - estebank:ice-77919, r=eddybJonas Schievink-0/+59
Do not ICE with TraitPredicates containing [type error] Fix #77919.
2020-10-24Add some regression testsAlex Macleod-0/+134
Closes #56229 Closes #59494 Closes #70746 Closes #73229
2020-10-23Do not ICE with TraitPredicates containing [type error]Esteban Küber-0/+59
Fix #77919.
2020-10-23Auto merge of #77015 - davidtwco:check-attr-variant-closure-expr, r=lcnrbors-36/+20
passes: `check_attr` on more targets This PR modifies `check_attr` so that: - Enum variants are now checked (some attributes would not have been prohibited on variants previously). - `check_expr_attributes` and `check_stmt_attributes` are removed as `check_attributes` can perform the same checks. This means that codegen attribute errors aren't shown if there are other errors first (e.g. from other attributes, as shown in `src/test/ui/macros/issue-68060.rs` changes below).
2020-10-23Rollup merge of #78263 - JohnTitor:mir-opt-ice-test, r=lcnrYuki Okushi-0/+4
Add regression test of issue-77668 Closes #77668
2020-10-23Rollup merge of #77488 - varkor:repr128-incomplete_features, r=jonas-schievinkYuki Okushi-0/+12
Mark `repr128` as `incomplete_features` As mentioned in https://github.com/rust-lang/rust/issues/56071 and noticed in https://github.com/rust-lang/rust/issues/77457, `repr(u128)` and `repr(i128)` do not work properly due to lack of LLVM support. We should thus warn users trying to use the feature that they may encounter ICEs when using it. Closes https://github.com/rust-lang/rust/issues/77457.
2020-10-23Make it regression test of issue-77668Yuki Okushi-0/+4
2020-10-21Mark `repr128` as `incomplete_features`varkor-0/+12
2020-10-21Auto merge of #78077 - petrochenkov:qvis, r=davidtwcobors-3/+3
Calculate visibilities once in resolve Then use them through a query based on resolver outputs. Item visibilities were previously calculated in three places - initially in `rustc_resolve`, then in `rustc_privacy` during type privacy checkin, and then in `rustc_metadata` during metadata encoding. The visibility logic is not entirely trivial, especially for things like constructors or enum variants, and all of it was duplicated. This PR deduplicates all the visibility calculations, visibilities are determined once during early name resolution and then stored in `ResolverOutputs` and are later available through `tcx` as a query `tcx.visibility(def_id)`. (This query existed previously, but only worked for other crates.) Some special cases (e.g. visibilities for closure types, which are needed for type privacy checking) are not processed in resolve, but deferred and performed directly in the query instead.
2020-10-21Rollup merge of #78063 - camelid:improve-cannot-multiply-error, r=estebankYuki Okushi-6/+6
Improve wording of "cannot multiply" type error For example, if you had this code: fn foo(x: i32, y: f32) -> f32 { x * y } You would get this error: error[E0277]: cannot multiply `f32` to `i32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32` However, that's not usually how people describe multiplication. People usually describe multiplication like how the division error words it: error[E0277]: cannot divide `i32` by `f32` --> src/lib.rs:2:7 | 2 | x / y | ^ no implementation for `i32 / f32` | = help: the trait `Div<f32>` is not implemented for `i32` So that's what this change does. It changes this: error[E0277]: cannot multiply `f32` to `i32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32` To this: error[E0277]: cannot multiply `i32` by `f32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32`
2020-10-21Rollup merge of #78002 - estebank:issue-77598, r=oli-obkYuki Okushi-59/+96
Tweak "object unsafe" errors CC #77598.
2020-10-20Rollup merge of #78061 - wesleywiser:opt_zst_const_interning, r=oli-obkGuillaume Gomez-0/+5
Optimize const value interning for ZST types Interning can skip any inhabited ZST type in general. Fixes #68010 r? @oli-obk
2020-10-20review commentsEsteban Küber-17/+17