summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2019-05-10Permit unwinding through FFI by defaultMark Rousskov-0/+2
See #58794 for context.
2019-04-07Auto merge of #59119 - cramertj:cx-back, r=withoutboatsbors-23/+23
Future-proof the Futures API cc https://github.com/rust-lang/rust/issues/59113, @carllerche, @rust-lang/libs r? @withoutboats
2019-04-05Future-proof the Futures APITaylor Cramer-23/+23
2019-04-05Auto merge of #59500 - crlf0710:boxed-closure-impls, r=cramertjbors-0/+20
Unsized rvalues: implement boxed closure impls. (2nd try) This is a rebase of S-blocked-closed PR #55431 to current master. LLVM has moved forward since then, so maybe we can check whether the new LLVM 8.0 version unblocked this work.
2019-04-05Stabilize boxed_closure_impls in 1.35.0.Charles Lew-2/+0
2019-04-05Add tests for boxed_closure_impls.Masaki Hara-0/+22
2019-04-04std: Avoid usage of `Once` in `Instant`Alex Crichton-0/+27
This commit removes usage of `Once` from the internal implementation of time utilities on OSX and Windows. It turns out that we accidentally hit a deadlock today (#59020) via events that look like: * A thread invokes `park_timeout` * Internally, only on OSX, `park_timeout` calls `Instant::elapsed` * Inside of `Instant::elapsed` on OSX we enter a `Once` to initialize global timer data * Inside of `Once`, it attempts to `park` This means on the same stack frame, when there's contention, we're calling `park` from inside `park_timeout`, causing a deadlock! The solution implemented in this commit was to remove usage of `Once` and instead just do a small dance with atomics. There's no real need we need to guarantee that the global information is only learned once, only that it's only *stored* once. This implementation may have multiple threads invoke `mach_timebase_info`, but only one will store the global information which will amortize the cost for all other threads. A similar fix has been applied to windows to be uniform across our implementations, but looking at the code on Windows no deadlock was possible. This is purely just a consistency update for Windows and in theory a slightly leaner implementation. Closes #59020
2019-04-02Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obkMazdak Farrokhzad-0/+8
Fix stack overflow when generating debuginfo for 'recursive' type By using 'impl trait', it's possible to create a self-referential type as follows: fn foo() -> impl Copy { foo } This is a function which returns itself. Normally, the signature of this function would be impossible to write - it would look like 'fn foo() -> fn() -> fn() ...' e.g. a function which returns a function, which returns a function... Using 'impl trait' allows us to avoid writing this infinitely long type. While it's useless for practical purposes, it does compile and run However, issues arise when we try to generate llvm debuginfo for such a type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we generate debuginfo, which can lead to us recursing back to the original 'fn' type when we try to process its return type. To resolve this, I've modified debuginfo generation to account for these kinds of weird types. Unfortunately, there's no 'correct' debuginfo that we can generate - 'impl trait' does not exist in debuginfo, and this kind of recursive type is impossible to directly represent. To ensure that we emit *something*, this commit emits dummy debuginfo/type names whenever it encounters a self-reference. In practice, this should never happen - it's just to ensure that we can emit some kind of debuginfo, even if it's not particularly meaningful Fixes #58463
2019-04-02Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexregMazdak Farrokhzad-0/+65
resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixes https://github.com/rust-lang/rust/issues/56485 r? @alexreg
2019-04-01Refactor async fn return type loweringTaylor Cramer-4/+16
async fn now lowers directly to an existential type declaration rather than reusing the `impl Trait` return type lowering. As part of this, it lowers all argument-position elided lifetimes using the in-band-lifetimes machinery, creating fresh parameter names for each of them, using each lifetime parameter as a generic argument to the generated existential type. This doesn't currently successfully allow multiple argument-position elided lifetimes since `existential type` doesn't yet support multiple lifetimes where neither outlive the other. This requires a separate fix.
2019-04-01resolve all in scope trait aliases, then elaborate their boundsSean McArthur-1/+43
2019-03-31Fix stack overflow when generating debuginfo for 'recursive' typeAaron Hill-0/+8
By using 'impl trait', it's possible to create a self-referential type as follows: fn foo() -> impl Copy { foo } This is a function which returns itself. Normally, the signature of this function would be impossible to write - it would look like 'fn foo() -> fn() -> fn() ...' e.g. a function which returns a function, which returns a function... Using 'impl trait' allows us to avoid writing this infinitely long type. While it's useless for practical purposes, it does compile and run However, issues arise when we try to generate llvm debuginfo for such a type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we generate debuginfo, which can lead to us recursing back to the original 'fn' type when we try to process its return type. To resolve this, I've modified debuginfo generation to account for these kinds of weird types. Unfortunately, there's no 'correct' debuginfo that we can generate - 'impl trait' does not exist in debuginfo, and this kind of recursive type is impossible to directly represent. To ensure that we emit *something*, this commit emits dummy debuginfo/type names whenever it encounters a self-reference. In practice, this should never happen - it's just to ensure that we can emit some kind of debuginfo, even if it's not particularly meaningful Fixes #58463
2019-03-31Rollup merge of #59583 - oberien:patch-1, r=CentrilMazdak Farrokhzad-0/+16
match match match match match
2019-03-31Rollup merge of #59580 - taiki-e:coerce-closure, r=oli-obkMazdak Farrokhzad-0/+7
Allow closure to unsafe fn coercion Closes #57883
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-0/+7
2019-03-31match match match match matchJaro Fietz-0/+16
2019-03-30Restore testFabian Drinck-0/+3
2019-03-30Fix more testsFabian Drinck-10/+0
2019-03-30Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, ↵Mazdak Farrokhzad-204/+0
r=petrochenkov,QuietMisdreavus RFC 2008: Enum Variants Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov cc @nikomatsakis
2019-03-29Rollup merge of #59462 - taiki-e:no-core, r=petrochenkovMazdak Farrokhzad-0/+18
Fix error in Rust 2018 + no_core environment Minimized reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b9f6c3026ec9d856699fa6dbd4361f0 This is a fix for the error that occurred in #58702. r? @Centril
2019-03-28Implement `#[non_exhaustive]` on variants.David Wood-204/+0
This commit removes the check that disallows the `#[non_exhaustive]` attribute from being placed on enum variants and removes the associated tests. Further, this commit lowers the visibility of enum variant constructors when the variant is marked as non-exhaustive.
2019-03-28Rollup merge of #58803 - haraldh:fs_copy_fix, r=alexcrichtonMazdak Farrokhzad-4/+9
fs::copy() unix: set file mode early A convenience method like fs::copy() should try to prevent pitfalls a normal user doesn't think about. In case of an empty umask, setting the file mode early prevents temporarily world readable or even writeable files, because the default mode is 0o666. In case the target is a named pipe or special device node, setting the file mode can lead to unwanted side effects, like setting permissons on `/dev/stdout` or for root setting permissions on `/dev/null`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: https://github.com/rust-lang/rust/issues/26933 Fixed: https://github.com/rust-lang/rust/issues/37885
2019-03-27Rollup merge of #59284 - RalfJung:maybe-uninit, r=sfacklerJosh Stone-3/+3
adjust MaybeUninit API to discussions uninitialized -> uninit into_initialized -> assume_init read_initialized -> read set -> write
2019-03-27Rollup merge of #57565 - petrochenkov:turbowarn, r=CentrilJosh Stone-42/+6
syntax: Remove warning for unnecessary path disambiguators `rustfmt` is now stable and it removes unnecessary turbofishes, so removing the warning as discussed in https://github.com/rust-lang/rust/pull/43540 (where it was introduced). One hardcoded warning less. Closes https://github.com/rust-lang/rust/issues/58055 r? @nikomatsakis
2019-03-27Add a testTaiki Endo-0/+18
2019-03-27Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkovbors-2/+43
Introduce proc_macro::Span::source_text A function to extract the actual source behind a Span. Background: I would like to use `syn` in a `build.rs` script to parse the rust code, and extract part of the source code. However, `syn` only gives access to proc_macro2::Span, and i would like to get the source code behind that. I opened an issue on proc_macro2 bug tracker for this feature https://github.com/alexcrichton/proc-macro2/issues/110 and @alexcrichton said the feature should first go upstream in proc_macro. So there it is! Since most of the Span API is unstable anyway, this is guarded by the same `proc_macro_span` feature as everything else.
2019-03-26fix some uses I missedRalf Jung-3/+3
2019-03-23syntax: Remove warning for unnecessary path disambiguatorsVadim Petrochenkov-42/+6
2019-03-23fs::copy() set file mode earlyHarald Hoyer-4/+9
A convenience method like fs::copy() should try to prevent pitfalls a normal user doesn't think about. In case of an empty umask, setting the file mode early prevents temporarily world readable or even writeable files, because the default mode is 0o666. In case the target is a named pipe or special device node, setting the file mode can lead to unwanted side effects, like setting permissons on `/dev/stdout` or for root setting permissions on `/dev/null`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Use `fcopyfile` on MacOS instead of `copyfile`. Fixes: https://github.com/rust-lang/rust/issues/26933 Fixed: https://github.com/rust-lang/rust/issues/37885
2019-03-23resolve: collect trait aliases along with traitsSean McArthur-0/+23
2019-03-16Rollup merge of #59206 - sntdevco:master, r=dtolnaykennytm-4/+4
Improved test output
2019-03-16Rollup merge of #59201 - lambda:remove-repr-simd-isize-usize-restriction, ↵kennytm-0/+32
r=alexcrichton Remove restriction on isize/usize in repr(simd) As discussed in #55078, there's no known reason for this restriction. It's unlikely that repr(simd) will be stabilized in its current form, but might as well remove some restrictions on it. This removes the branch in `is_machine` which returns false for these types. `is_machine` is only used for the repr(simd) type validation check.
2019-03-16Rollup merge of #59156 - davidtwco:issue-55809, r=nikomatsakiskennytm-0/+30
[wg-async-await] Add regression test for #55809. Fixes #55809. This PR adds a regression test for #55809 which checks that a overflow does not occur when evaluating a requirement for async functions and `&mut` arguments in some specific circumstances.
2019-03-16Rollup merge of #59025 - aoikonomopoulos:issue-57924, r=varkorkennytm-0/+9
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes #57924 r? @eddyb
2019-03-15Remove restriction on isize/usize in repr(simd)Brian Campbell-0/+32
As discussed in #55078, there's no known reason for this restriction. It's unlikely that repr(simd) will be stabilized in its current form, but might as well remove some restrictions on it. This removes the branch in `is_machine` which returns false for these types. `is_machine` is only used for the repr(simd) type validation check.
2019-03-15Improved test output for estr-slicesntdevco-4/+4
2019-03-14Moved issue tests to subdirs and normalised names.Alexander Regueiro-49/+56
2019-03-13Fix generic argument lookup for SelfAngelos Oikonomopoulos-0/+9
Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes #57924
2019-03-13Add test for #55809.David Wood-0/+30
This commit adds a regression test for #55809 which checks that a overflow does not occur when evaluating a requirement for async functions and `&mut` arguments in some specific circumstances.
2019-03-09Rollup merge of #58750 - TimDiekmann:master, r=oli-obkMazdak Farrokhzad-0/+32
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
2019-03-08Rollup merge of #58918 - gilescope:async-await-issue-testcase, r=petrochenkovPietro Albini-0/+28
Regression test added for an async ICE. Regression test for #57084 (as suggested in issue).
2019-03-08Rollup merge of #58911 - pnkfelix:issue-58435-regression-test, r=alexcrichtonPietro Albini-0/+17
Regression test for #58435. Fix #58435
2019-03-08Rollup merge of #58906 - Nemo157:generator-state-debug-info, r=ZoxcPietro Albini-0/+27
Monomorphize generator field types for debuginfo Fixes #58888 r? @Zoxc
2019-03-08Rollup merge of #58369 - nox:sync-hash-map-entry, r=AmanieuPietro Albini-0/+1
Make the Entry API of HashMap<K, V> Sync and Send Fixes #45219
2019-03-06Desugared asyncs into generators and minimised.Giles Cope-12/+13
2019-03-05Removed whitespaceGiles Cope-1/+1
2019-03-05Unrolled await macro.Giles Cope-6/+6
Was then able to the minimise the reproduction a little further.
2019-03-04Regression test added for an async ICE.Giles Cope-0/+27
2019-03-04Regression test for #58435.Felix S. Klock II-0/+17
2019-03-04Make the Entry API of HashMap<K, V> Sync and Send (fixes #45219)Anthony Ramine-0/+1