about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-02-22support unit tests with return values that implement `Terminaton`Niko Matsakis-0/+28
Extend `Termination` trait with a method to determine what happens with a unit test. This commit incorporates work by Bastian Köcher <git@kchr.de>.
2018-02-23Fix parsing of extern paths in types and poly-traitsVadim Petrochenkov-1/+7
2018-02-21add `unwind_attributes` featureNiko Matsakis-0/+2
2018-02-20make `#[unwind]` attribute specify expectations more clearlyNiko Matsakis-0/+1
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
2018-02-19Add test.Jeffrey Seyfried-0/+26
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-12/+12
fix more typos found by codespell.
2018-02-18Auto merge of #47544 - U007D:master, r=nikomatsakisbors-0/+34
Relax termination_trait's error bound As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr
2018-02-17fix more typos found by codespell.Matthias Krüger-12/+12
2018-02-17Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisbors-0/+46
add transform for uniform array move out reworked second step for fix #34708 previous try #46686 r? @nikomatsakis
2018-02-17Auto merge of #47917 - davidtwco:issue-47703, r=nikomatsakisbors-0/+61
Fixes NLL: error from URL crate Fixes #47703. r? @nikomatsakis
2018-02-16Auto merge of #46714 - leodasvacas:refactor-structurally-resolve-type, ↵bors-0/+20
r=nikomatsakis Refactor diverging and numeric fallback. This refactoring tries to make numeric fallback easier to reason about. Instead of applying all fallbacks at an arbitrary point in the middle of inference, we apply the fallback only when necessary and only for the variable that requires it. The only place that requires early fallback is the target of numeric casts. The visible consequences is that some error messages that got `i32` now get `{integer}` because we are less eager about fallback. The bigger goal is to make it easier to integrate user fallbacks into inference, if we ever figure that out.
2018-02-16Auto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakisbors-642/+42
#37653 support `default impl` for specialization this commit implements the second part of the `default impl` feature: > - a `default impl` need not include all items from the trait > - a `default impl` alone does not mean that a type implements the trait The first point allows rustc to compile and run something like this: ``` trait Foo { fn foo_one(&self) -> &'static str; fn foo_two(&self) -> &'static str; } default impl<T> Foo for T { fn foo_one(&self) -> &'static str { "generic" } } struct MyStruct; fn main() { assert!(MyStruct.foo_one() == "generic"); } ``` but it shows a proper error if trying to call `MyStruct.foo_two()` The second point allows a `default impl` to be considered as not implementing the `Trait` if it doesn't implement all the trait items. The tests provided (in the compile-fail section) should cover all the possible trait resolutions. Let me know if some tests is missed. See [referenced ](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @nikomatsakis
2018-02-15add Self: Trait<..> inside the param_env of a default implGianni Ciccarelli-1/+9
2018-02-15Fix arguments specified by lxl in two-phase-bin-ops testbobtwinkles-1/+0
2018-02-14Added tests for #47703David Wood-0/+61
2018-02-14macro-commas test cleanupMichael Lamparski-19/+5
2018-02-13Make nested impl Trait a hard errorTaylor Cramer-6/+5
2018-02-13Allow two-phase borrows of &mut self in opsbobtwinkles-0/+49
We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129
2018-02-12changed termination_trait's bound from Error to Debug; added compiletest ↵Brad Gibson-0/+34
header command and appropriate tests
2018-02-11Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakisbors-0/+88
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
2018-02-11Add test.Jeffrey Seyfried-0/+30
2018-02-09rustc: Upgrade to LLVM 6Alex Crichton-6/+28
The following submodules have been updated for a new version of LLVM: - `src/llvm` - `src/libcompiler_builtins` - transitively contains compiler-rt - `src/dlmalloc` This also updates the docker container for dist-i686-freebsd as the old 16.04 container is no longer capable of building LLVM. The compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without much interesting happening, but the LLVM update here is of particular note. Unlike previous updates I haven't cherry-picked all existing patches we had on top of our LLVM branch as we have a [huge amount][patches4] and have at this point forgotten what most of them are for. Instead I started from the current `release_60` branch in LLVM and only applied patches that were necessary to get our tests working and building. The current set of custom rustc-specific patches included in this LLVM update are: * rust-lang/llvm@1187443 - this is how we actually implement `cfg(target_feature)` for now and continues to not be upstreamed. While a hazard for SIMD stabilization this commit is otherwise keeping the status quo of a small rustc-specific feature. * rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't upstreamed, notably teaching LLVM about our allocation-related routines (which aren't malloc/free). Once we stabilize the global allocator routines we will likely want to upstream this patch, but for now it seems reasonable to keep it on our fork. * rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in our 32-bit linux container. I'm not really sure why it's necessary but my guess is that it's because of the absolutely ancient glibc that we're using. In any case it's only updating pieces we're not actually using in LLVM so I'm hoping it'll turn out alright. This doesn't seem like something we'll want to upstream.c * rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our i686-freebsd container, I'm not really sure what's going on but we for sure probably don't want to upstream this and otherwise it seems not too bad for now at least. * rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug] which although diagnosed to a particular revision isn't currently fixed upstream (and the bug itself doesn't seem too active). This commit is a partial revert of the suspected cause of this regression (found via a bisection). I'm sort of hoping that this eventually gets fixed upstream with a similar fix (which we can replace in our branch), but for now I'm also hoping it's a relatively harmless change to have. After applying these patches (plus one [backport] which should be [backported upstream][llvm-back]) I believe we should have all tests working on all platforms in our current test suite. I'm like 99% sure that we'll need some more backports as issues are reported for LLVM 6 when this propagates through nightlies, but that's sort of just par for the course nowadays! In any case though some extra scrutiny of the patches here would definitely be welcome, along with scrutiny of the "missing patches" like a [change to pass manager order](rust-lang/llvm@27174447533), [another change to pass manager order](rust-lang/llvm@c782febb7b9), some [compile fixes for sparc](rust-lang/llvm@1a83de63c42), and some [fixes for solaris](rust-lang/llvm@c2bfe0abb). [patches4]: https://github.com/rust-lang/llvm/compare/5401fdf23...rust-llvm-release-4-0-1 [backport]: https://github.com/rust-lang/llvm/commit/5c54c252db [llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114 [upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096 --- The update to LLVM 6 is desirable for a number of reasons, notably: * This'll allow us to keep up with the upstream wasm backend, picking up new features as they start landing. * Upstream LLVM has fixed a number of SIMD-related compilation errors, especially around AVX-512 and such. * There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed in the LLVM 4 branch we're using. * Overall it's not a great idea to stagnate with our codegen backend! This update is mostly powered by #47730 which is allowing us to update LLVM *independent* of the version of LLVM that Emscripten is locked to. This means that when compiling code for Emscripten we'll still be using the old LLVM 4 backend, but when compiling code for any other target we'll be using the new LLVM 6 target. Once Emscripten updates we may no longer need this distinction, but we're not sure when that will happen! Closes #43370 Closes #43418 Closes #47015 Closes #47683 Closes rust-lang-nursery/stdsimd#157 Closes rust-lang-nursery/rust-wasm#3
2018-02-09add Self: Trait<..> inside the param_env of a default implGianni Ciccarelli-1/+1
2018-02-08Revert checking casts before fallback.leonardo.yvens-0/+4
This turns out to not be backwards compatible.
2018-02-08fix nested impl trait lifetimesTaylor Cramer-0/+8
2018-02-08add transform for uniform array move outMikhail Modin-0/+46
2018-02-07support `default impl` for specializationGianni Ciccarelli-784/+8
a default impl should never be considered as implementing the trait on its own -- regardless of whether it contains all items or not
2018-02-07 support `default impl` for specializationGianni Ciccarelli-0/+168
a `default impl` need not include all items from the trait a `default impl` alone does not mean that a type implements the trait
2018-02-07add tests for macro trailing commasMichael Lamparski-0/+480
2018-02-06Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, ↵kennytm-3/+0
r=petrochenkov Stabilize use_nested_groups As requested in #44494. Documentation PRs already sent.
2018-02-05Stabilize use_nested_groupsPietro Albini-3/+0
2018-02-05Auto merge of #47920 - Aaron1011:nll-overflow, r=pnkfelixbors-0/+33
Fix overflow when performing drop check calculations in NLL Clearing out the infcx's region constraints after processing each type ends up interacting badly with normalizing associated types. This commit keeps all region constraints intact until the end of TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized types are able to re-use existing inference variables. Fixes #47589
2018-02-05Auto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakisbors-0/+26
Fix ref-to-ptr coercions not working with NLL in certain cases Implicit coercions from references to pointers were lowered to slightly different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted in certain uses of self-referential structs compiling correctly when an explicit cast was used, but not when the implicit coercion was used. To fix this, this commit adds an outer 'Use' expr when applying a raw-ptr-borrow adjustment. This makes the lowered Mir for coercions identical to that of explicit coercions, allowing the original code to compile regardless of how the raw ptr cast occurs. Fixes #47722
2018-02-05Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obkkennytm-0/+43
Turn `type_id` into a constant intrinsic https://github.com/rust-lang/rust/issues/27745 The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.
2018-02-04Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, ↵kennytm-0/+28
r=petrochenkov Stabilize feature(match_beginning_vert) With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm. Reference PR: rust-lang-nursery/reference#231 Closes #44101
2018-02-04Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichtonkennytm-2/+2
Use a range to identify SIGSEGV in stack guards Previously, the `guard::init()` and `guard::current()` functions were returning a `usize` address representing the top of the stack guard, respectively for the main thread and for spawned threads. The `SIGSEGV` handler on `unix` targets checked if a fault was within one page below that address, if so reporting it as a stack overflow. Now `unix` targets report a `Range<usize>` representing the guard memory, so it can cover arbitrary guard sizes. Non-`unix` targets which always return `None` for guards now do so with `Option<!>`, so they don't pay any overhead. For `linux-gnu` in particular, the previous guard upper-bound was `stackaddr + guardsize`, as the protected memory was *inside* the stack. This was a glibc bug, and starting from 2.27 they are moving the guard *past* the end of the stack. However, there's no simple way for us to know where the guard page actually lies, so now we declare it as the whole range of `stackaddr ± guardsize`, and any fault therein will be called a stack overflow. This fixes #47863.
2018-02-03Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakisbors-0/+28
Generator bugfixes r? @nikomatsakis
2018-02-02Rollup merge of #47898 - Aaron1011:static-ref-nll, r=nikomatsakis Fix ICE ↵kennytm-0/+20
when assigning references to a static mut with NLL is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
2018-02-01Turn `type_id` into a constant intrinsicBadel2-0/+43
Add rustc_const_unstable attribute for `any::TypeId::of` Add test for `const fn TypeId::of`
2018-02-01Auto merge of #47738 - nikomatsakis:issue-47139-master, r=arielb1bors-0/+162
remove intercrate ambiguity hints The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways. cc @sgrif -- this *should* fix diesel cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first. r? @eddyb
2018-01-31Fix overflow when performing drop check calculations in NLLAaron Hill-0/+33
Clearing out the infcx's region constraints after processing each type ends up interacting badly with normalizing associated types. This commit keeps all region constraints intact until the end of TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized types are able to re-use existing inference variables. Fixes #47589
2018-01-31Enable stack-probe tests with system LLVM >= 5.0Josh Stone-2/+2
2018-01-31Rollup merge of #47891 - eddyb:issue-47638, r=nikomatsakiskennytm-0/+18
rustc_trans: keep LLVM types for trait objects anonymous. Fixes #47638 by reverting the addition of readable LLVM trait object type names. r? @nikomatsakis
2018-01-30Fix ICE when assigning references to a static mut with NLLAaron Hill-0/+20
is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
2018-01-31rustc_trans: keep LLVM types for trait objects anonymous.Eduard-Mihai Burtescu-0/+18
2018-01-30stabilize match_beginning_vertJonathan Goodman-0/+28
2018-01-30Improved tests + typo fixes + assertMark Mansi-11/+66
2018-01-30Fix more testsMark Mansi-0/+2
2018-01-30Fix typo in error message + update testsMark Mansi-0/+6
2018-01-30Add a couple of testsMark Mansi-0/+25