Commit Graph

70383 Commits

Author SHA1 Message Date
colinmarsh19
477989933d
UI test 46186 2017-11-25 19:26:47 -07:00
colinmarsh19
3e8883e2aa
Changed from note to span_suggestion_short 2017-11-25 18:34:20 -07:00
bors
693bb0dae2 Auto merge of #45947 - estebank:match_default_bindings-arg-hint, r=arielb1
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-26 01:05:56 +00:00
John-John Tedro
4e4f8ab712 Check tail node in check_links 2017-11-26 00:30:33 +01:00
bors
128b40fadc Auto merge of #45367 - alexcrichton:simd-llvm-changes, r=eddyb
rustc: Add support for some more x86 SIMD ops

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-25 22:38:47 +00:00
Keith Yeung
efa3ed216e Disable region-liveness-drop-no-may-dangle.rs 2017-11-25 13:57:51 -08:00
Ariel Ben-Yehuda
ebd219ab8e comments 2017-11-25 22:57:59 +02:00
Ariel Ben-Yehuda
d049e5d19e 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.
2017-11-25 22:57:59 +02:00
John-John Tedro
60aa8347f5 Implement LinkedList::drain_filter
Relates to rust-lang/rfcs#2140 - drain_filter for all collections

`drain_filter` is implemented instead of `LinkedList::remove_if` based
on review feedback.
2017-11-25 21:28:49 +01:00
John-John Tedro
de41d84ddf Introduce LinkedList::remove_if 2017-11-25 21:15:03 +01:00
Scott McMurray
62391c8c86 InstCombine Len([_; N]) => const N in MIR 2017-11-25 11:59:16 -08:00
Alex Crichton
fe53a8106d rustc: Add support for some more x86 SIMD ops
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-25 11:03:13 -08:00
bors
e97ba83287 Auto merge of #46115 - alexcrichton:add-wasm-target, r=kennytm
rustbuild: Enable WebAssembly backend by default

This commit alters how we compile LLVM by default enabling the WebAssembly
backend. This then also adds the wasm32-unknown-unknown target to get compiled
on the `cross` builder and distributed through rustup. Tests are not yet enabled
for this target but that should hopefully be coming soon!
2017-11-25 19:00:45 +00:00
Esteban Küber
15dfd7eb61 Fix test 2017-11-25 10:15:36 -08:00
Esteban Küber
cf9283ea93 Fix proc_macro output with struct parse error 2017-11-25 10:13:15 -08:00
bjorn3
0854bfbac9
Derive Debug for LangItem 2017-11-25 17:33:47 +01:00
colinmarsh19
8e60f720fb
Added ; 2017-11-25 09:06:06 -07:00
Esteban Küber
97d8d04f3f Remove index type check (review comment) 2017-11-25 07:50:27 -08:00
colinmarsh19
306f4da69a
Fixed Err by passing "err" 2017-11-25 08:47:05 -07:00
colinmarsh19
ba40f5c4ef
Test for issue #46186 2017-11-25 08:40:42 -07:00
colinmarsh19
aabacf791a
Remove semicolon note
Added note that specifies a semicolon should be removed after a given struct
2017-11-25 08:38:30 -07:00
Alex Crichton
48996f9e75 rustbuild: Enable WebAssembly backend by default
This commit alters how we compile LLVM by default enabling the WebAssembly
backend. This then also adds the wasm32-unknown-unknown target to get compiled
on the `cross` builder and distributed through rustup. Tests are not yet enabled
for this target but that should hopefully be coming soon!
2017-11-25 06:44:35 -08:00
bors
2f47a9eb80 Auto merge of #46191 - eddyb:better-late-than-never, r=nikomatsakis
rustc: don't mark lifetimes as early-bound in the presence of impl Trait.

This hack from the original implementation shouldn't be needed anymore, thanks to @cramertj.

r? @nikomatsakis
2017-11-25 14:28:20 +00:00
Shotaro Yamada
62cb74af3c Conform names 2017-11-25 23:27:16 +09:00
Esteban Küber
0e241d0059 Add inline compile-fail markers to tests 2017-11-25 06:26:46 -08:00
Esteban Küber
cde0023b5b Add compile-fail style comments to tests 2017-11-25 06:19:39 -08:00
Esteban Küber
fa6ae4c828 Suggest using slice when encountering let x = ""[..]; 2017-11-25 06:08:30 -08:00
Eduard-Mihai Burtescu
5eed95ede9 rustc_trans: don't apply noalias on returned references. 2017-11-25 14:30:45 +02:00
Basile Desloges
513910e321 Update MSVC compilation instructions regarding path length on Windows 2017-11-25 11:38:10 +01:00
bors
cc6b88ccb2 Auto merge of #46129 - kennytm:fix-46098-rustdoc-reexport-extern-type, 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-25 08:38:42 +00:00
bors
59bf09d4d4 Auto merge of #46117 - SimonSapin:min-align, r=alexcrichton
allocators: don’t assume MIN_ALIGN for small sizes

