summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2016-02-05thorough follow-set testsAlex Burka-0/+190
2016-01-19Auto merge of #30845 - nagisa:mir-extern-calls, r=dotdashbors-0/+42
Supersedes https://github.com/rust-lang/rust/pull/30517 Fixes https://github.com/rust-lang/rust/issues/29575 cc @luqmana r? @nikomatsakis
2016-01-19[MIR] Implement extern call supportSimonas Kazlauskas-0/+42
2016-01-18Auto merge of #30956 - KiChjang:move-tests-to-libcollectionstest, r=blussbors-0/+41
Encountered while I was trying to work on #28518. Please let me know whether this is a correct move.
2016-01-17Move zst test from libcollections to src/testKeith Yeung-0/+41
2016-01-17Rollup merge of #30943 - alexcrichton:stabilize-1.7, r=aturonManish Goregaokar-3/+3
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2016-01-16Auto merge of #30567 - steffengy:master, r=alexcrichtonbors-0/+32
Add support to use functions exported using vectorcall. This essentially only allows to pass a new LLVM calling convention from rust to LLVM. ```rust extern "vectorcall" fn abc(param: c_void); ``` references ---- http://llvm.org/docs/doxygen/html/CallingConv_8h_source.html https://msdn.microsoft.com/en-us/library/dn375768.aspx
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-3/+3
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2016-01-16Auto merge of #30896 - petrochenkov:vkindmeta, r=alexcrichtonbors-1/+62
Also add tests for use of empty structs in cross-crate scenarios Some tests are commented out, they depend on fixes from https://github.com/rust-lang/rust/pull/30882
2016-01-15Auto merge of #30446 - michaelwu:associated-const-type-params-pt1, ↵bors-0/+41
r=nikomatsakis This provides limited support for using associated consts on type parameters. It generally works on things that can be figured out at trans time. This doesn't work for array lengths or match arms. I have another patch to make it work in const expressions. CC @eddyb @nikomatsakis
2016-01-15Add some tests for non-trivial ADTsSimonas Kazlauskas-3/+98
These tests test building and matching some non-trivial ADT configurations such as C-like enums and packed structs.
2016-01-15Preserve struct/variant kinds in metadataVadim Petrochenkov-1/+62
Add tests for use of empty structs in cross-crate scenarios
2016-01-15Rollup merge of #30776 - antonblanchard:powerpc64_merge, r=alexcrichtonManish Goregaokar-16/+14
This adds support for big endian and little endian PowerPC64. make check runs clean apart from one big endian backtrace issue.
2016-01-14Support generic associated constsMichael Wu-0/+41
2016-01-14Rollup merge of #30823 - pnkfelix:put-back-alloca-zeroing-for-issue-30530, ↵Manish Goregaokar-0/+213
r=dotdash Put back alloca zeroing for issues #29092, #30018, #30530; inject zeroing for #30822. ---- Background context: `fn alloca_zeroed` was removed in PR #22969, so we haven't been "zero'ing" (\*) the alloca's since at least that point, but the logic behind that PR seems sound, so its not entirely obvious how *long* the underlying bug has actually been present. In other words, I have not yet done a survey to see when the new `alloc_ty` and `lvalue_scratch_datum` calls were introduced that should have had "zero'ing" the alloca's. ---- I first fixed #30018, then decided to do a survey of `alloc_ty` calls to see if they needed similar treatment, which quickly led to a rediscovery of #30530. While making the regression test for the latter, I discovered #30822, which is a slightly different bug (in terms of where the "zero'ing" needs to go), but still relevant. I haven't finished the aforementioned survey of `fn alloc_ty` calls, but I decided I wanted to get this up for review in its current state (namely to see if my attempt to force developers to include a justification for passing `Uninit` can possibly fly, or if I should abandon that path of action). ---- (*): I am putting quotation marks around "zero'ing" because we no longer use zero as our "dropped" marker value. Fix #29092 Fix #30018 Fix #30530 Fix #30822
2016-01-13Auto merge of #30509 - michaelsproul:string-box-error, r=alexcrichtonbors-0/+20
Closes #30156.
2016-01-13Unit/regression tests for issues #29092, #30018, #30530, #30822.Felix S. Klock II-0/+213
Note that the test for #30822 is folded into the test for #30530 (but the file name mentions only 30530).
2016-01-13Simplify some uses of cfg in test casesAnton Blanchard-24/+8
While adding PowerPC64 support it was noticed that some testcases should just use target_pointer_width, and others should select between x86 and !x86.
2016-01-13Add powerpc64 and powerpc64le supportAnton Blanchard-6/+20
This adds support for big endian and little endian PowerPC64. make check runs clean apart from one big endian backtrace issue.
2016-01-13Add an impl for Box<Error> from &str.Michael Sproul-0/+2
2016-01-12test: add a basic test for the vectorcall calling conventionSteffen-0/+32
2016-01-11Rollup merge of #30774 - nagisa:mir-fix-constval-adts, r=arielb1Simonas Kazlauskas-0/+32
Fixes #30772 We used to have a untested special case which didn’t really work anyway, because of lacking casts. This PR removes the case in question.
2016-01-11Rollup merge of #30694 - pnkfelix:issue-25658-real-first-follow, r=nrcSimonas Kazlauskas-0/+36
Proper first and follow sets for macro_rules future proofing implements first stage of RFC amendment 1384; see #30450
2016-01-11Rollup merge of #30538 - oli-obk:kill_unsigned_unary_negation, r=pnkfelixSimonas Kazlauskas-38/+10
fixes #29645
2016-01-11[breaking-change] remove negate_unsigned feature gateOliver Schneider-38/+10
2016-01-11Auto merge of #30490 - ipetkov:unix-spawn, r=alexcrichtonbors-0/+107
* If the requested descriptors to inherit are stdio descriptors there are situations where they will not be set correctly * Example: parent's stdout --> child's stderr parent's stderr --> child's stdout * Solution: if the requested descriptors for the child are stdio descriptors, `dup` them before overwriting the child's stdio Example of a program which exhibits the bug: ```rust // stdio.rs use std::io::Write; use std::io::{stdout, stderr}; use std::process::{Command, Stdio}; use std::os::unix::io::FromRawFd; fn main() { stdout().write_all("parent stdout\n".as_bytes()).unwrap(); stderr().write_all("parent stderr\n".as_bytes()).unwrap(); Command::new("sh") .arg("-c") .arg("echo 'child stdout'; echo 'child stderr' 1>&2") .stdin(Stdio::inherit()) .stdout(unsafe { FromRawFd::from_raw_fd(2) }) .stderr(unsafe { FromRawFd::from_raw_fd(1) }) .status() .unwrap_or_else(|e| { panic!("failed to execute process: {}", e) }); } ``` Before: ``` $ rustc --version rustc 1.7.0-nightly (8ad12c3e2 2015-12-19) $ rustc stdio.rs && ./stdio >out 2>err $ cat out parent stdout $ cat err parent stderr child stdout child stderr ``` After (expected): ``` $ rustc --version rustc 1.7.0-dev (712eccee2 2015-12-19) $ rustc stdio.rs && ./stdio >out 2>err $ cat out parent stdout child stderr $ cat err parent stderr child stdout ```
2016-01-08Rollup merge of #30747 - nagisa:mir-reenable-test, r=nikomatsakisSteve Klabnik-12/+6
Fixes #30674 The test seems to work fine and assertion passes. The test seems to also be generated from MIR (LLVM IR has footprint of MIR translator), thus I’m reenabling it.
2016-01-08[MIR] Fix translation of ConstVal::{Struct, Tuple}Simonas Kazlauskas-0/+32
Fixes #30772
2016-01-07After RFC amendment 1384, FOLLOW(pat) includes `|`, so update tests accordingly.Felix S. Klock II-0/+10
2016-01-07Updated future-proofing test, removed outdated test, and addedFelix S. Klock II-0/+26
run-pass test for some new functionality.
2016-01-07Auto merge of #30557 - sfackler:panic-propagate, r=aturonbors-0/+35
See rust-lang/rfcs#1413. r? @alexcrichton
2016-01-06Add std::panic::propagateSteven Fackler-0/+35
2016-01-06Reenable MIR testSimonas Kazlauskas-12/+6
Fixes #30674
2016-01-06Auto merge of #30733 - ubsan:wrapping_op_assign, r=eddybbors-28/+30
Fix a breaking change in #30523 While this does fix a breaking change, it is also, technically, a [breaking-change] to go back to our original way
2016-01-06Add testsSimonas Kazlauskas-0/+74
2016-01-05Fix a breaking change in #30523Nicholas Mazzuca-28/+30
While this does fix a breaking change, it is also, technically, a [breaking-change] to go back to our original way
2016-01-05[MIR] Add test case for translation of closure calls.Michael Woerister-7/+16
2016-01-05[MIR] Handle overloaded call expressions during HIR -> HAIR translation.Michael Woerister-0/+17
2016-01-04Auto merge of #30661 - michaelwoerister:trans_fn_attrs, r=nrcbors-6/+12
So far `librustc::trans::base::trans_fn()` and `trans_closure()` have been passed the list of attributes on the function being translated *only* if the function was local and non-generic. For generic functions, functions inlined from other crates, functions with foreign ABI and for closures, only an empty list of attributes was ever passed to `trans_fn()`. This led to the case that generic functions marked with `#[rustc_mir]` where not actually translated via MIR but via the legacy translation path. This PR makes function/closure attributes always be passed to `trans_fn()` and disables the one test where this makes a difference. If there is an actual reason why attributes were not passed along in these cases, let me know. cc @rust-lang/compiler cc @luqmana regarding the test case
2016-01-04Auto merge of #30523 - ubsan:wrapping_op_assign, r=eddybbors-0/+412
Add OpAssign to Wrapping<T>, plus fix some problems in core::num::wrapping including, but not limited to: * Testing Wrapping<T> * Pull out a lot of broken code that doesn't need to be there with the new stage0 compiler * Adding Rem and RemAssign to Wrapping<T> * Removed 3 (assumed accidental) re-exports, which is a minor [breaking-change]. * Change shl and shr to take all integer types, instead of a usize; this is a more major [breaking-change], because of values that were inferred before, but brings us in line with the integer shifts. Fixes #30524 and #30523
2016-01-04Auto merge of #30553 - luqmana:mir-match-arm-guards, r=nikomatsakisbors-0/+28
Fixes #30527. ```Rust fn main() { let _abc = match Some(101i8) { Some(xyz) if xyz > 100 => xyz, Some(_) => -1, None => -2 }; } ``` Resulting MIR now includes the `Some(xyz)` arm, guard and all: ![match.dot](https://cloud.githubusercontent.com/assets/287063/11999413/066f7610-aa8b-11e5-927b-24215af57fc4.png) ~~Not quite sure how to write a test for this.~~ Thinking too hard, just tested the end result. r? @nikomatsakis
2016-01-02Take out Op<T>/OpAssign<T> for Wrapping<T>Nicholas Mazzuca-1/+5
2016-01-02Finish test implementationNicholas Mazzuca-147/+150
2016-01-01Fix equality checks in matchesSimonas Kazlauskas-30/+55
2016-01-01In the middle of the implementationNicholas Mazzuca-0/+405
2015-12-31Rollup merge of #30590 - nagisa:mir-constval-function, r=luqmanaSimonas Kazlauskas-0/+7
This moves back (essentially reverts #30265) into MIR-specific translation code, but keeps the funcition split out, since it is expected to eventually become recursive. Fixes https://github.com/rust-lang/rust/issues/29572 cc @oli-obk
2015-12-31Deactivate one test in mir_trans_calls.rs since it fails now that it is ↵Michael Woerister-6/+12
correctly executed.
2015-12-31Auto merge of #30641 - tsion:match-range, r=eddybbors-0/+30
The previous version using `PartialOrd::le` was broken since it passed `T` arguments where `&T` was expected. It makes sense to use primitive comparisons since range patterns can only be used with chars and numeric types. r? @eddyb
2015-12-31Auto merge of #30586 - nagisa:mir-cast, r=arielb1bors-0/+349
I think that should pretty much conclude all of https://github.com/rust-lang/rust/issues/29576.
2015-12-30Auto merge of #30375 - aaronkeen:issue_28777, r=eddybbors-0/+51
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to contain braces. https://github.com/rust-lang/rust/issues/28777