about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-07-20Add testOliver Schneider-0/+35
2018-07-20Auto merge of #52498 - oli-obk:const_prop, r=nikomatsakisbors-1/+6
Const propagate casts fixes #49760 So... This fixes the original issue about the missing warnings. But our test suite contains fun things like ```rust fn foo() {} assert_eq!(foo as i16, foo as usize as i16); ``` Which, will result in > a raw memory access tried to access part of a pointer value as raw bytes on both sides of the assertion. Because well... that's exactly what's going on! We're ripping out 16 bits of a pointer.
2018-07-20Add test case for #50865 regression.Kyle Simpson-0/+44
2018-07-20Remove duplicate E0396 testsljedrz-10/+0
2018-07-19Enable run-pass/sepcomp-lib-lto.rs on Androidljedrz-1/+0
2018-07-18Const-propagate castsOliver Schneider-1/+6
2018-07-18Adjust run pass test to stricter existential type rulesOliver Schneider-22/+3
2018-07-18Implement existential typesOliver Schneider-0/+113
2018-07-18revert DerefF001-1/+1
2018-07-17code style fixesF001-2/+3
2018-07-17impl `Deref` instead of `Index`F001-0/+1
2018-07-17remove "get_with" methodF001-2/+0
2018-07-17implement rfc 1789F001-0/+22
2018-07-15Auto merge of #52348 - oli-obk:bugfix, r=petrochenkovbors-1/+5
Reach the body of functions returning `impl Trait` but don't treat it as public fixes #52128 r? @pnkfelix cc @eddyb
2018-07-13Use the correct visibilityOliver Schneider-1/+5
2018-07-13Fix some RangeInclusive test cases.kennytm-10/+19
2018-07-12Auto merge of #52089 - eddyb:issue-51907, r=nagisabors-0/+26
rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. Fixes #51907 by removing the vtable pointer before the `ArgType` is even created. This allows any ABI to support trait object method calls, regardless of how it passes `*dyn Trait`. r? @nikomatsakis
2018-07-11Rollup merge of #51952 - petrochenkov:transmark, r=alexcrichtonMark Rousskov-27/+0
hygiene: Decouple transparencies from expansion IDs And remove fallback to parent modules during resolution of names in scope. This is a breaking change for users of unstable macros 2.0 (both procedural and declarative), code like this: ```rust #![feature(decl_macro)] macro m($S: ident) { struct $S; mod m { type A = $S; } } fn main() { m!(S); } ``` or equivalent ```rust #![feature(decl_macro)] macro m($S: ident) { mod m { type A = $S; } } fn main() { struct S; m!(S); } ``` stops working due to module boundaries being properly enforced. For proc macro derives this is still reported as a compatibility warning to give `actix_derive`, `diesel_derives` and `palette_derive` time to fix their issues. Fixes https://github.com/rust-lang/rust/issues/50504 in accordance with [this comment](https://github.com/rust-lang/rust/issues/50504#issuecomment-399764767).
2018-07-11Auto merge of #51966 - alexcrichton:llvm7, r=michaelwoeristerbors-14/+32
Upgrade to LLVM's master branch (LLVM 7) ### Current status ~~Blocked on a [performance regression](https://github.com/rust-lang/rust/pull/51966#issuecomment-402320576). The performance regression has an [upstream LLVM issue](https://bugs.llvm.org/show_bug.cgi?id=38047) and has also [been bisected](https://reviews.llvm.org/D44282) to an LLVM revision.~~ Ready to merge! --- This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * ~~The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug]~~ Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382 cc #50543
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-14/+32
This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug] Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-10Auto merge of #52191 - SimonSapin:alloc_error_handler, r=alexcrichtonbors-0/+28
Implement #[alloc_error_handler] This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the `alloc` crate without the `std` crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
2018-07-09Add a test for the default allocation error hookSimon Sapin-0/+28
2018-07-09bump minimum LLVM version to 5.0gnzlbg-11/+0
2018-07-08Remove fallback to parent modules from lexical resolutionVadim Petrochenkov-27/+0
2018-07-06Rollup merge of #52058 - davidtwco:issue-51345, r=nikomatsakisMark Rousskov-0/+17
Use of unimplemented!() causing ICE with NLL Fixes #51345. r? @nikomatsakis
2018-07-07Add a test for Weak::new() not crashing for uninhabited typesSimon Sapin-0/+15
2018-07-06Auto merge of #52018 - flip1995:rfc2103, r=oli-obkbors-0/+31
Implementation of tool lints. Tracking issue: #44690
2018-07-06Auto merge of #51894 - mikhail-m1:8636, r=nikomatsakisbors-0/+33
fix for issue #8636 r? @nikomatsakis Fix #8636 also fixes #42291
2018-07-06rustc_codegen_llvm: replace the first argument early in FnType::new_vtable.Eduard-Mihai Burtescu-0/+26
2018-07-05fix for issue #8636Mikhail Modin-0/+33
2018-07-05Add a punch card to weird expressions testKonrad Borowski-0/+13
2018-07-04Correctly handle an activation from dead code.David Wood-0/+17
2018-07-04Tests for tool_lintsflip1995-0/+31
2018-07-02Add lifetime to `FutureObj`Josef Reinhard Brandl-4/+6
2018-07-02Make custom trait object for `Future` genericJosef Reinhard Brandl-4/+4
2018-07-01Auto merge of #51110 - alexreg:new-static-eval-rules, r=eddybbors-0/+125
Loosened rules involving statics mentioning other statics Before this PR, trying to mention a static in any way other than taking a reference to it caused a compile-time error. So, while ```rust static A: u32 = 42; static B: &u32 = &A; ``` compiles successfully, ```rust static A: u32 = 42; static B: u32 = A; // error ``` and ```rust static A: u32 = 42; static B: u32 = *&A; // error ``` are not possible to express in Rust. On the other hand, introducing an intermediate `const fn` can presently allow one to do just that: ```rust static A: u32 = 42; static B: u32 = foo(&A); // success! const fn foo(a: &u32) -> u32 { *a } ``` Preventing `const fn` from allowing to work around the ban on reading from statics would cripple `const fn` almost into uselessness. Additionally, the limitation for reading from statics comes from the old const evaluator(s) and is not shared by `miri`. This PR loosens the rules around use of statics to allow statics to evaluate other statics by value, allowing all of the above examples to compile and run successfully. Reads from extern (foreign) statics are however still disallowed by miri, because there is no compile-time value to be read. ```rust extern static A: u32; static B: u32 = A; // error ``` This opens up a new avenue of potential issues, as a static can now not just refer to other statics or read from other statics, but even contain references that point into itself. While it might seem like this could cause subtle bugs like allowing a static to be initialized by its own value, this is inherently impossible in miri. Reading from a static causes the `const_eval` query for that static to be invoked. Calling the `const_eval` query for a static while already inside the `const_eval` query of said static will cause cycle errors. It is not possible to accidentally create a bug in miri that would enable initializing a static with itself, because the memory of the static *does not exist* while being initialized. The memory is not uninitialized, it is not there. Thus any change that would accidentally allow reading from a not yet initialized static would cause ICEs. Tests have been modified according to the new rules, and new tests have been added for writing to `static mut`s within definitions of statics (which needs to fail), and incremental compilation with complex/interlinking static definitions. Note that incremental compilation did not need to be adjusted, because all of this was already possible before with workarounds (like intermediate `const fn`s) and the encoding/decoding already supports all the possible cases. r? @eddyb
2018-07-01Auto merge of #51833 - wesleywiser:faster_large_constant_arrays, r=oli-obkbors-0/+19
Speed up compilation of large constant arrays This is a different approach to #51672 as suggested by @oli-obk. Rather than write each repeated value one-by-one, we write the first one and then copy its value directly into the remaining memory. With this change, the [toy program](https://github.com/rust-lang/rust/blob/c2f4744d2db4e162df824d0bd0b093ba4b351545/src/test/run-pass/mir_heavy_promoted.rs) goes from 63 seconds to 19 seconds on my machine. Edit: Inlining `Size::bytes()` saves an additional 6 seconds dropping the total time to 13 seconds on my machine. Edit2: Now down to 2.8 seconds. r? @oli-obk cc @nnethercote @eddyb
2018-07-01Add two regression tests for const evalWesley Wiser-0/+19
2018-06-30Added tests fo referring to statics by value in other statics.Alexander Regueiro-0/+16
2018-06-30Fixed bug with miri const evaluation where allocation is recursively borrowed.Alexander Regueiro-0/+32
2018-06-30Added miri error for evaluating foreign statics.Alexander Regueiro-2/+58
Updated tests accordingly.
2018-06-30Loosened rules involving statics mentioning other statics.Alexander Regueiro-0/+21
Updated tests accordingly.
2018-06-30Auto merge of #51828 - kennytm:no-simd-swap-for-mac, r=alexcrichtonbors-0/+15
Do not allow LLVM to increase a TLS's alignment on macOS. This addresses the various TLS segfault on macOS 10.10. Fix #51794. Fix #51758. Fix #50867. Fix #48866. Fix #46355. Fix #44056.
2018-06-30Do not allow LLVM to increase a TLS's alignment on macOS.kennytm-0/+15
2018-06-29Add run-pass testGabriel Majeri-0/+18
2018-06-28Rollup merge of #51800 - mark-i-m:edition2018compiletest, r=nikomatsakiskennytm-9/+10
Add a compiletest header for edition r? @nikomatsakis Are the `-Zunstable-options` options needed in these tests? It looks like they aren't. If not, I can remove them.
2018-06-26add edition compiletest header + fix testsmark-9/+10
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-73/+73
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-26Auto merge of #51805 - pietroalbini:rollup, r=pietroalbinibors-1/+1
Rollup of 11 pull requests Successful merges: - #51104 (add `dyn ` to display of dynamic (trait) types) - #51153 (Link panic and compile_error docs) - #51642 (Fix unknown windows build) - #51730 (New safe associated functions for PinMut) - #51731 (Fix ICEs when using continue as an array length inside closures (inside loop conditions)) - #51747 (Add error for using null characters in #[export_name]) - #51769 (Update broken rustc-guide links) - #51786 (Remove unnecessary stat64 pointer casts) - #51788 (Fix typo) - #51789 (Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`) - #51791 (Minify css) Failed merges: r? @ghost
2018-06-26Rollup merge of #51104 - zackmdavis:dynamo, r=nikomatsakisPietro Albini-1/+1
add `dyn ` to display of dynamic (trait) types ~~I'm not sure we want the `dyn` in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like `Box<dyn Trait>`), but I'm finding the code I would need to change that hard to follow—the [display object seems to](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/traits/error_reporting.rs#L600) be a [`Predicate::Trait`](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L962) variant, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L1309) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L1112) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L975-L985) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~ Resolves #49277 (?). r? @nikomatsakis