about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
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
2017-11-27Auto merge of #44884 - arielb1:pack-safe, r=nikomatsakis,eddybbors-3/+136
Make accesses to fields of packed structs unsafe To handle packed structs with destructors (which you'll think are a rare case, but the `#[repr(packed)] struct Packed<T>(T);` pattern is ever-popular, which requires handling packed structs with destructors to avoid monomorphization-time errors), drops of subfields of packed structs should drop a local move of the field instead of the original one. That's it, I think I'll use a strategy suggested by @Zoxc, where this mir ``` drop(packed_struct.field) ``` is replaced by ``` tmp0 = packed_struct.field; drop tmp0 ``` cc #27060 - this should deal with that issue after codegen of drop glue is updated. The new errors need to be changed to future-compatibility warnings, but I'll rather do a crater run first with them as errors to assess the impact. cc @eddyb Things which still need to be done for this: - [ ] - handle `repr(packed)` structs in `derive` the same way I did in `Span`, and use derive there again - [ ] - implement the "fix packed drops" pass and call it in both the MIR shim and validated MIR pipelines - [ ] - do a crater run - [ ] - convert the errors to compatibility warnings
2017-11-26Stabilize const-calling existing const-fns in stdSimon Sapin-34/+2
Fixes #46038
2017-11-26Update tests for -Zborrowck-mir -> -Zborrowck=mode migrationest31-4/+3
2017-11-26limit packed copy-out to non-generic Copy structsAriel Ben-Yehuda-1/+1
2017-11-26fix #[derive] implementation for repr(packed) structsAriel Ben-Yehuda-0/+45
Fix the derive implementation for repr(packed) structs to move the fields out instead of calling functions on references to each subfield. That's it, `#[derive(PartialEq)]` on a packed struct now does: ```Rust fn eq(&self, other: &Self) { let field_0 = self.0; let other_field_0 = other.0; &field_0 == &other_field_0 } ``` Instead of ```Rust fn eq(&self, other: &Self) { let ref field_0 = self.0; let ref other_field_0 = other.0; &*field_0 == &*other_field_0 } ``` Taking (unaligned) references to each subfield is undefined, unsound and is an error with MIR effectck, so it had to be prevented. This causes a borrowck error when a `repr(packed)` struct has a non-Copy field (and therefore is a [breaking-change]), but I don't see a sound way to avoid that error.
2017-11-26make accessing packed fields a future-compat warningAriel Ben-Yehuda-0/+42
2017-11-26fix codegen of drops of fields of packed structsAriel Ben-Yehuda-0/+42
2017-11-26make accesses to fields of packed structs unsafeAriel Ben-Yehuda-3/+7
To handle packed structs with destructors (which you'll think are a rare case, but the `#[repr(packed)] struct Packed<T>(T);` pattern is ever-popular, which requires handling packed structs with destructors to avoid monomorphization-time errors), drops of subfields of packed structs should drop a local move of the field instead of the original one. cc #27060 - this should deal with that issue after codegen of drop glue is updated. The new errors need to be changed to future-compatibility warnings, but I'll rather do a crater run first with them as errors to assess the impact.
2017-11-25avoid type-live-for-region obligations on dummy nodesAriel Ben-Yehuda-0/+32
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.
2017-11-24std: Flag Windows TLS dtor symbol as #[used]Alex Crichton-0/+41
Turns out ThinLTO was internalizing this symbol and eliminating it. Worse yet if you compiled with LTO turns out no TLS destructors would run on Windows! The `#[used]` annotation should be a more bulletproof implementation (in the face of LTO) of preserving this symbol all the way through in LLVM and ensuring it makes it all the way to the linker which will take care of it.
2017-11-22add some tests for the interaction with existential impl traitNiko Matsakis-1/+21
2017-11-22Implement in-band lifetime bindingsTaylor Cramer-0/+84
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-34/+0
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-21Auto merge of #45771 - petrochenkov:crate, r=nikomatsakisbors-0/+36
Support `::crate` in paths cc https://github.com/rust-lang/rust/issues/45477 Fixes https://github.com/rust-lang/rust/issues/45229