See individual commit messages.
2017-11-25 06:16:19 +00:00
bors
ca8ef26293 Auto merge of #46081 - GuillaumeGomez:fix-path-search, r=QuietMisdreavus
Fix path search

Fixes #46015.

r? @QuietMisdreavus
2017-11-25 02:43:48 +00:00
bors
db162922f7 Auto merge of #46008 - alexcrichton:update-llvm, r=Mark-Simulacrum
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-25 00:17:03 +00:00
Alex Crichton
95e9609b9d std: Flag Windows TLS dtor symbol as #[used]
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-24 14:28:12 -08:00
bors
a550f2d3b3 Auto merge of #46111 - michaelwoerister:promote-green, r=nikomatsakis
incr.comp.: Make sure we don't lose unused green results from the query cache.

In its current implementation, the query result cache works by bulk-writing the results of all cacheable queries into a monolithic binary file on disk. Prior to this PR, we would potentially lose query results during this process because only results that had already been loaded into memory were serialized. In contrast, results that were not needed during the given compilation session were not serialized again.

This PR will do one pass over all green `DepNodes` that represent a cacheable query and execute the corresponding query in order to make sure that the query result gets loaded into memory before cache serialization.

In the future we might want to look into a serialization format the can be updated in-place so that we don't have to load unchanged results just for immediately storing them again.

r? @nikomatsakis
2017-11-24 21:50:09 +00:00
Keith Yeung
0996bb0901 Kill the storage for all locals on returning terminators 2017-11-24 12:00:59 -08:00
Simon Sapin
5962d7e007 Expand docs of <$Int>::from_str_radix, based on that of char::to_digit 2017-11-24 19:16:32 +01:00
Esteban Küber
f103342b8f Consume trailing doc comments to avoid parse errors 2017-11-24 08:32:01 -08:00
Esteban Küber
2461b7a264 Use get_parent_node instead of using spans 2017-11-24 08:26:45 -08:00
Esteban Küber
7c2526a9d7 Be more obvious when suggesting dereference
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-24 08:26:01 -08:00
Esteban Küber
0e93b75d27 Revert to correct recovery behavior 2017-11-24 07:34:33 -08:00
Esteban Küber
4e2d1b9466 Emit DocComment in bad location error but continue parsing struct fields 2017-11-24 07:34:32 -08:00
Esteban Küber
df357b20be Suggest macro call when not sure that it is fn definition 2017-11-24 07:34:32 -08:00
Esteban Küber
c82e9e8e1e Do not attemt to continue parsing after pub ident
Try to identify the following code in order to provide better
diagnostics, but return the error to bail out early during the parse.
2017-11-24 07:34:32 -08:00
Esteban Küber
7c0387e36a Do not rewind parser and ignore following blocks
When encountering `pub ident`, attempt to identify the code that comes
afterwards, wether it is a brace block (assume it is a struct), a paren
list followed by a colon (assume struct) or a paren list followed by a
block (assume a fn). Consume those blocks to avoid any further parser
errors and return a `Placeholder` item in order to allow the parser to
continue. In the case of unenclosed blocks, the behavior is the same as
it is currently: no further errors are processed.
2017-11-24 07:34:31 -08:00
Esteban Küber
547873aa54 Account for missing keyword in fn/struct definition 2017-11-24 07:34:31 -08:00
Esteban Küber
1737d69c3b Fix underline in suggestions 2017-11-24 07:34:31 -08:00
bors
5f44c653cf Auto merge of #46093 - scottmcm:lower-128-mir, r=nagisa
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-24 15:11:11 +00:00
Corey Farwell
1ad38f2ce5 Improve documentation for slice swap/copy/clone operations.
Fixes #45636.

- Demonstrate how to use these operations with slices of differing
  lengths
- Demonstrate how to swap/copy/clone sub-slices of a slice using
  `split_at_mut`
2017-11-24 07:09:05 -08:00
Alex Crichton
47498dea09 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-24 06:55:38 -08:00