about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-05-29Tests illustrating the bug fixes for #27282 and #24535.Felix S. Klock II-0/+68
2018-05-30Pass a `Layout` to `oom`Mike Hommey-7/+7
As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent, there are use-cases where the OOM handler needs to know the size of the allocation that failed. The alignment might also be a cause for allocation failure, so providing it as well can be useful.
2018-05-28Auto merge of #50521 - gnzlbg:simd_float, r=alexcrichtonbors-0/+301
Add simd math intrinsics and gather/scatter This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.
2018-05-25Don't use a char that's already used within the exprJaro Fietz-1/+1
2018-05-25Call itJaro Fietz-0/+1
2018-05-25What does an expression look like, that consists only of special characters?Jaro Fietz-0/+6
2018-05-24add comment explaining ignore androidgnzlbg-0/+4
2018-05-24just ignore androidgnzlbg-1/+1
2018-05-24ignore arm-androidgnzlbg-0/+1
2018-05-24refactorgnzlbg-1/+0
2018-05-24add gather/scatter tests for pointers of pointersgnzlbg-0/+71
2018-05-24add gather/scatter run-time testgnzlbg-0/+80
2018-05-24add run-time test and missing codegen testgnzlbg-0/+90
2018-05-24move simd-minmax-test to run-pass; require llvm 7gnzlbg-0/+56
2018-05-22Fix a typo in a commentOliver Schneider-1/+1
2018-05-22Report let bindings and statements as unstableOliver Schneider-1/+1
2018-05-22Allow let bindings in const fn and constantsOliver Schneider-0/+118
2018-05-21Auto merge of #50812 - kennytm:fix-50756-miri-bad-float-behavior, r=oli-obkbors-0/+65
Fix issue #50811 (`NaN > NaN` was true). Fix #50811 Make sure the float comparison output is consistent with the expected behavior when NaN is involved. ---- Note: This PR is a **BREAKING CHANGE**. If you have used `>` or `>=` to compare floats, and make the result as the length of a fixed array type, like: ```rust use std::f64::NAN; let x: [u8; (NAN > NAN) as usize] = [1]; ``` then the code will no longer compile. Previously, all float comparison involving NaN will just return "Greater", i.e. `NAN > NAN` would wrongly return `true` during const evaluation. If you need to retain the old behavior (why), you may replace `a > b` with `a != a || b != b || a > b`.
2018-05-21Auto merge of #50860 - nox:big-niches-for-big-doggos-🐕, r=eddybbors-0/+3
Find the largest niche when computing layouts Otherwise we end up with `Option<Option<(&(), bool)>>` unnecessarily large.
2018-05-20Auto merge of #50851 - eddyb:the-only-constant, r=nikomatsakisbors-0/+17
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's. That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself. Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected). This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor). * fixes #48838 * fixes #50600 * fixes #50688 * fixes #50689 * obsoletes #50623 r? @nikomatsakis
2018-05-20Auto merge of #50234 - cramertj:extend, r=alexcrichtonbors-0/+20
Add implementation of Extend for () This is useful in some generic code which wants to collect iterators of items into a result.
2018-05-20Auto merge of #50908 - petrochenkov:usemacself, r=alexcrichtonbors-0/+38
resolve: Don't add unnecessary import candidates for `prefix::{self}` imports Fixes https://github.com/rust-lang/rust/issues/50725
2018-05-20resolve: Don't add unnecessary import candidates for `prefix::{self}` importsVadim Petrochenkov-0/+38
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-0/+17
constants".
2018-05-19Release mode overflows should not cause const eval to errorOliver Schneider-0/+18
2018-05-19Auto merge of #50603 - eddyb:issue-49955, r=nikomatsakisbors-0/+56
rustc_mir: allow promotion of promotable temps indexed at runtime. Fixes #49955. r? @nikomatsakis
2018-05-18Auto merge of #50319 - nagisa:align_to, r=alexcrichtonbors-16/+0
Implement [T]::align_to Note that this PR deviates from what is accepted by RFC slightly by making `align_offset` to return an offset in elements, rather than bytes. This is necessary to sanely support `[T]::align_to` and also simply makes more sense™. The caveat is that trying to align a pointer of ZST is now an equivalent to `is_aligned` check, rather than anything else (as no number of ZST elements will align a misaligned ZST pointer). It also implements the `align_to` slightly differently than proposed in the RFC to properly handle cases where size of T and U aren’t co-prime. Furthermore, a promise is made that the slice containing `U`s will be as large as possible (contrary to the RFC) – otherwise the function is quite useless. The implementation uses quite a few underhanded tricks and takes advantage of the fact that alignment is a power-of-two quite heavily to optimise the machine code down to something that results in as few known-expensive instructions as possible. Currently calling `ptr.align_offset` with an unknown-at-compile-time `align` results in code that has just a single "expensive" modulo operation; the rest is "cheap" arithmetic and bitwise ops. cc https://github.com/rust-lang/rust/issues/44488 @oli-obk As mentioned in the commit message for align_offset, many thanks go to Chris McDonald.
2018-05-18Auto merge of #50697 - KiChjang:issue-50461, r=pnkfelixbors-0/+25
Use EverInit instead of MaybeInit to determine initialization Fixes #50461. Fixes #50463.
2018-05-18Find the largest niche when computing layoutsAnthony Ramine-0/+3
Otherwise we end up with `Option<Option<(&(), bool)>>` unnecessarily large.
2018-05-18Auto merge of #50307 - petrochenkov:keyhyg2, r=nikomatsakisbors-0/+248
Implement edition hygiene for keywords Determine "keywordness" of an identifier in its hygienic context. cc https://github.com/rust-lang/rust/pull/49611 I've resurrected `proc` as an Edition-2015-only keyword for testing purposes, but it should probably be buried again. EDIT: `proc` is removed again.
2018-05-17Auto merge of #50593 - nikomatsakis:nll-no-location, r=nikomatsakisbors-31/+0
stop considering location when computing outlives relationships This doesn't (yet?) use SEME regions, but it does ignore the location for outlives constraints. This makes (I believe) NLL significantly faster -- but we should do some benchmarks. It regresses the "get-default" family of use cases for NLL, which is a shame, but keeps the other benefits, and thus represents a decent step forward. r? @pnkfelix
2018-05-17Remove the `proc` keyword againVadim Petrochenkov-158/+0
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-10/+10
2018-05-17Add testsVadim Petrochenkov-0/+406
2018-05-17Implement [T]::align_toSimonas Kazlauskas-94/+0
2018-05-17Change align_offset to support different stridesSimonas Kazlauskas-2/+80
This is necessary if we want to implement `[T]::align_to` and is more useful in general. This implementation effort has begun during the All Hands and represents a month of my futile efforts to do any sort of maths. Luckily, I found the very very nice Chris McDonald (cjm) on IRC who figured out the core formulas for me! All the thanks for existence of this PR go to them! Anyway… Those formulas were mangled by yours truly into the arcane forms you see here to squeeze out the best assembly possible on most of the modern architectures (x86 and ARM were evaluated in practice). I mean, just look at it: *one actual* modulo operation and everything else is just the cheap single cycle ops! Admitedly, the naive solution might be faster in some common scenarios, but this code absolutely butchers the naive solution on the worst case scenario. Alas, the result of this arcane magic also means that the code pretty heavily relies on the preconditions holding true and breaking those preconditions will unleash the UB-est of all UBs! So don’t.
2018-05-17Use EverInit instead of MaybeInit to determine initializationKeith Yeung-0/+25
2018-05-17Rename trans to codegen everywhere.Irina Popa-25/+25
2018-05-17Make sure the float comparison output is consistent with the expectedkennytm-0/+65
behavior when NaN is involved.
2018-05-17Auto merge of #50807 - kennytm:rollup, r=kennytmbors-6/+15
Rollup of 17 pull requests Successful merges: - #50170 (Implement From for more types on Cow) - #50638 (Don't unconditionally set CLOEXEC twice on every fd we open on Linux) - #50656 (Fix `fn main() -> impl Trait` for non-`Termination` trait) - #50669 (rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`) - #50726 (read2: Use inner function instead of closure) - #50728 (Fix rustdoc panic with `impl Trait` in type parameters) - #50736 (env: remove unwrap in examples in favor of try op) - #50740 (Remove LazyBTreeMap.) - #50752 (Add missing error codes in libsyntax-ext asm) - #50779 (Make mutable_noalias and arg_align_attributes be tracked) - #50787 (Fix run-make wasm tests) - #50788 (Fix an ICE when casting a nonexistent const) - #50789 (Ensure libraries built in stage0 have unique metadata) - #50793 (tidy: Add a check for empty UI test files) - #50797 (fix a typo in signed-integer::from_str_radix()) - #50808 (Stabilize num::NonZeroU*) - #50809 (GitHub: Stop treating Cargo.lock as a generated file.) Failed merges:
2018-05-17Rollup merge of #50808 - SimonSapin:nonzero, r=alexcrichtonkennytm-6/+2
Stabilize num::NonZeroU* Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-17Rollup merge of #50793 - jrlusby:master, r=petrochenkovkennytm-0/+123
tidy: Add a check for empty UI test files Check for empty `.stderr` and `.stdout` files in UI test directories. Empty files could still pass testing for `compile-pass` tests with no output so they can get into the repo accidentally, but they are not necessary and can be removed. This is very much an in progress pull request. I'm having an issue with rustfmt. It wanted to reformat the entire file for almost every file by default. And when I run tidy it just errors out because it catches the empty files that are already in the repo. My next step is goin got be to remove those empty file and see if running tidy again will actually reformat things outside of the context of `cargo fmt` Fixes https://github.com/rust-lang/rust/issues/50785
2018-05-16Auto merge of #50710 - Zoxc:value_to_constvalue, r=oli-obkbors-0/+21
Fix conversion from Miri Value to ConstValue This fixes an error compiling the `immeta` 0.3.6 crate. https://github.com/rust-lang/rust/issues/50707 may be fixed too. r? @oli-obk
2018-05-16Stabilize num::NonZeroU*Simon Sapin-3/+0
Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-16Make core::nonzero privateSimon Sapin-4/+3
It is now an implementation detail of ptr::NonNull and num::NonZero*
2018-05-16Rollup merge of #50656 - leodasvacas:fix-impl-trait-in-main-ret, r=nikomatsakiskennytm-0/+13
Fix `fn main() -> impl Trait` for non-`Termination` trait Fixes #50595. This bug currently affects stable. Why I think we can go for hard error: - It will in stable for at most one cycle and there is no legitimate reason to abuse it, nor any known uses in the wild. - It only affects `bin` crates (which have a `main`), so there is little practical difference between a hard error or a deny lint, both are a one line fix. The fix was to just unshadow a variable. Thanks @nikomatsakis for the mentoring! r? @nikomatsakis
2018-05-16rustc_mir: allow promotion of promotable temps indexed at runtime.Eduard-Mihai Burtescu-1/+27
2018-05-16Add feature gate label_break_valueest31-0/+2
2018-05-16Add a file with test casesest31-0/+121
2018-05-16rustc_mir: also promote interior borrows, not just whole temps.Eduard-Mihai Burtescu-0/+30