about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2017-11-26Auto merge of #46106 - est31:master, r=nikomatsakisbors-320/+194
Add a MIR-borrowck-only output mode Removes the `-Z borrowck-mir` flag in favour of a `-Z borrowck=mode` flag where mode can be `mir`, `ast`, or `compare`. * The `ast` mode represents the current default, passing `-Z borrowck=ast` is equivalent to not passing it at all. * The `compare` mode outputs both the output of the MIR borrow checker and the AST borrow checker, each error with `(Ast)` and `(Mir)` appended. This mode has the same behaviour as `-Z borrowck-mir` had before this commit. * The `mir` mode only outputs the results of the MIR borrow checker, while suppressing the errors of the ast borrow checker The PR also updates the tests to use the new flags. closes #46097
2017-11-26Auto merge of #46253 - eddyb:return-aliasing, r=nagisabors-0/+23
rustc_trans: don't apply noalias on returned references. In #45225 frozen returned `&T` were accidentally maked `noalias`, unlike `&mut T`. Return value `noalias` is only sound for functions that return dynamic allocations, e.g. `Box`, and using it on anything else can lead to miscompilation, as LLVM assumes certain usage patterns. Fixes #46239.
2017-11-26Update tests for -Zborrowck-mir -> -Zborrowck=mode migrationest31-320/+194
2017-11-26Auto merge of #46100 - KiChjang:mass-dead-check, r=nikomatsakisbors-0/+64
Kill the storage for all locals on returning terminators Fixes #45704.
2017-11-26Rollup merge of #46264 - scottmcm:mir-array-len, r=arielb1kennytm-0/+33
InstCombine Len([_; N]) => const N in MIR A small opportunity I noticed in passing. Not super exciting on its own, but opens the door for a const propagation pass that could completely remove const bounds checks from arrays at MIR time, for example.
2017-11-26Auto merge of #46033 - sinkuu:const-enum-match-check, r=arielb1bors-0/+44
Do match-check for consts Fixes #43195 (ICE caused by building MIR that contains non-exausitive match)
2017-11-26Auto merge of #45947 - estebank:match_default_bindings-arg-hint, r=arielb1bors-1/+32
Be more obvious when suggesting dereference Include `&` span when suggesting dereference on a span that is already a reference: ``` error: non-reference pattern used to match a reference (see issue #42640) --> dont-suggest-dereference-on-arg.rs:16:19 | 16 | .filter(|&(ref a, _)| foo(a)) | ^^^^^^^^^^^ help: consider using: `&&(ref k, _)` | = help: add #![feature(match_default_bindings)] to the crate attributes to enable ``` Fix #45925.
2017-11-25Disable region-liveness-drop-no-may-dangle.rsKeith Yeung-0/+1
2017-11-25InstCombine Len([_; N]) => const N in MIRScott McMurray-0/+33
2017-11-25rustc: Add support for some more x86 SIMD opsAlex Crichton-0/+53
This commit adds compiler support for two basic operations needed for binding SIMD on x86 platforms: * First, a `nontemporal_store` intrinsic was added for the `_mm_stream_ps`, seen in rust-lang-nursery/stdsimd#114. This was relatively straightforward and is quite similar to the volatile store intrinsic. * Next, and much more intrusively, a new type to the backend was added. The `x86_mmx` type is used in LLVM for a 64-bit vector register and is used in various intrinsics like `_mm_abs_pi8` as seen in rust-lang-nursery/stdsimd#74. This new type was added as a new layout option as well as having support added to the trans backend. The type is enabled with the `#[repr(x86_mmx)]` attribute which is intended to just be an implementation detail of SIMD in Rust. I'm not 100% certain about how the `x86_mmx` type was added, so any extra eyes or thoughts on that would be greatly appreciated!
2017-11-25Fix testEsteban Küber-2/+5
2017-11-25rustc_trans: don't apply noalias on returned references.Eduard-Mihai Burtescu-0/+23
2017-11-25Auto merge of #46129 - kennytm:fix-46098-rustdoc-reexport-extern-type, ↵bors-0/+66
r=GuillaumeGomez Properly handle reexport of foreign items. Handles `pub use` of `extern { fn, static, type }`. Also plug in some more `match` arms where handling `extern type` is reasonable. Fixed #46098.
2017-11-25Auto merge of #46008 - alexcrichton:update-llvm, r=Mark-Simulacrumbors-1/+51
rustbuild: Update LLVM and enable ThinLTO This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also opportunistically enables ThinLTO for libstd which was previously blocked (#45661) on test failures related to debuginfo with a presumed cause of #45511. Closes #45511
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-24Kill the storage for all locals on returning terminatorsKeith Yeung-0/+63
2017-11-24Use `get_parent_node` instead of using spansEsteban Küber-3/+3
2017-11-24Be more obvious when suggesting dereferenceEsteban Küber-0/+28
Include enclosing span when suggesting dereference on a span that is already a reference: ``` error: non-reference pattern used to match a reference (see issue #42640) --> dont-suggest-dereference-on-arg.rs:16:19 | 16 | .filter(|&(ref a, _)| foo(a)) | ^^^^^^^^^^^ help: consider using: `&&(ref k, _)` | = help: add #![feature(match_default_bindings)] to the crate attributes to enable ```
2017-11-24Auto merge of #46093 - scottmcm:lower-128-mir, r=nagisabors-0/+253
Add a MIR pass to lower 128-bit operators to lang item calls Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet. This isn't really useful on its own, but the declarations for the lang items need to be in the compiler before compiler-builtins can be updated to define them, so this is part 1 of at least 3. cc https://github.com/rust-lang/rust/issues/45676 @est31 @nagisa
2017-11-24rustbuild: Update LLVM and enable ThinLTOAlex Crichton-1/+10
This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also opportunistically enables ThinLTO for libstd which was previously blocked (#45661) on test failures related to debuginfo with a presumed cause of #45511. Closes #45511
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-2098/+2162
2017-11-24Auto merge of #45946 - estebank:crate-conflict-diag, r=arielb1bors-19/+10
Use multiline text for crate conflict diagnostics After: ``` error[E0464]: multiple matching crates for `libc` --> /checkout/src/rustc/dlmalloc_shim/../../dlmalloc/src/linux.rs:1:1 | 1 | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidates: crate `libc`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-658d35794c10b003.rlib crate `libc`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f32a17a3111b01aa.rlib ``` Before: ``` error[E0464]: multiple matching crates for `libc` --> /checkout/src/rustc/dlmalloc_shim/../../dlmalloc/src/linux.rs:1:1 | 1 | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidates: = note: path: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-658d35794c10b003.rlib = note: crate name: libc = note: path: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f32a17a3111b01aa.rlib = note: crate name: libc ```
2017-11-24Add testShotaro Yamada-0/+44
2017-11-24Auto merge of #45942 - Menschenkindlein:master, r=estebankbors-0/+59
Add hints for the case of confusing enum with its variants A solution for https://github.com/rust-lang/rust/issues/43871. When one uses an enum in a place that accepts variants (e.g., `Option(result)` instead of `Some(result)`), suggest one of this enum's variants. cc @estebank
2017-11-23Rollup merge of #45635 - virgil-palanciuc:master, r=kennytmGuillaume Gomez-0/+39
Add test for #44953 Added the requested test - trying to see if it passes; my local build fails, but not sure why - the nightly shows this output, but in my build the compilation error changed. Fixes #44953.
2017-11-23Auto merge of #46087 - vramana:fix-46003, r=arielb1bors-2/+13
Fix borrowck compiler errors for upvars contain "spurious" dereferences Fixes #46003
2017-11-23Fix borrowck compiler errors for upvars contain "spurious" dereferencesRamana Venkata-2/+13
Fixes #46003
2017-11-23Add module population and case of enum in place of expressionMaxim Zholobak-6/+25
2017-11-23Auto merge of #46054 - nikomatsakis:nll-master-to-rust-master-1, r=arielb1bors-0/+27
typeck aggregate rvalues in MIR type checker This branch is an attempt to land content by @spastorino and @Nashenas88 that was initially landed on nll-master while we waited for https://github.com/rust-lang/rust/pull/45825 to land. The biggest change it contains is that it extends the MIR type-checker to also type-check MIR aggregate rvalues (at least partially). Specifically, it checks that the operands provided for each field have the right type. It does not yet check that their well-formedness predicates are met. That is https://github.com/rust-lang/rust/issues/45827. It also does not check other kinds of rvalues (that is https://github.com/rust-lang/rust/issues/45959). @spastorino is working on those issues now. r? @arielb1
2017-11-23Auto merge of #46051 - cramertj:in-band-lifetimes, r=nikomatsakisbors-4/+625
Implement in-band lifetime bindings TODO (perhaps in a future PR): Should we ban explicit instantiation of generics with in-band lifetimes, or is it uncontroversial to just append them to the end of the lifetimes list? Fixes #46042, cc #44524. r? @nikomatsakis
2017-11-23Auto merge of #46024 - estebank:no-variant, r=petrochenkovbors-11/+102
Use the proper term when using non-existing variant When using a non-existing variant, function or associated item, refer to the proper term, instead of defaulting to "associated item" in diagnostics. Fix #28972. ``` error[E0599]: no variant named `Quux` found for type `Foo` in the current scope --> file.rs:7:9 | 7 | Foo::Quux(..) =>(), | ^^^^^^^^^^^^^ ```
2017-11-22Use multiline text for crate conflict diagnosticsEsteban Küber-19/+10
2017-11-22Add test to new branchesEsteban Küber-0/+15
2017-11-23Auto merge of #45721 - nikomatsakis:hir-tree, r=arielb1bors-0/+22
add -Zunpretty=hir-tree This uses the debug impls to dump the raw HIR. Particularly useful when learning how the compiler works. cc @qmx
2017-11-22add some tests for the interaction with existential impl traitNiko Matsakis-1/+21
2017-11-22modify inherent impls test to indicate `TypeckTables` do not changeNiko Matsakis-4/+40
I also added some comments explaining what is going on. In short, the changes in question do not, in fact, affect the`TypeckTables` in any semantic way. However, altering the order of lowering can cause it appear to affect the `TypeckTables`: if we lower generics before the body, then the `HirId` for things in the body will be affected. In this case, we are now lowering the generics etc *after* the body, so the hash no longer changes. This seems good.
2017-11-22Implement in-band lifetime bindingsTaylor Cramer-0/+565
2017-11-22Auto merge of #46035 - oli-obk:use_suggestions, r=petrochenkovbors-22/+43
Add structured suggestions for various "use" suggestions r? @petrochenkov
2017-11-22Auto merge of #45198 - oli-obk:fmt_args, r=sfacklerbors-0/+54
Prevent fmt::Arguments from being shared across threads Fixes #45197 This is a **breaking change**! Without doing this it's very easy to create race conditions. There's probably a way to do this without breaking valid use cases, but it would require quite an overhaul of the formatting machinery.
2017-11-22Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomezbors-0/+94
rustdoc: include external files in documentation (RFC 1990) Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR) cc #44732 Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-22Remove attributes and test comments accidentally left behind, add in ↵Paul Daniel Faria-2/+0
span_mirbugs
2017-11-22Fix failing testPaul Daniel Faria-3/+9
2017-11-22Check rvalue aggregates during check_stmt in tycheck, add initial, (not ↵Paul Daniel Faria-0/+23
passing) test
2017-11-22Auto merge of #46040 - zilbuz:mir-misc, r=nikomatsakisbors-13/+13
MIR-borrowck: Some minor fixes - Remove parens when printing dereference (fix #45185) - Change argument type of `autoderef` to `bool` - Change argument type of `field_index` to `Field`
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-25/+119
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-21allow loading external files in documentationQuietMisdreavus-0/+94
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-21Add test for #44953Virgil Palanciuc-0/+39
2017-11-22Rollup merge of #46157 - martinlindhe:master, r=kennytmkennytm-1/+1
fix some typos This is the result of me testing out a WIP source code typo-finder and your project was the random target this time.
2017-11-22Rollup merge of #46134 - GuillaumeGomez:negative-traits, r=QuietMisdreavuskennytm-0/+19
Display negative traits implementation Fixes #45816. r? @QuietMisdreavus
2017-11-22Rollup merge of #46120 - arielb1:def-debug, r=michaelwoeristerkennytm-10/+10
clean the Debug impl for CrateNum and DefId Just a tiny quality-of-life improvement because I got tired of noisy debug logs. ``` before: DefId { krate: CrateNum(11), index: DefIndex(0:6) => foo[8787]::Mapper[0]::OtherType[0] } } after: {crate11:0:6 ~ foo[8787]::Mapper[0]::OtherType[0]}) ``` r? @michaelwoerister