summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2016-05-18trans: callee: normalize trait_ref before useWang Xuerui-0/+36
Fixes #33436 and #33461. Test case is from #33461.
2016-05-17Don't use env::current_exe with libbacktraceSteven Fackler-6/+10
If the path we give to libbacktrace doesn't actually correspond to the current process, libbacktrace will segfault *at best*. cc #21889
2016-05-04trans: always register an item's symbol, even if duplicated.Eduard Burtescu-33/+7
2016-04-12std: Stabilize APIs for the 1.9 releaseAlex Crichton-7/+7
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-07Rollup merge of #32732 - dotdash:ext_arg, r=eddybManish Goregaokar-0/+22
Handle integer-extending for C ABI We need to supply sext/zext attributes to LLVM to ensure that arguments are extended to the appropriate width in the correct way. Most platforms extend integers less than 32 bits, though not all.
2016-04-06Rollup merge of #32761 - tshepang:assert, r=steveklabnikSteve Klabnik-8/+8
avoid "==" in assert! when one of the values is a bool Is suspect this is something of an idiom
2016-04-06avoid "==" in assert! when one of the values is a boolTshepang Lekhonkhobe-8/+8
2016-04-05trans: don't declare symbols that were already imported.Eduard Burtescu-2/+13
2016-04-04Auto merge of #32647 - Amanieu:checked_atomic_intrinsics, r=eddybbors-9/+1
Only allow using the atomic intrinsics on integer types Using these with non-integer types results in LLVM asserts. Atomic operations on non-integer types will require values be transmuted into an integer type of suitable size. This doesn't affect the standard library since `AtomicBool` and `AtomicPtr` currently use `usize` for atomic operations. r? @eddyb
2016-04-04Handle integer-extending for C ABIJames Miller-0/+22
We need to supply sext/zext attributes to LLVM to ensure that arguments are extended to the appropriate width in the correct way. Most platforms extend integers less than 32 bits, though not all.
2016-04-03Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakisbors-0/+53
rBreak Critical Edges and other MIR work This PR is built on top of #32080. This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already). The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.
2016-03-31allow RUST_BACKTRACE=0 to act as if unsetEmanuel Czirai-8/+27
/# This is a combination of 16 commits. /# The first commit's message is: allow RUST_BACKTRACE=disabled to act as if unset When RUST_BACKTRACE is set to "disabled" then this acts as if the env. var is unset. /# This is the 2nd commit message: case insensitive "DiSaBLeD" RUST_BACKTRACE value previously it expected a lowercase "disabled" to treat the env. var as unset /# This is the 3rd commit message: RUST_BACKTRACE=0 acts as if unset previously RUST_BACKTRACE=disabled was doing the same thing /# This is the 4th commit message: RUST_BACKTRACE=0|n|no|off acts as if unset previously only RUST_BACKTRACE=0 acted as if RUST_BACKTRACE was unset Now added more options (case-insensitive): 'n','no' and 'off' eg. RUST_BACKTRACE=oFF /# This is the 5th commit message: DRY on the value of 2 DRY=don't repeat yourself Because having to remember to keep the two places of '2' in sync is not ideal, even though this is a simple enough case. /# This is the 6th commit message: Revert "DRY on the value of 2" This reverts commit 95a0479d5cf72a2b2d9d21ec0bed2823ed213fef. Nevermind this DRY on 2, because we already have a RY on 1, besides the code is less readable this way... /# This is the 7th commit message: attempt to document unsetting RUST_BACKTRACE /# This is the 8th commit message: curb allocations when checking for RUST_BACKTRACE this means we don't check for case-insensitivity anymore /# This is the 9th commit message: as decided, RUST_BACKTRACE=0 turns off backtrace /# This is the 10th commit message: RUST_TEST_NOCAPTURE=0 acts as if unset (that is, capture is on) Any other value acts as if nocapture is enabled (that is, capture is off) /# This is the 11th commit message: update other RUST_TEST_NOCAPTURE occurrences apparently only one place needs updating /# This is the 12th commit message: update RUST_BACKTRACE in man page /# This is the 13th commit message: handle an occurrence of RUST_BACKTRACE /# This is the 14th commit message: ensure consistency with new rules for backtrace /# This is the 15th commit message: a more concise comment for RUST_TEST_NOCAPTURE /# This is the 16th commit message: update RUST_TEST_NOCAPTURE in man page
2016-03-31Auto merge of #31938 - jseyfried:autoderef_privacy, r=nikomatsakisbors-0/+60
Integrate privacy into field and method selection This PR integrates privacy checking into field and method selection so that an inaccessible field/method can not stop an accessible field/method from being used (fixes #12808 and fixes #22684). r? @eddyb
2016-03-31Only allow using the atomic intrinsics on integer typesAmanieu d'Antras-9/+1
2016-03-30Auto merge of #32439 - jseyfried:visible_suggestions, r=nrcbors-1/+1
diagnostics: make paths to external items more visible This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an `extern crate`, the path is guarenteed to use the `extern crate`. Fixes #23224, fixes #23355, fixes #26635, fixes #27165. r? @nrc
2016-03-30Fix fallout in testsJeffrey Seyfried-1/+1
2016-03-30Improve testsJeffrey Seyfried-0/+60
2016-03-30Add a testJames Miller-0/+53
2016-03-29Auto merge of #32557 - dotdash:issue-32518, r=nikomatsakisbors-0/+22
Use weak_odr linkage when reusing definitions across codegen units When reuing a definition across codegen units, we obviously cannot use internal linkage, but using external linkage means that we can end up with multiple conflicting definitions of a single symbol across multiple crates. Since the definitions should all be equal semantically, we can use weak_odr linkage to resolve the situation. Fixes #32518 r? @nikomatsakis
2016-03-29Use weak_odr linkage when reusing definitions across codegen unitsBjörn Steinbrink-0/+22
When reuing a definition across codegen units, we obviously cannot use internal linkage, but using external linkage means that we can end up with multiple conflicting definitions of a single symbol across multiple crates. Since the definitions should all be equal semantically, we can use weak_odr linkage to resolve the situation. Fixes #32518
2016-03-27add #[derive(Hash)] test for #21714Alex Burka-0/+26
2016-03-26add regression test for try!Jorge Aparicio-0/+57
2016-03-26fix ? expansion in commentJorge Aparicio-1/+1
2016-03-26Rollup merge of #32257 - alexcrichton:fix-status-stdin, r=aturonManish Goregaokar-0/+41
std: Fix inheriting stdin on status() This regression was accidentally introduced in #31618, and it's just flipping a boolean! Closes #32254
2016-03-26Rollup merge of #32199 - nikomatsakis:limiting-constants-in-patterns-2, ↵Manish Goregaokar-3/+72
r=pnkfelix Restrict constants in patterns This implements [RFC 1445](https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md). The primary change is to limit the types of constants used in patterns to those that *derive* `Eq` (note that implementing `Eq` is not sufficient). This has two main effects: 1. Floating point constants are linted, and will eventually be disallowed. This is because floating point constants do not implement `Eq` but only `PartialEq`. This check replaces the existing special case code that aimed to detect the use of `NaN`. 2. Structs and enums must derive `Eq` to be usable within a match. This is a [breaking-change]: if you encounter a problem, you are most likely using a constant in an expression where the type of the constant is some struct that does not currently implement `Eq`. Something like the following: ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` The easiest and most future compatible fix is to annotate the type in question with `#[derive(Eq)]` (note that merely *implementing* `Eq` is not enough, it must be *derived*): ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` Another good option is to rewrite the match arm to use an `if` condition (this is also particularly good for floating point types, which implement `PartialEq` but not `Eq`): ```rust match foo { c if c == SOME_CONST => ... } ``` Finally, a third alternative is to tag the type with `#[structural_match]`; but this is not recommended, as the attribute is never expected to be stabilized. Please see RFC #1445 for more details. cc https://github.com/rust-lang/rust/issues/31434 r? @pnkfelix
2016-03-26Rollup merge of #32131 - petrochenkov:prim, r=eddybManish Goregaokar-0/+91
resolve: Minimize hacks in name resolution of primitive types When resolving the first unqualified segment in a path with `n` segments and `n - 1` associated item segments, e.g. (`a` or `a::assoc` or `a::assoc::assoc` etc) try to resolve `a` without considering primitive types first. If the "normal" lookup fails or results in a module, then try to resolve `a` as a primitive type as a fallback. This way backward compatibility is respected, but the restriction from E0317 can be lifted, i.e. primitive names mostly can be shadowed like any other names. Furthermore, if names of primitive types are [put into prelude](https://github.com/petrochenkov/rust/tree/prim2) (now it's possible to do), then most of names will be resolved in conventional way and amount of code relying on this fallback will be greatly reduced. Although, it's not entirely convenient to put them into prelude right now due to temporary conflicts like `use prelude::v1::*; use usize;` in libcore/libstd, I'd better wait for proper glob shadowing before doing it. I wish the `no_prelude` attribute were unstable as intended :( cc @jseyfried @arielb1 r? @eddyb
2016-03-25change test to be specific for msvcNiko Matsakis-2/+1
2016-03-25Update backtrace test for FIXME on windowsNiko Matsakis-3/+20
2016-03-25Revert "workarounds to make link guards work on windows"Niko Matsakis-1/+1
This reverts commit b52004d202ddfffa100d4963216e1673a0be0b95.
2016-03-25workarounds to make link guards work on windowsNiko Matsakis-1/+1
Link guards cause problems in some specific scenarios on windows because they force libcore to be instantiated, since we do not GC functions effectively on windows. The changes here are two: 1. disable core for rsbegin/rsend 2. make panic_fmt an extern fn for smallest-hello-world so that it is not marked as "internal" for LLVM
2016-03-25Remove static linking hack since we are now passing absolute pathsNiko Matsakis-2/+0
2016-03-25Use new symbol names for items of various kinds.Michael Woerister-5/+5
2016-03-25Make monomorphized functions use stable symbol names.Michael Woerister-4/+4
2016-03-25new tests for RFC #1445Niko Matsakis-0/+58
2016-03-25fallout in existing testsNiko Matsakis-3/+14
2016-03-25CleanupVadim Petrochenkov-0/+14
+ Fix a comment and add a test based on it
2016-03-25Lift the restriction on reusing names of primitive typesVadim Petrochenkov-0/+77
2016-03-23Make warnings of renamed and removed lints themselves lintsBrian Anderson-1/+1
This adds the `renamed_and_removed_lints` warning, defaulting to the warning level. Fixes #31141
2016-03-23Auto merge of #32454 - eddyb:rollup, r=eddybbors-0/+42
Rollup of 11 pull requests - Successful merges: #32404, #32420, #32423, #32425, #32429, #32430, #32431, #32434, #32437, #32441, #32443 - Failed merges:
2016-03-23Rollup merge of #32437 - eddyb:orbital-msvc, r=alexcrichtonEduard-Mihai Burtescu-0/+6
Annotate run-pass/backtrace with #[rustc_no_mir] on MSVC. Fixes #32384 by not using MIR on MSVC for the functions in the path of the backtrace. This is the known blocker for the MSVC MIR builder, hopefully the only one overall. r? @alexcrichton Confirmed to work on a nightly, by @retep998.
2016-03-23Rollup merge of #32430 - sanxiyn:const-trans, r=arielb1Eduard-Mihai Burtescu-0/+14
Fix const trans Fix #30615. The idea was that when there are N autoderefs, first do N-1 derefs and check for autoref. If there is autoref, done, if not, do one more deref. But when N is zero, doing one more deref is wrong.
2016-03-22sprinkle feature gates here and thereJorge Aparicio-0/+7
2016-03-22try! -> ?Jorge Aparicio-5/+5
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-23Annotate run-pass/backtrace with #[rustc_no_mir] on MSVC.Eduard Burtescu-0/+6
2016-03-23Fix const transSeo Sanghyeon-0/+14
Const was dereferenced when autoderefs is zero.
2016-03-21Add regression test for Issue 26997.Corey Farwell-0/+22
https://github.com/rust-lang/rust/issues/26997
2016-03-21Auto merge of #32062 - Marwes:unification_table_for_eq_relations, r=nikomatsakisbors-0/+58
Improve time complexity of equality relations This PR adds a `UnificationTable` to the `TypeVariableTable` type which is used store information about variable equality instead of just storing them in a vector for later processing. By using a `UnificationTable` equality relations can be resolved in O(n) (for all realistic values of n) rather than O(n!) which can give massive speedups in certain cases (see combine as an example). Link to combine: https://github.com/Marwes/combine
2016-03-21Improve time complexity of equality relationsMarkus Westerlind-0/+58
This PR adds a `UnificationTable` to the `TypeVariableTable` type which is used store information about variable equality instead of just storing them in a vector for later processing. By using a `UnificationTable` equality relations can be resolved in O(n) (for all realistic values of n) rather than O(n!) which can give massive speedups in certain cases (see combine as an example). Link to combine: https://github.com/Marwes/combine
2016-03-21Fix tupling of fn args for rust-call ABI functionsBjörn Steinbrink-0/+20
Fixes #32389
2016-03-20Auto merge of #32344 - aturon:issue-32324, r=eddybbors-0/+33
Fix mis-uses of projection mode A couple of places where we construct a fresh inference context were incorrectly assuming that we were past coherence checking. This commit corrects them to use `Topmost` rather than `AnyFinal` as the projection mode. Fixes #32324 r? @nikomatsakis