about summary refs log tree commit diff
path: root/src/test/ui/drop
AgeCommit message (Collapse)AuthorLines
2021-12-09Add needs-unwind to tests that depend on panickingDavid Koloski-0/+4
This directive isn't automatically set by compiletest or x.py, but can be turned on manually for targets that require it.
2021-11-23Auto merge of #90788 - ecstatic-morse:issue-90752, r=wesleywiserbors-0/+73
Mark places as initialized when mutably borrowed Fixes the example in #90752, but does not handle some corner cases involving raw pointers and unsafe. See [this comment](https://github.com/rust-lang/rust/issues/90752#issuecomment-965822895) for more information, or the second test. Although I talked about both `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` in #90752, this PR only changes the latter. That's because "maybe uninitialized" is the conservative choice, and marking them as definitely initialized (`!maybe_uninitialized`) when a mutable borrow is created could lead to problems if `addr_of_mut` to an uninitialized local is allowed. Additionally, places cannot become uninitialized via a mutable reference, so if a place is definitely initialized, taking a mutable reference to it should not change that. I think it's correct to ignore interior mutability as nbdd0121 suggests below. Their analysis doesn't work inside of `core::cell`, which *does* have access to `UnsafeCell`'s field, but that won't be an issue unless we explicitly instantiate one with an `enum` within that module. r? `@wesleywiser`
2021-11-14Move some tests to more reasonable directoriesCaio-0/+18
2021-11-13Add raw pointer variant of #90752 with incorrect behaviorDylan MacKenzie-0/+41
2021-11-13Add regression test for #90752Dylan MacKenzie-0/+32
2021-11-06Move some tests to more reasonable directoriesCaio-0/+53
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-11/+5
2021-09-01Fix drop handling for `if let` expressionsMatthew Jasper-0/+7
MIR lowering for `if let` expressions is now more complicated now that `if let` exists in HIR. This PR adds a scope for the variables bound in an `if let` expression and then uses an approach similar to how we handle loops to ensure that we reliably drop the correct variables.
2021-08-24Also fix “a RwLock*”Frank Steffahn-1/+1
2021-06-04removed more uses of feature gatemarcusdunn-1/+0
2021-02-04Revert "Avoid leaking block expression values"Felix S. Klock II-379/+223
This reverts commit 4fef39113a514bb270f5661a82fdba17d3e41dbb.
2021-02-03Allow/fix non_fmt_panic in tests.Mara Bos-3/+3
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+103
Address comments Update limits
2021-01-11Move some tests to more reasonable directoriesCaio-0/+30
2020-12-04Avoid leaking block expression valuesMatthew Jasper-223/+379
2020-11-29Update tests to remove old numeric constantsbstrie-2/+0
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-10-16stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union'Ralf Jung-1/+1
2020-09-15Stabilize move_ref_patternAmjad Alsharafi-3/+0
2020-03-07test(bindings_after_at): add dynamic drop tests for bindings_after_atMatthew Kuo-0/+48
2020-02-09Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasperbors-0/+18
Initial implementation of `#![feature(move_ref_pattern)]` Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary. Closes #45600. Tracking issue: #68354. r? @matthewjasper
2020-02-02move_ref_patterns: introduce testsMazdak Farrokhzad-0/+18
bindings_after_at: harden tests
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-1/+1
2020-01-18slice_patterns: remove gates in testsMazdak Farrokhzad-5/+3
2019-12-09Add more tests for borrowck and dropck slice pattern handlingMatthew Jasper-0/+32
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-2/+2
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-21Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJungMazdak Farrokhzad-6/+6
Change untagged_unions to not allow union fields with drop This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass. Change untagged_unions to not allow union fields with drop Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar). The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature. Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+2
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-11Remove most uses of `allow(unions_with_drop_fields)` in testsSimon Sapin-6/+6
2019-10-09Revert "Make `into` schedule drop for the destination"Matthew Jasper-286/+158
This reverts commit 37026837a3f23486d3cf1009d9136927168ddb33.
2019-10-04Make `into` schedule drop for the destinationMatthew Jasper-158/+286
2019-09-15use println!()Guanqun Lu-15/+15
2019-09-08Update test stderr with results of enabling unused lintsMark Rousskov-0/+1
2019-08-20Remove async_await gates from tests.Mazdak Farrokhzad-3/+0
2019-07-28Use new 'p @ ..' syntax in tests.Mazdak Farrokhzad-5/+5
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+2483