about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-03-15Rollup merge of #70011 - petrochenkov:asyncice, r=CentrilMazdak Farrokhzad-0/+13
def_collector: Fully visit async functions We forgot to visit attributes previously, it caused ICEs. Special treatment of async functions is also moved from `visit_item` to `visit_fn` to reuse more of the default visitor. Fixes https://github.com/rust-lang/rust/issues/67778.
2020-03-15Rollup merge of #70006 - petrochenkov:fresh, r=CentrilMazdak Farrokhzad-0/+88
resolve: Fix two issues in fresh binding disambiguation Prevent fresh bindings from shadowing ambiguity items. Fixes https://github.com/rust-lang/rust/issues/46079 Correctly treat const generic parameters in fresh binding disambiguation. Fixes https://github.com/rust-lang/rust/issues/68853
2020-03-15resolve: Prevent fresh bindings from shadowing ambiguity itemsVadim Petrochenkov-0/+88
Correctly treat const generic parameters in fresh binding disambiguation
2020-03-15Rollup merge of #69993 - ↵Dylan DPC-0/+1
ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC Add long error explanation for E0693 Add long explanation for the E0693 error code Part of #61137 r? @GuillaumeGomez
2020-03-15Rollup merge of #69498 - mark-i-m:describe-it-2, r=matthewjasperDylan DPC-175/+175
Change "method" to "associated function" r? @matthewjasper cc @Centril @eddyb #67742 I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it... The relevant changes are the last two commits (it is rebased on top of #67742)
2020-03-15def_collector: Fully visit async functionsVadim Petrochenkov-0/+13
2020-03-14Add long error explanation for E0693 #61137Ayush Kumar Mishra-0/+1
2020-03-14Auto merge of #69716 - jonas-schievink:generator-size, r=tmandrybors-1/+33
Don't store locals in generators that are immediately overwritten with the resume argument This fixes https://github.com/rust-lang/rust/issues/69672 and makes https://github.com/rust-lang/rust/pull/69033 pass the async fn size tests again (in other words, there will be no size regression of async fn if both this and https://github.com/rust-lang/rust/pull/69033 land). ~~This is a small botch and I'd rather have a more precise analysis, but that seems much harder to pull off, so this special-cases `Yield` terminators that store the resume argument into a simple local (ie. without any field projections) and explicitly marks that local as "not live" in the suspend point of that yield. We know that this local does not need to be stored in the generator for this suspend point because the next resume would immediately overwrite it with the passed-in resume argument anyways. The local might still end up in the state if it is used across another yield.~~ (this now properly updates the dataflow framework to handle this case)
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-56/+23
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-14Rollup merge of #69966 - JohnTitor:more-more-tests, r=CentrilYuki Okushi-0/+128
Add more regression tests Closes #58490, closes #60390, closes #62504, closes #67739, closes #69092 r? @Centril
2020-03-14Rollup merge of #69960 - RalfJung:abort, r=oli-obkYuki Okushi-1/+1
miri engine: fix treatment of abort intrinsic I screwed up in https://github.com/rust-lang/rust/pull/69830 and added `abort` to the wrong block of intrinsics, namely the one that actually has a return place. So that branch was never actually reached. r? @oli-obk
2020-03-14Rollup merge of #69460 - LeSeulArtichaut:move-compile-pass, r=RalfJungYuki Okushi-20/+23
Move some `build-pass` tests to `check-pass` Helps with #62277. r? @cramertj cc @Centril
2020-03-13bless testsRalf Jung-1/+1
2020-03-13Add test for issue-69092Yuki Okushi-0/+21
2020-03-13Add test for issue-67739Yuki Okushi-0/+26
2020-03-13Add test for issue-62504Yuki Okushi-0/+33
2020-03-13Add test for issue-60390Yuki Okushi-0/+8
2020-03-13Add test for issue-58490Yuki Okushi-0/+40
2020-03-12update testsMark Mansi-175/+175
2020-03-12Move some more tests to `check-pass`LeSeulArtichaut-3/+6
2020-03-12Move some const-eval `build-pass` tests to `check-pass`LeSeulArtichaut-20/+20
2020-03-12Rollup merge of #69722 - estebank:negative-impl-span-ast, r=CentrilMazdak Farrokhzad-73/+83
Tweak output for invalid negative impl AST errors Use more accurate spans for negative `impl` errors. r? @Centril
2020-03-11Rollup merge of #69876 - ↵Mazdak Farrokhzad-0/+1
ayushmishra2005:doc/61137-add-long-error-code-e0739, r=Dylan-DPC Add long error explanation for E0739 Add long explanation for the E0739 error code Part of #61137 r? @GuillaumeGomez
2020-03-11Rollup merge of #69760 - Centril:parse-expr-improve, r=estebankMazdak Farrokhzad-161/+627
Improve expression & attribute parsing This PR includes misc improvements to expression and attribute parsing. 1. Some code simplifications 2. Better recovery for various block forms, e.g. `loop statements }` (missing `{` after `loop`). (See e.g., `block-no-opening-brace.rs` among others for examples.) 3. Added recovery for e.g., `unsafe $b` where `$b` refers to a `block` macro fragment. (See `bad-interpolated-block.rs` for examples.) 4. ^--- These are done so that code sharing in block parsing is increased. 5. Added recovery for e.g., `'label: loop { ... }` (See `labeled-no-colon-expr.rs`.) 6. Added recovery for e.g., `&'lifetime expr` (See `regions-out-of-scope-slice.rs`.) 7. Added recovery for e.g., `fn foo() = expr;` (See `fn-body-eq-expr-semi.rs`.) 8. Simplified attribute parsing code & slightly improved diagnostics. 9. Added recovery for e.g., `Box<('a) + Trait>`. 10. Added recovery for e.g, `if true #[attr] {} else #[attr] {} else #[attr] if true {}`. r? @estebank
2020-03-11Rollup merge of #69896 - petrochenkov:reqname2, r=CentrilMazdak Farrokhzad-0/+22
parse: Tweak the function parameter edition check Follow-up to https://github.com/rust-lang/rust/pull/69801. Edition of a code fragment is inferred from "the place where the code is written". For individual tokens like edition-specific keywords it may be the span of the token itself ("uninterpolated" span), but for larger code fragments it's probably not, in the test example the trait method is obviously written in "2015 edition code". r? @Centril
2020-03-11Rollup merge of #69891 - Centril:fix-69875, r=varkorMazdak Farrokhzad-0/+43
Exhaustiveness checking, `Matrix::push`: recursively expand or-patterns > There's an implicit invariant that there should be no or-patterns directly in the first column of the matrix, but this invariant is broken exactly when an or-pattern has a child that is itself an or-pattern. Here we preserve this broken invariant by recursively expanding `PatKind::Or`s in `Matrix::push`. Fixes https://github.com/rust-lang/rust/issues/69875. r? @varkor cc @Nadrieril cc https://github.com/rust-lang/rust/issues/54883
2020-03-11Rollup merge of #69859 - contrun:fix-62456, r=matthewjasperMazdak Farrokhzad-1/+33
fix #62456 closes https://github.com/rust-lang/rust/issues/62456
2020-03-11Rollup merge of #69825 - lcnr:discriminant, r=oli-obkMazdak Farrokhzad-0/+40
make `mem::discriminant` const implements #69821, which could be used as a tracking issue for `const_discriminant`. Should this be added to the meta tracking issue #57563? @Lokathor
2020-03-11Rollup merge of #69591 - matthewjasper:query-response-relate, r=nikomatsakisMazdak Farrokhzad-0/+33
Use TypeRelating for instantiating query responses `eq` can add constraints to `RegionConstraintData`, which isn't allowed during borrow checking outside of a `CustomTypeOp`. Use `TypeRelating` instead to always push constraints to the obligations list. closes #69490
2020-03-11Rollup merge of #69373 - tspiteri:const_int_conversion, r=oli-obkMazdak Farrokhzad-2/+0
Stabilize const for integer {to,from}_{be,le,ne}_bytes methods All of these functions can be implemented simply and naturally as const functions, e.g. `u32::from_le_bytes` can be implemented as ```rust (bytes[0] as u32) | (bytes[1] as u32) << 8 | (bytes[2] as u32) << 16 | (bytes[3] as u32) << 24 ``` So stabilizing the constness will not expose that internally they are implemented using transmute which is not const in stable.
2020-03-11Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddybMazdak Farrokhzad-102/+170
mem::zeroed/uninit: panic on types that do not permit zero-initialization r? @eddyb @oli-obk Cc https://github.com/rust-lang/rust/issues/62825 Also see [this summary comment](https://github.com/rust-lang/rust/pull/66059#issuecomment-586734747)
2020-03-10review commentsEsteban Küber-31/+6
2020-03-10parse: Tweak the function parameter edition checkVadim Petrochenkov-0/+22
Move anon-params tests to ui/anon-params.
2020-03-10Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddybbors-204/+123
Cleanup `rmeta::MacroDef` Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`. The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well. Fixes #49511. r? @eddyb cc @matthewjasper @estebank @petrochenkov
2020-03-10Matrix::push: recursively expand or-patternsMazdak Farrokhzad-0/+43
2020-03-10explain the use of a custom identity functionBastian Kauschke-0/+3
2020-03-10parse_if_expr: recover on attributesMazdak Farrokhzad-56/+59
2020-03-10trait-object-lifetime-parens: improve recovery.Mazdak Farrokhzad-27/+29
2020-03-10use check_path moreMazdak Farrokhzad-1/+1
2020-03-10simplify & improve parse_ty_tuple_or_parensMazdak Farrokhzad-43/+89
2020-03-10issue 68890: add more minimal reproMazdak Farrokhzad-0/+17
2020-03-10error_block_no_opening_brace: handle closures betterMazdak Farrokhzad-10/+10
2020-03-10block-no-opening-brace: add another statementMazdak Farrokhzad-44/+45
2020-03-10parser: add note for `'label expr`.Mazdak Farrokhzad-0/+12
2020-03-10parse_labeled_expr: add a suggestion on missing colon.Mazdak Farrokhzad-11/+18
2020-03-10unify/improve/simplify attribute parsingMazdak Farrokhzad-41/+38
2020-03-10parse: recover on `fn foo() = expr;`Mazdak Farrokhzad-0/+140
2020-03-10parse: recover on `&'lt $expr` / `'lt $expr`.Mazdak Farrokhzad-8/+105
2020-03-10more reuse in block parsing & improve diagnostics.Mazdak Farrokhzad-7/+68
2020-03-10use error_block_no_opening_brace moreMazdak Farrokhzad-0/+83