about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
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-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.
2017-12-08Auto merge of #46549 - alexcrichton:thinlto-weak, r=michaelwoeristerbors-0/+37
rustc: Further tweak linkage in ThinLTO In #46382 the logic around linkage preservation with ThinLTO ws tweaked but the loop that registered all otherwise exported GUID values as "don't internalize me please" was erroneously too conservative and only asking "external" linkage items to not be internalized. Instead we actually want the inversion of that condition, everything *without* "local" linkage to be internalized. This commit updates the condition there, adds a test, and... Closes #46543
2017-12-08deny instead of warnAgustin Chiappe Berrini-1/+1
2017-12-07Add test for #44128.Jeffrey Seyfried-0/+25
2017-12-07Ignore `unsopported constant expr` errorAgustin Chiappe Berrini-0/+32
2017-12-07rustc: Further tweak linkage in ThinLTOAlex Crichton-0/+37
In #46382 the logic around linkage preservation with ThinLTO ws tweaked but the loop that registered all otherwise exported GUID values as "don't internalize me please" was erroneously too conservative and only asking "external" linkage items to not be internalized. Instead we actually want the inversion of that condition, everything *without* "local" linkage to be internalized. This commit updates the condition there, adds a test, and... Closes #46543
2017-12-07Auto merge of #46528 - CensoredUsername:stabilize_abi_sysv64, r=arielb1bors-2/+0
Stabilize abi_sysv64 Closes #36167, stabilizing the use of the "sysv64" ABI on x64 platforms where it is not the default ABI. FCP on this is complete in the tracking issue.
2017-12-07rustc_mir: promote references of statics from other statics.Eduard-Mihai Burtescu-0/+2
2017-12-06Auto merge of #46268 - arielb1:union-borrow, r=nikomatsakisbors-0/+1
MIR borrowck: implement union-and-array-compatible semantics Fixes #44831. Fixes #44834. Fixes #45537. Fixes #45696 (by implementing DerefPure semantics, which is what we want going forward). r? @nikomatsakis
2017-12-06Auto merge of #46192 - arielb1:locally-coherent, r=nikomatsakisbors-0/+36
coherence: fix is_knowable logic A trait-ref that passes the orphan-check rules can still be implemented in a crate downstream from our crate (for example, `LocalType for LocalTrait<_>` might be matched by a `LocalType for LocalTrait<TypeFromDownstreamCrate>`), and this should be known by the `is_knowable` logic. Trait selection had a hackfix for this, but it's an hacky fix that does not handle all cases. This patch removes it. fixes #43355. r? @nikomatsakis Needs a crater run
2017-12-05Include non-`pub` `use` and `extern crate` items in the crate metadata for ↵Jeffrey Seyfried-0/+59
macros 2.0.
2017-12-06Stabilize abi_sysv64CensoredUsername-2/+0
2017-12-06work around weird match arm lifetimesAriel Ben-Yehuda-0/+1
2017-12-05rustc_trans: don't write discriminants for uninhabited variantsSimon Sapin-0/+37
Fixes #46519. Patch as suggested by eddyb: https://github.com/rust-lang/rust/issues/46519#issuecomment-349443519
2017-12-06convert errors to warningsAriel Ben-Yehuda-2/+0
2017-12-05convert the new conflicts to a soft errorAriel Ben-Yehuda-0/+38
2017-12-05rustc_mir: don't move temporaries that are still used later.Eduard-Mihai Burtescu-0/+4
2017-12-03Auto merge of #46334 - mikhail-m1:slice_pattern_array_drop, r=arielb1bors-1/+37
create a drop ladder for an array if any value is moved out r? @arielb1 first commit for fix https://github.com/rust-lang/rust/issues/34708 (note: this still handles the subslice case in a very broken manner)
2017-12-03Auto merge of #46320 - arielb1:always-resume, r=nikomatsakisbors-0/+2
Always unwind through a Resume and other fixes Should fix most of the small MIR borrowck issues. r? @nikomatsakis
2017-12-03don't track borrows for empty regionsAriel Ben-Yehuda-0/+1
Region inference can create borrows for an empty region if the borrow is dead. In that case, there's no reason to track the borrow, but because there's no such thing as an EndRegion(ReEmpty) these borrows used to live for the entire function. Fixes #46161.
2017-12-03initialize the destination in unit statementsAriel Ben-Yehuda-0/+1
Fixes #46159.
2017-12-02Auto merge of #46382 - alexcrichton:thinlto-default, r=michaelwoeristerbors-4/+4
rustc: Prepare to enable ThinLTO by default This commit *almost* enables ThinLTO and multiple codegen units in release mode by default but is blocked on #46346 now before pulling the trigger.
2017-12-02create a drop ladder for an array if any value is moved outMikhail Modin-1/+37
2017-12-02Rollup merge of #46401 - alexcrichton:wasm-tests, r=arielb1kennytm-1/+0
wasm: Update LLVM to fix a test This commit updates LLVM with some tweaks to the integer <-> floating point conversion instructions to ensure that `as` in Rust doesn't trap. Closes #46298
2017-12-02Rollup merge of #45880 - arielb1:never-coerce, r=nikomatsakiskennytm-1/+1
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in #35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
2017-12-01Auto merge of #46236 - davidtwco:issue-46023, r=arielb1bors-0/+2
MIR-borrowck: immutable unique closure upvars can be mutated Fixes #46023 and #46160 (see [this comment](https://github.com/rust-lang/rust/pull/46236#issuecomment-347204874)).
2017-11-30Added test for spurious cannot borrow immutable item error with a closureDavid Wood-0/+2
2017-11-30rustc: Prepare to enable ThinLTO by defaultAlex Crichton-1/+1
This commit prepares to enable ThinLTO and multiple codegen units in release mode by default. We've still got a debuginfo bug or two to sort out before actually turning it on by default.
2017-11-30Rename long test names to be a bit shorterAlex Crichton-3/+3
Helps to avoid hitting path limits on Windows
2017-11-30wasm: Update LLVM to fix a testAlex Crichton-1/+0
This commit updates LLVM with some tweaks to the integer <-> floating point conversion instructions to ensure that `as` in Rust doesn't trap. Closes #46298
2017-11-30make coercions to `!` in unreachable code a hard errorAriel Ben-Yehuda-1/+1
This was added to cover up a lazy extra semicolon in #35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-0/+35
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-30Auto merge of #46226 - arielb1:special-region-obligation, r=nikomatsakisbors-0/+32
avoid type-live-for-region obligations on dummy nodes Type-live-for-region obligations on DUMMY_NODE_ID cause an ICE, and it turns out that in the few cases they are needed, these obligations are not needed anyway because they are verified elsewhere. Fixes #46069. Beta-nominating because this is a regression for our new beta. r? @nikomatsakis
2017-11-29Rollup merge of #46287 - SimonSapin:stable-constness, r=aturonkennytm-34/+2
Stabilize const-calling existing const-fns in std Fixes #46038
2017-11-28ci: Start running wasm32 tests on TravisAlex Crichton-0/+2
This commit allocates a builder to running wasm32 tests on Travis. Not all test suites pass right now so this is starting out with just the run-pass and the libcore test suites. This'll hopefully give us a pretty broad set of coverage for integration in rustc itself as well as a somewhat broad coverage of the llvm backend itself through integration/unit tests.
2017-11-28Auto merge of #46123 - Gankro:c-repr, r=eddybbors-3/+403
Implement the special repr(C)-non-clike-enum layout This is the second half of https://github.com/rust-lang/rfcs/pull/2195 which specifies that ```rust #[repr(C, u8)] #[derive(Copy, Clone, Eq, PartialEq, Debug)] enum MyEnum { A(u32), // Single primitive value B { x: u8, y: i16 }, // Composite, and the offset of `y` depends on tag being internal C, // Empty D(Option<u32>), // Contains an enum E(Duration), // Contains a struct } ``` Has the same layout as ```rust #[repr(C)] struct MyEnumRepr { tag: MyEnumTag, payload: MyEnumPayload, } #[repr(C)] #[allow(non_snake_case)] union MyEnumPayload { A: MyEnumVariantA, B: MyEnumVariantB, D: MyEnumVariantD, E: MyEnumVariantE, } #[repr(u8)] #[derive(Copy, Clone)] enum MyEnumTag { A, B, C, D, E } #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantA(u32); #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantB {x: u8, y: i16 } #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantD(Option<u32>); #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantE(Duration); ```
2017-11-28Fix and improve test for enum repr sizesAlexis Beingessner-3/+49