about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2017-12-26Implements RFC 1937: `?` in `main`Bastian Köcher-0/+45
This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function.
2017-12-26Add tests to fixed ICEsSeiichi Uchida-0/+113
Closes #27078. Closes #27985. Closes #39848. Closes #42164. Closes #42479. Closes #45152. Closes #45662. Closes #45876. Closes #45965.
2017-12-25Auto merge of #46973 - arielb1:tuple-casting, r=estebankbors-0/+17
Update check::cast::pointer_kind logic to new rustc Make the match exhaustive, adding handling for anonymous types and tuple coercions on the way. Also, exit early when type errors are detected, to avoid error cascades and the like. Fixes #33690. Fixes #46365. Fixes #46880.
2017-12-24Auto merge of #46859 - gereeter:uninhabited-unions, r=eddybbors-0/+39
Only mark unions as uninhabited if all of their fields are uninhabited Fixes #46845.
2017-12-24Auto merge of #46888 - cramertj:nested-impl-trait-error, r=nikomatsakisbors-1/+1
Add a feature gate for nested uses of `impl Trait` This allows us to delay stabilization of nested `impl Trait` until we have a plan to solve the problem posed [here](https://github.com/rust-lang/rust/issues/34511#issuecomment-350715858). r? @nikomatsakis
2017-12-24Auto merge of #46833 - diwic:7c-abort-ffi, r=arielb1bors-0/+43
Prevent unwinding past FFI boundaries Second attempt to write a patch to solve this. r? @nikomatsakis ~~So, my biggest issue with this patch is the way the patch determines *what* functions should have an abort landing pad (in `construct_fn`). I would ideally have this code match [src/librustc_trans/callee.rs::get_fn](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/callee.rs#L107-L115) but couldn't find an id that returns true for `is_foreign_item`. Also tried `tcx.has_attr("unwind")` with no luck.~~ FIXED Other issues: * llvm.trap is an SIGILL on amd64. Ideally we could use panic-abort's version of aborting which is nicer but we don't want to depend on that library... * ~~Mir inlining is a stub currently.~~ FIXED (no-op) Also, when reviewing please take into account that I'm new to the code and only partially know what I'm doing... and that I've mostly made made matches on `TerminatorKind::Abort` match either `TerminatorKind::Resume` or `TerminatorKind::Unreachable` based on what looked best.
2017-12-24Fix testsest31-5/+5
2017-12-23Give MIR borrowck a better understanding of inline asmMatthew Jasper-0/+43
2017-12-23Update check::cast::pointer_kind logic to new rustcAriel Ben-Yehuda-0/+17
Make the match exhaustive, adding handling for anonymous types and tuple coercions on the way. Also, exit early when type errors are detected, to avoid error cascades and the like.
2017-12-22Auto merge of #46752 - Yoric:nll, r=arielb1bors-0/+34
Issue #46589 - Kill borrows on a local variable whenever we assign ov… …er this variable This is a first patch for the issue, handling the simple case while I figure out the data structures involved in the more complex cases.
2017-12-22Rollup merge of #46809 - eddyb:issue-46769-optimal, r=arielb1kennytm-2/+11
rustc: do not raise the alignment of optimized enums to the niche's alignment. This is the improved fix for #46769 that does not increase the size of any types (see also #46808).
2017-12-21Issue #46589 - Kill borrows on a local variable whenever we assign over this ↵David Teller-0/+34
variable
2017-12-21Add a feature gate for nested uses of `impl Trait`Taylor Cramer-1/+1
2017-12-21Auto merge of #46754 - cramertj:refactor-arg-impl, r=nikomatsakisbors-3/+2
Refactor argument-position impl Trait Fixes https://github.com/rust-lang/rust/issues/46685, https://github.com/rust-lang/rust/issues/46470 r? @nikomatsakis cc @chrisvittal
2017-12-21Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakisbors-0/+173
Implement non-mod.rs mod statements Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660 This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-21Mir: Abort on nounwind ABIsDavid Henningsson-0/+43
Generate Abort instead of Resume terminators on nounwind ABIs. https://github.com/rust-lang/rust/issues/18510 Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-20add some run-pass tests for NLL showing that things work as expectedNiko Matsakis-0/+108
2017-12-20feature nll implies borrowck=mirSantiago Pastorino-1/+0
2017-12-20feature nll implies two-phase-borrowsSantiago Pastorino-1/+3
2017-12-20connect NLL type checker to the impl trait codeNiko Matsakis-0/+3
We now add the suitable `impl Trait` constraints.
2017-12-20Rollup merge of #46831 - Diggsey:float-debug-fmt, r=dtolnaykennytm-2/+2
Always `Debug` floats with a decimal point Fixes #30967 r? @dtolnay
2017-12-20rustc: do not raise the alignment of optimized enums to the niche's alignment.Eduard-Mihai Burtescu-2/+11
2017-12-19Ignore pretty printing tests for non_modrs_modsTaylor Cramer-0/+2
2017-12-19Only mark unions as uninhabited if all of their fields are uninhabited. ↵Jonathan S-0/+39
Fixes #46845.
2017-12-19Implement non-mod.rs mod statementsTaylor Cramer-0/+171
2017-12-19Auto merge of #46664 - mikeyhew:raw_pointer_self, r=arielb1bors-0/+107
arbitrary_self_types: add support for raw pointer `self` types This adds support for raw pointer `self` types, under the `arbitrary_self_types` feature flag. Types like `self: *const Self`, `self: *const Rc<Self>`, `self: Rc<*const Self` are all supported. Object safety checks are updated to allow`self: *const Self` and `self: *mut Self`. This PR does not add support for `*const self` and `*mut self` syntax. That can be added in a later PR once this code is reviewed and merged. #44874 r? @arielb1
2017-12-19Auto merge of #46829 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-0/+16
Rollup of 11 pull requests - Successful merges: #46700, #46786, #46790, #46800, #46801, #46802, #46804, #46805, #46812, #46824, #46825 - Failed merges:
2017-12-19Always print floats with a decimal point with the Debug formatterDiggory Blake-2/+2
2017-12-18rustc: ensure optimized enums have a properly aligned size.Eduard-Mihai Burtescu-3/+10
2017-12-18Fix the wrong subtraction in align_offset intrinsic.kennytm-0/+16
2017-12-17better variable names in testsMichael Hewson-16/+16
2017-12-17Add tests with *const Rc<Self> and similar self typesMichael Hewson-4/+28
2017-12-17implement raw-pointer `self`. Works for traits, including trait objects, but ↵Michael Hewson-0/+83
not structs
2017-12-15Refactor argument-position impl TraitTaylor Cramer-3/+2
2017-12-15Auto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1bors-0/+48
[MIR-borrowck] Two phase borrows This adds limited support for two-phase borrows as described in http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ The support is off by default; you opt into it via the flag `-Z two-phase-borrows` I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs (To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
2017-12-14Review feedback: Added test with control flow merge of two borrows "before ↵Felix S. Klock II-0/+27
activation" In reality the currently generated MIR has at least one of the activations in a copy that occurs before the merge. But still, good to have a test, in anticipation of that potentially changing...
2017-12-14Auto merge of #46582 - nikomatsakis:nll-master-to-rust-master-4, r=arielb1bors-0/+38
make MIR type checker handle a number of other cases The existing type checker was primarily used to verify types, but was skipping over a number of details. For example, it was not checking that the predicates on functions were satisfied and so forth. This meant that the NLL region checker was not getting a lot of the constraints it needed. This PR closes those gaps. It also includes a bit of refactoring for the way that we store region values, encapsulating the bit matrix over into its own module and improving the data structures in use. This is mostly work by @spastorino being ported over from nll-master. r? @arielb1 or @pnkfelix
2017-12-13the minimal test for two-phase borrows: the core example from niko's blog ↵Felix S. Klock II-0/+21
post on it.
2017-12-13Add example of making an unhygienic macro hygienic by wrapping it in a ↵Jeffrey Seyfried-0/+91
declarative macro.
2017-12-13Improve interaction between macros 2.0 and `macro_rules!`.Jeffrey Seyfried-0/+69
2017-12-13normalize fn sig as part of reificationNiko Matsakis-0/+38
2017-12-13Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrcbors-0/+59
Record all imports (`use`, `extern crate`) in the crate metadata This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases. Fixes #42337. r? @nrc
2017-12-13Auto merge of #46616 - cramertj:impl-trait-elision, r=nikomatsakisbors-1/+25
Implement impl Trait lifetime elision Fixes #43396. There's one weird ICE in the interaction with argument-position `impl Trait`. I'm still debugging it-- I've left a test for it commented out with a FIXME. Also included a FIXME to ensure that `impl Trait` traits are caught under the lint in https://github.com/rust-lang/rust/issues/45992. r? @nikomatsakis
2017-12-13Auto merge of #46613 - petrochenkov:absext, r=nikomatsakisbors-0/+51
Resolve absolute paths as extern under a feature flag cc https://github.com/rust-lang/rust/issues/44660 r? @nikomatsakis
2017-12-12Auto merge of #46570 - AgustinCB:issue-46553, r=oli-obkbors-0/+32
Ignore `unsopported constant expr` error Fixes #46553
2017-12-13Resolve absolute paths as extern under a feature flagVadim Petrochenkov-0/+51
2017-12-12Implement impl Trait lifetime elisionTaylor Cramer-1/+25
2017-12-09Auto merge of #46573 - jseyfried:add_decl_macro_test, r=nrcbors-0/+25
macros: add test for #44128 Closes #44128. r? @nrc
2017-12-08Auto merge of #46556 - michaelwoerister:enable-query-caching, r=nmatsakisbors-336/+1
incr.comp.: Enable query result caching for many more queries Newly cached queries are: * const_is_rvalue_promotable_to_static * trans_fulfill_obligation * optimized_mir * unsafety_check_result * borrowck * mir_borrowck * mir_const_qualif * contains_extern_indicator * def_symbol_name * symbol_name This also includes the stricter `Span` hashing first mentioned in #46490, which will lead to more false positives in release builds but overall is more correct -- and necessary for caching MIR. Hopefully we will soon be able to reduce the rate of false positives again by factoring `Span` out of MIR. r? @nikomatsakis
2017-12-08Remove some svh-tests from run-pass.Michael Woerister-336/+1
These were already broken for debug builds.