about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-47/+0
2019-01-04add testsAriel Ben-Yehuda-0/+41
2019-01-03More test deduplicationGeorg Semmler-446/+38
2019-01-03Add some testsGeorg Semmler-0/+482
This copies and adjusts the existing coherence tests to ensure that they continue to work using the new implementation.
2019-01-02update to reflect changes recommended by @shepmaster his reviewOzaren-16/+9
2019-01-02tests: move coherence-subtyping from run-pass to compile-failNiko Matsakis-39/+0
This is the pattern we no longer accept.
2018-12-31const-stabilize const_int_ops + reverse_bitsMazdak Farrokhzad-114/+113
2018-12-31const stabilizations: adjust run-pass tests.Mazdak Farrokhzad-6/+0
2018-12-30Remove unused nll debug flagsMatthew Jasper-1/+0
2018-12-30Change return types and check return values in tests.Camille GILLOT-0/+88
This allows to verify that we handle different types as return types, and that we call the expected functions.
2018-12-30Move tests to ui.Camille GILLOT-75/+0
2018-12-30test: Add test for issues 45510 and 18952.Camille GILLOT-0/+75
Those tests are directly taken from the comments on the bug reports.
2018-12-30Type annotations in associated constant patterns.David Wood-1/+1
This commit adds support for respecting user type annotations with associated constants in patterns.
2018-12-29Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkovbors-0/+102
Implement RFC 2338, "Type alias enum variants" This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following. ```rust #![feature(type_alias_enum_variants)] enum Foo { Bar(i32), Baz { i: i32 }, } type Alias = Foo; fn main() { let t = Alias::Bar(0); let t = Alias::Baz { i: 0 }; match t { Alias::Bar(_i) => {} Alias::Baz { i: _i } => {} } } ``` Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern. Fixes issues #56199 and #56611. N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible. ```rust Option::<u8>::None; // OK Option::None::<u8>; // OK, but lint in near future (hard error next edition?) Alias::<u8>::None; // OK Alias::None::<u8>; // Error ``` I do not know if this will need an FCP, but let's start one if so.
2018-12-27Add testsscalexm-0/+128
2018-12-27panic when calling MaybeUninhabited::into_inner on uninhabited typeRalf Jung-7/+34
2018-12-26Fixed type inference for tuple struct variants.Alexander Regueiro-14/+1
2018-12-26Fixed handling of unit variants of aliased enums in type NS.Alexander Regueiro-3/+3
2018-12-26Expanded tests for enum variants with generic args.Alexander Regueiro-34/+85
2018-12-26Added tests for enums & enum aliases with various combinations of generic args.Alexander Regueiro-0/+34
2018-12-26Added tests for feature.Alexander Regueiro-0/+30
2018-12-25Remove licensesMark Rousskov-32372/+77
2018-12-25Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelixbors-7/+1
address some FIXME whose associated issues were marked as closed part of #44366
2018-12-23Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichtonMazdak Farrokhzad-4/+4
Pin stabilization This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items": > In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above). Let's settle these last bits here and get this thing stabilized! :) r? @alexcrichton cc @withoutboats
2018-12-22Auto merge of #57063 - kennytm:rollup, r=kennytmbors-23/+6
Rollup of 25 pull requests Successful merges: - #56802 (Add DoubleEndedIterator::nth_back) - #56909 (static eval: Do not ICE on layout size overflow) - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le) - #56919 (Remove a wrong multiplier on relocation offset computation) - #56933 (Add --progress to git submodule commands in x.py) - #56936 (rename div_euc -> div_euclid, and mod_euc -> rem_euclid) - #56941 (deny intra-doc link resolution failures in libstd) - #56945 (Fix rustdoc-js tests) - #56967 (Replace current crate's searchIndex when regenerating) - #56970 (Mem uninit doc ptr drop) - #56973 (make basic CTFE tracing available on release builds) - #56979 (Adding unwinding support for x86_64_fortanix_unknown_sgx target.) - #56981 (miri: allocation is infallible) - #56984 (A few tweaks to dropck_outlives) - #56989 (Fix compiletest `trim` deprecation warnings) - #56992 (suggest similar lint names for unknown lints) - #57002 (Stabilize Vec(Deque)::resize_with) - #57011 (rustdoc: add new CLI flag to load static files from a different location) - #57027 (Optimize away a move) - #57034 (Inline tweaks) - #57039 (Update migrate warning wording.) - #57040 (Fix feature gate to point to 1.32.0 for `path_from_str`) - #57049 (Stabilize #[repr(packed(N))]) - #57050 (Fixed typo in HashMap documentation) - #57052 (Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher))
2018-12-22Auto merge of #56887 - emilio:enum-field-reordering, r=eddybbors-24/+30
Disable field reordering for repr(int). This fixes the problem that the test in #56619 uncovers. Closes #56619.
2018-12-23Rollup merge of #57049 - cramertj:repr-packed, r=Centrilkennytm-23/+6
Stabilize #[repr(packed(N))] Fixes https://github.com/rust-lang/rust/issues/33158
2018-12-21Rename Box/Arc/Rc::pinned to ::pinTaylor Cramer-1/+1
2018-12-21Stabilize PinTaylor Cramer-3/+3
2018-12-22Auto merge of #56805 - mikeyhew:stabilize-pin-as-receiver, r=nikomatsakisbors-1/+8
Stabilize `Rc`, `Arc` and `Pin` as method receivers Replaces #55880 Closes #55786 r? @nikomatsakis cc @withoutboats @cramertj This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use. This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled. This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.
2018-12-21Stabilize #[repr(packed(N))]Taylor Cramer-23/+6
2018-12-20Auto merge of #54125 - varkor:less-conservative-uninhabitedness-check, ↵bors-0/+2
r=nikomatsakis Less conservative uninhabitedness check Extends the uninhabitedness check to structs, non-empty enums, tuples and arrays. Pulled out of #47291 and #50262. Fixes https://github.com/rust-lang/rust/issues/54586. r? @nikomatsakis
2018-12-20Stabilize `Rc`, `Arc` and `Pin` as method receiversMichael Hewson-1/+8
This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use. This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled. This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.
2018-12-19Auto merge of #54252 - arielb1:deref-query, r=nikomatsakisbors-0/+34
process nested obligations in autoderef Fixes #53843. r? @nikomatsakis
2018-12-19Rollup merge of #56772 - ↵Pietro Albini-0/+5
pnkfelix:issue-54153-linkage-sometimes-requires-optimizations, r=nikic fix issue 54153 by not testing issue-18804 on Windows nor OS X. Fix #54153
2018-12-19FIXME(45992) remove fixme since the lint is being testedNiv Kaminer-1/+0
2018-12-19FIXME(31702) remove fixme, move auxiliaries to the right place and fix ↵Niv Kaminer-6/+1
hr_lifetime_in_assoc_type warning
2018-12-19fixed test, now it doesn't use a fundemental typeOzaren-4/+5
i.e. `Box`, instead it now uses `Vec`
2018-12-18added test to show motivation for modified TryFrom implOzaren-0/+43
2018-12-18Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakisbors-26/+0
Fix various aspects around `let` bindings inside const functions * forbid `let` bindings in const contexts that use short circuiting operators * harden analysis code against derefs of mutable references Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly
2018-12-18Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakisbors-0/+57
add coherence future-compat warnings for marker-only trait objects The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. Note: this lint should be made to default-warn before we merge. It is deny only for the crater run. r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.
2018-12-17Auto merge of #56810 - sinkuu:build_match, r=oli-obkbors-0/+83
Improve MIR match generation for ranges Improves MIR match generation to rule out ranges/values distinct from the range that has been tested. e.g., for this code: ```rust match x { 0..=5 if b => 0, 6..=10 => 1, _ => 2, } ``` MIR (before): ```rust bb0: { ...; _4 = Le(const 0i32, _1); switchInt(move _4) -> [false: bb6, otherwise: bb5]; } bb1: { _3 = const 0i32; goto -> bb8; } bb2: { _6 = _2; switchInt(move _6) -> [false: bb6, otherwise: bb1]; } // If `!b`, jumps to test if `6 <= x <= 10`. bb3: { _3 = const 1i32; goto -> bb8; } bb4: { _3 = const 2i32; goto -> bb8; } bb5: { _5 = Le(_1, const 5i32); switchInt(move _5) -> [false: bb6, otherwise: bb2]; } bb6: { _7 = Le(const 6i32, _1); switchInt(move _7) -> [false: bb4, otherwise: bb7]; } bb7: { _8 = Le(_1, const 10i32); switchInt(move _8) -> [false: bb4, otherwise: bb3]; } ``` MIR (after): ```rust bb0: { ...; _4 = Le(const 0i32, _1); switchInt(move _4) -> [false: bb5, otherwise: bb6]; } bb1: { _3 = const 0i32; goto -> bb8; } bb2: { _6 = _2; switchInt(move _6) -> [false: bb4, otherwise: bb1]; } // If `!b`, jumps to `_ =>` arm. bb3: { _3 = const 1i32; goto -> bb8; } bb4: { _3 = const 2i32; goto -> bb8; } bb5: { _7 = Le(const 6i32, _1); switchInt(move _7) -> [false: bb4, otherwise: bb7]; } bb6: { _5 = Le(_1, const 5i32); switchInt(move _5) -> [false: bb5, otherwise: bb2]; } bb7: { _8 = Le(_1, const 10i32); switchInt(move _8) -> [false: bb4, otherwise: bb3]; } ``` cc #29623
2018-12-17Address LLVM assertion failure by prepopulating with *just* name-anon-globals.Felix S. Klock II-1/+1
2018-12-17Auto merge of #56642 - nikic:llvm-6, r=alexcrichtonbors-4/+1
Bump minimum required LLVM version to 6.0 Based on the discussion in #55842, while the overall position of Rust wrt LLVM continues to be contentious, there does seem to be a consensus that there is no need for continued support of LLVM 5. This PR bumps our version requirement to LLVM 6.0 and makes Travis run against that. I hope that this is going to unblock #52694. If I understand correctly, while this issue still exists in LLVM 6, Ubuntu has backported the relevant patch. r? @alexcrichton
2018-12-16Add test to check order of repr(int) enum fieldsPeter Todd-24/+30
RFC #2195 specifies that a repr(int) enum such as: #[repr(u8)] enum MyEnum { B { x: u8, y: i16, z: u8 }, } has a layout that is equivalent to: #[repr(C)] enum MyEnumVariantB { tag: u8, x: u8, y: i16, z: u8 }, However this isn't actually implemented, with the actual layout being roughly equivalent to: union MyEnumPayload { B { x: u8, y: i16, z: u8 }, } #[repr(packed)] struct MyEnum { tag: u8, payload: MyEnumPayload, } Thus the variant payload is *not* subject to repr(C) ordering rules, and gets re-ordered as `{ x: u8, z: u8, z: i16 }` The existing tests added in pull-req #45688 fail to catch this as the repr(C) ordering just happens to match the current Rust ordering in this case; adding a third field reveals the problem.
2018-12-15Auto merge of #56540 - oli-obk:less_const_hackery, r=varkorbors-0/+1
Don't depend on `Allocation` sizes for pattern length And generally be more explicit about shortcomings of the implementation cc @RalfJung
2018-12-15Improve `match` MIR generation for rangesShotaro Yamada-0/+83
Makes testing a range rule out ranges/constant covered by the range that is being tested
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-0/+57
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-14process nested obligations in autoderefAriel Ben-Yehuda-0/+34
This is a hack-fix to #53843, but I am worried it might break things because it makes the "inference pollution" problem worse. Fixes #53843 (but introduces a bug that someone might notice).
2018-12-14Rollup merge of #56789 - alexcrichton:simd_select_bitmask, r=rkruppekennytm-0/+30
rustc: Add an unstable `simd_select_bitmask` intrinsic This is going to be required for binding a number of AVX-512 intrinsics in the `stdsimd` repository, and this intrinsic is the same as `simd_select` except that it takes a bitmask as the first argument instead of a SIMD vector. This bitmask is then transmuted into a `<NN x i8>` argument, depending on how many bits it is. cc rust-lang-nursery/stdsimd#310