]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoUpdate libc to include latest Fuchsia fix
Taylor Cramer [Mon, 27 Nov 2017 01:01:15 +0000 (17:01 -0800)]
Update libc to include latest Fuchsia fix

6 years agoAuto merge of #46168 - durka:macro-backtrace, r=durka
bors [Sun, 26 Nov 2017 21:30:28 +0000 (21:30 +0000)]
Auto merge of #46168 - durka:macro-backtrace, r=durka

mention nightly in -Z external-macro-backtrace note

Fix #46167 by mentioning that you need nightly in the message that tells you to pass `-Z external-macro-backtrace`.

Rationale:

1. The reason for having this message is to increase discoverability of the functionality. If the message is only shown on nightly it's less disoverable.
2. The same approach is taken if you call a const fn in const context without its feature gate (previously, if you called it without `#![feature(const_fn)]`).

cc @kennytm

6 years agoAuto merge of #46106 - est31:master, r=nikomatsakis
bors [Sun, 26 Nov 2017 19:03:57 +0000 (19:03 +0000)]
Auto merge of #46106 - est31:master, r=nikomatsakis

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

6 years agomention nightly in -Z external-macro-backtrace note
Alex Burka [Tue, 21 Nov 2017 19:48:35 +0000 (19:48 +0000)]
mention nightly in -Z external-macro-backtrace note

6 years agoAuto merge of #46253 - eddyb:return-aliasing, r=nagisa
bors [Sun, 26 Nov 2017 16:38:36 +0000 (16:38 +0000)]
Auto merge of #46253 - eddyb:return-aliasing, r=nagisa

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.

6 years agoUse the official abbrev.
est31 [Sun, 26 Nov 2017 15:59:47 +0000 (16:59 +0100)]
Use the official abbrev.

6 years agoUpdate tests for -Zborrowck-mir -> -Zborrowck=mode migration
est31 [Sun, 19 Nov 2017 22:37:59 +0000 (23:37 +0100)]
Update tests for -Zborrowck-mir -> -Zborrowck=mode migration

6 years agoReplace -Zborrowck-mir with -Zborrowck=mode
est31 [Sun, 19 Nov 2017 22:35:53 +0000 (23:35 +0100)]
Replace -Zborrowck-mir with -Zborrowck=mode

where mode is one of {ast,mir,compare}.

This commit only implements the functionality.
The tests will be updated in a follow up commit.

6 years agoAuto merge of #46203 - nikomatsakis:type-foldable-macro, r=eddyb
bors [Sun, 26 Nov 2017 14:10:38 +0000 (14:10 +0000)]
Auto merge of #46203 - nikomatsakis:type-foldable-macro, r=eddyb

introduce macros for type-foldable and lift, convert stuff to use them

A random commit from a branch I've shelved for the time being that made `TypeFoldable` stuff a bit less annoying to write.

r? @eddyb

6 years agoAuto merge of #46100 - KiChjang:mass-dead-check, r=nikomatsakis
bors [Sun, 26 Nov 2017 11:43:19 +0000 (11:43 +0000)]
Auto merge of #46100 - KiChjang:mass-dead-check, r=nikomatsakis

Kill the storage for all locals on returning terminators

Fixes #45704.

6 years agoAuto merge of #46272 - kennytm:rollup, r=kennytm
bors [Sun, 26 Nov 2017 09:15:06 +0000 (09:15 +0000)]
Auto merge of #46272 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #46201, #46224, #46234, #46252, #46259, #46264, #46269
- Failed merges:

6 years agoRollup merge of #46269 - udoprog:check-links, r=KodrAus
kennytm [Sun, 26 Nov 2017 07:01:40 +0000 (15:01 +0800)]
Rollup merge of #46269 - udoprog:check-links, r=KodrAus

Check tail node in check_links

6 years agoRollup merge of #46264 - scottmcm:mir-array-len, r=arielb1
kennytm [Sun, 26 Nov 2017 07:01:39 +0000 (15:01 +0800)]
Rollup merge of #46264 - scottmcm:mir-array-len, r=arielb1

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.

6 years agoRollup merge of #46259 - bjorn3:display_lang_item, r=nagisa
kennytm [Sun, 26 Nov 2017 07:01:38 +0000 (15:01 +0800)]
Rollup merge of #46259 - bjorn3:display_lang_item, r=nagisa

Derive Debug for LangItem

6 years agoRollup merge of #46252 - zilbuz:msvc-doc, r=kennytm
kennytm [Sun, 26 Nov 2017 07:01:37 +0000 (15:01 +0800)]
Rollup merge of #46252 - zilbuz:msvc-doc, r=kennytm

Update MSVC compilation instructions regarding path length on Windows

Fix #46214

6 years agoRollup merge of #46234 - lucasem:core-marker-typo, r=frewsxcv
kennytm [Sun, 26 Nov 2017 07:01:36 +0000 (15:01 +0800)]
Rollup merge of #46234 - lucasem:core-marker-typo, r=frewsxcv

core::marker fix typo

6 years agoRollup merge of #46224 - GuillaumeGomez:io-missing-link, r=QuietMisdreavus
kennytm [Sun, 26 Nov 2017 07:01:35 +0000 (15:01 +0800)]
Rollup merge of #46224 - GuillaumeGomez:io-missing-link, r=QuietMisdreavus

Remove invalid doc link

r? @rust-lang/docs

6 years agoRollup merge of #46201 - davidalber:eprint-in-fmt-doc, r=frewsxcv
kennytm [Sun, 26 Nov 2017 07:01:34 +0000 (15:01 +0800)]
Rollup merge of #46201 - davidalber:eprint-in-fmt-doc, r=frewsxcv

Adding `eprint*!` to the list of macros in the `format!` family

The `eprint!` and `eprintln!` macros were added in 7612727. The `std::fmt` documentation does not mention these macros next to `print!` and `println!` in the [Related macros](https://doc.rust-lang.org/std/fmt/#related-macros) section, and I did not find evidence that this omission was deliberate. This PR adds such documentation.

The first modification is to add `eprint!` and `eprintln!` to the list of related macros in the `format!` family. This is how it appears with this change:

![image](https://user-images.githubusercontent.com/933552/33159527-67056caa-cfc8-11e7-8b7d-4224ef2fce4e.png)

The second modification adds a sub-section for `eprint!` and `eprintln!`. Here is how the new section appears:

![image](https://user-images.githubusercontent.com/933552/33159541-97d03bee-cfc8-11e7-8b95-4d3632b5ab7b.png)

6 years agoAuto merge of #45990 - murarth:rc-from-strs, r=alexcrichton
bors [Sun, 26 Nov 2017 06:49:43 +0000 (06:49 +0000)]
Auto merge of #45990 - murarth:rc-from-strs, r=alexcrichton

Implement `Rc`/`Arc` conversions for string-like types

Provides the following conversion implementations:

* `From<`{`CString`,`&CStr`}`>` for {`Arc`,`Rc`}`<CStr>`
* `From<`{`OsString`,`&OsStr`}`>` for {`Arc`,`Rc`}`<OsStr>`
* `From<`{`PathBuf`,`&Path`}`>` for {`Arc`,`Rc`}`<Path>`

Closes #45008

6 years agoImplement `Rc`/`Arc` conversions for string-like types
Murarth [Tue, 14 Nov 2017 19:31:07 +0000 (12:31 -0700)]
Implement `Rc`/`Arc` conversions for string-like types

Provides the following conversion implementations:

* `From<`{`CString`,`&CStr`}`>` for {`Arc`,`Rc`}`<CStr>`
* `From<`{`OsString`,`&OsStr`}`>` for {`Arc`,`Rc`}`<OsStr>`
* `From<`{`PathBuf`,`&Path`}`>` for {`Arc`,`Rc`}`<Path>`

6 years agoAuto merge of #46033 - sinkuu:const-enum-match-check, r=arielb1
bors [Sun, 26 Nov 2017 04:26:19 +0000 (04:26 +0000)]
Auto merge of #46033 - sinkuu:const-enum-match-check, r=arielb1

Do match-check for consts

Fixes #43195 (ICE caused by building MIR that contains non-exausitive match)

6 years agoAuto merge of #45947 - estebank:match_default_bindings-arg-hint, r=arielb1
bors [Sun, 26 Nov 2017 01:05:56 +0000 (01:05 +0000)]
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.

6 years agoCheck tail node in check_links
John-John Tedro [Sat, 25 Nov 2017 23:30:33 +0000 (00:30 +0100)]
Check tail node in check_links

6 years agoAuto merge of #45367 - alexcrichton:simd-llvm-changes, r=eddyb
bors [Sat, 25 Nov 2017 22:38:47 +0000 (22:38 +0000)]
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!

6 years agoDisable region-liveness-drop-no-may-dangle.rs
Keith Yeung [Sat, 25 Nov 2017 21:57:51 +0000 (13:57 -0800)]
Disable region-liveness-drop-no-may-dangle.rs

6 years agoInstCombine Len([_; N]) => const N in MIR
Scott McMurray [Sat, 25 Nov 2017 19:59:16 +0000 (11:59 -0800)]
InstCombine Len([_; N]) => const N in MIR

6 years agorustc: Add support for some more x86 SIMD ops
Alex Crichton [Wed, 18 Oct 2017 17:30:29 +0000 (10:30 -0700)]
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!

6 years agoAuto merge of #46115 - alexcrichton:add-wasm-target, r=kennytm
bors [Sat, 25 Nov 2017 19:00:45 +0000 (19:00 +0000)]
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!

6 years agoFix test
Esteban Küber [Fri, 24 Nov 2017 16:27:33 +0000 (08:27 -0800)]
Fix test

6 years agoDerive Debug for LangItem
bjorn3 [Sat, 25 Nov 2017 16:33:47 +0000 (17:33 +0100)]
Derive Debug for LangItem

6 years agorustbuild: Enable WebAssembly backend by default
Alex Crichton [Mon, 20 Nov 2017 14:22:17 +0000 (06:22 -0800)]
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!

6 years agoAuto merge of #46191 - eddyb:better-late-than-never, r=nikomatsakis
bors [Sat, 25 Nov 2017 14:28:20 +0000 (14:28 +0000)]
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

6 years agoConform names
Shotaro Yamada [Fri, 24 Nov 2017 09:50:17 +0000 (18:50 +0900)]
Conform names

6 years agorustc_trans: don't apply noalias on returned references.
Eduard-Mihai Burtescu [Sat, 25 Nov 2017 12:08:59 +0000 (14:08 +0200)]
rustc_trans: don't apply noalias on returned references.

6 years agoUpdate MSVC compilation instructions regarding path length on Windows
Basile Desloges [Sat, 25 Nov 2017 10:38:10 +0000 (11:38 +0100)]
Update MSVC compilation instructions regarding path length on Windows

6 years agoAuto merge of #46129 - kennytm:fix-46098-rustdoc-reexport-extern-type, r=GuillaumeGomez
bors [Sat, 25 Nov 2017 08:38:42 +0000 (08:38 +0000)]
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.

6 years agoAuto merge of #46117 - SimonSapin:min-align, r=alexcrichton
bors [Sat, 25 Nov 2017 06:16:19 +0000 (06:16 +0000)]
Auto merge of #46117 - SimonSapin:min-align, r=alexcrichton

allocators: don’t assume MIN_ALIGN for small sizes

See individual commit messages.

6 years agoAuto merge of #46081 - GuillaumeGomez:fix-path-search, r=QuietMisdreavus
bors [Sat, 25 Nov 2017 02:43:48 +0000 (02:43 +0000)]
Auto merge of #46081 - GuillaumeGomez:fix-path-search, r=QuietMisdreavus

Fix path search

Fixes #46015.

r? @QuietMisdreavus

6 years agoAuto merge of #46008 - alexcrichton:update-llvm, r=Mark-Simulacrum
bors [Sat, 25 Nov 2017 00:17:03 +0000 (00:17 +0000)]
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

6 years agostd: Flag Windows TLS dtor symbol as #[used]
Alex Crichton [Fri, 24 Nov 2017 17:18:22 +0000 (09:18 -0800)]
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.

6 years agoAuto merge of #46111 - michaelwoerister:promote-green, r=nikomatsakis
bors [Fri, 24 Nov 2017 21:50:09 +0000 (21:50 +0000)]
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

6 years agoKill the storage for all locals on returning terminators
Keith Yeung [Sun, 19 Nov 2017 12:26:23 +0000 (04:26 -0800)]
Kill the storage for all locals on returning terminators

6 years agoUse `get_parent_node` instead of using spans
Esteban Küber [Thu, 23 Nov 2017 17:58:51 +0000 (09:58 -0800)]
Use `get_parent_node` instead of using spans

6 years agoBe more obvious when suggesting dereference
Esteban Küber [Sun, 12 Nov 2017 22:18:47 +0000 (14:18 -0800)]
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
```

6 years agoAuto merge of #46093 - scottmcm:lower-128-mir, r=nagisa
bors [Fri, 24 Nov 2017 15:11:11 +0000 (15:11 +0000)]
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

6 years agorustbuild: Update LLVM and enable ThinLTO
Alex Crichton [Wed, 15 Nov 2017 13:16:23 +0000 (05:16 -0800)]
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

6 years agoAuto merge of #46116 - oli-obk:json_ui, r=nikomatsakis
bors [Fri, 24 Nov 2017 12:38:11 +0000 (12:38 +0000)]
Auto merge of #46116 - oli-obk:json_ui, r=nikomatsakis

Check //~ERROR comments in ui tests

r? @nikomatsakis

cc #44844 @Phlosioneer @estebank @petrochenkov

this depends on https://github.com/rust-lang/rust/pull/46052 getting merged first (the commits are included in here)

The relevant changes of this PR are c2f0af7 and 979269b

6 years agoMerge cfail and ui tests into ui tests
Oliver Schneider [Mon, 20 Nov 2017 12:13:27 +0000 (13:13 +0100)]
Merge cfail and ui tests into ui tests

6 years agoAuto merge of #46012 - Gankro:float-conv-transmute, r=sfackler
bors [Fri, 24 Nov 2017 10:06:09 +0000 (10:06 +0000)]
Auto merge of #46012 - Gankro:float-conv-transmute, r=sfackler

Make float::from_bits transmute

See commit message for details.

See also this discussion here: https://github.com/rust-lang/rust/issues/40470#issuecomment-343803381

(may require libs team discussion before merging)

6 years agocore::marker fix typo
Lucas Morales [Fri, 24 Nov 2017 09:04:57 +0000 (03:04 -0600)]
core::marker fix typo

6 years agoUI tests extract the regular output from the 'rendered' field in json
Oliver Schneider [Mon, 20 Nov 2017 11:49:03 +0000 (12:49 +0100)]
UI tests extract the regular output from the 'rendered' field in json

6 years agoThis method of once-diagnostics doesn't allow nesting
Oliver Schneider [Mon, 20 Nov 2017 11:48:08 +0000 (12:48 +0100)]
This method of once-diagnostics doesn't allow nesting

6 years agoSimplify an Iterator::fold to Iterator::any
Oliver Schneider [Mon, 20 Nov 2017 11:46:45 +0000 (12:46 +0100)]
Simplify an Iterator::fold to Iterator::any

6 years agoUse visit_body
Shotaro Yamada [Fri, 24 Nov 2017 06:35:51 +0000 (15:35 +0900)]
Use visit_body

6 years agoQuerify
Shotaro Yamada [Sat, 18 Nov 2017 15:20:41 +0000 (00:20 +0900)]
Querify

6 years agoAuto merge of #45946 - estebank:crate-conflict-diag, r=arielb1
bors [Fri, 24 Nov 2017 04:03:36 +0000 (04:03 +0000)]
Auto merge of #45946 - estebank:crate-conflict-diag, r=arielb1

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
```

6 years agoAdd test
Shotaro Yamada [Thu, 16 Nov 2017 12:12:01 +0000 (21:12 +0900)]
Add test

6 years agoDo match-check before const MIR generation
Shotaro Yamada [Thu, 16 Nov 2017 12:11:28 +0000 (21:11 +0900)]
Do match-check before const MIR generation

6 years agoVisit const expressions in check match
Shotaro Yamada [Thu, 16 Nov 2017 12:10:49 +0000 (21:10 +0900)]
Visit const expressions in check match

6 years agoAuto merge of #45942 - Menschenkindlein:master, r=estebank
bors [Fri, 24 Nov 2017 01:44:19 +0000 (01:44 +0000)]
Auto merge of #45942 - Menschenkindlein:master, r=estebank

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

6 years agoMake float::from_bits transmute (and update the documentation to reflect this).
Alexis Beingessner [Wed, 15 Nov 2017 20:05:47 +0000 (15:05 -0500)]
Make float::from_bits transmute (and update the documentation to reflect this).

The current implementation/documentation was made to avoid sNaN because of
potential safety issues implied by old/bad LLVM documentation. These issues
aren't real, so we can just make the implementation transmute (as permitted
by the existing documentation of this method).

Also the documentation didn't actually match the behaviour: it said we may
change sNaNs, but in fact we canonicalized *all* NaNs.

Also an example in the documentation was wrong: it said we *always* change
sNaNs, when the documentation was explicitly written to indicate it was
implementation-defined.

This makes to_bits and from_bits perfectly roundtrip cross-platform, except
for one caveat: although the 2008 edition of IEEE-754 specifies how to
interpet the signaling bit, earlier editions didn't. This lead to some platforms
picking the opposite interpretation, so all signaling NaNs on x86/ARM are quiet
on MIPS, and vice-versa.

NaN-boxing is a fairly important optimization, while we don't even guarantee
that float operations properly preserve signalingness. As such, this seems like
the more natural strategy to take (as opposed to trying to mangle the signaling
bit on a per-platform basis).

This implementation is also, of course, faster.

6 years agoAuto merge of #46225 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 23 Nov 2017 21:48:30 +0000 (21:48 +0000)]
Auto merge of #46225 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #45635, #46177, #46190, #46218, #46220
- Failed merges:

6 years agoRollup merge of #46220 - rust-lang:frewsxcv-issue-44929, r=kennytm
Guillaume Gomez [Thu, 23 Nov 2017 20:51:13 +0000 (21:51 +0100)]
Rollup merge of #46220 - rust-lang:frewsxcv-issue-44929, r=kennytm

Clarify stdin behavior of `Command::output`.

Fixes #44929.

6 years agoRollup merge of #46218 - rust-lang:frewsxcv-rename-slice-swap-param, r=kennytm
Guillaume Gomez [Thu, 23 Nov 2017 20:51:12 +0000 (21:51 +0100)]
Rollup merge of #46218 - rust-lang:frewsxcv-rename-slice-swap-param, r=kennytm

Rename param in `[T]::swap_with_slice` from `src` to `other`.

The idea of ‘source’ and ‘destination’ aren’t very applicable for this
operation since both slices can both be considered sources and
destinations.

6 years agoRollup merge of #46190 - steveklabnik:fix-releases, r=aturon
Guillaume Gomez [Thu, 23 Nov 2017 20:51:11 +0000 (21:51 +0100)]
Rollup merge of #46190 - steveklabnik:fix-releases, r=aturon

Amend RELEASES for 1.22.1

and fix the date for 1.22.0

6 years agoRollup merge of #46177 - ollie27:std_unicode_debug, r=estebank
Guillaume Gomez [Thu, 23 Nov 2017 20:51:10 +0000 (21:51 +0100)]
Rollup merge of #46177 - ollie27:std_unicode_debug, r=estebank

Add missing Debug impls to std_unicode

Also adds `#![deny(missing_debug_implementations)]` so they don't get missed again.

cc #31869

6 years agoRollup merge of #45635 - virgil-palanciuc:master, r=kennytm
Guillaume Gomez [Thu, 23 Nov 2017 20:51:09 +0000 (21:51 +0100)]
Rollup merge of #45635 - virgil-palanciuc:master, r=kennytm

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.

6 years agoRemove invalid doc link
Guillaume Gomez [Thu, 23 Nov 2017 20:48:22 +0000 (21:48 +0100)]
Remove invalid doc link

6 years agoAuto merge of #45881 - Centril:box-leak, r=alexcrichton
bors [Thu, 23 Nov 2017 19:18:15 +0000 (19:18 +0000)]
Auto merge of #45881 - Centril:box-leak, r=alexcrichton

Add Box::leak<'a>(Box<T>) -> &'a mut T where T: 'a

Adds:

```rust
impl<T: ?Sized> Box<T> {
    pub fn leak<'a>(b: Box<T>) -> &'a mut T where T: 'a {
        unsafe { &mut *Box::into_raw(b) }
    }
}
```

which is useful for when you just want to put some stuff on the heap and then have a reference to it for the remainder of the program.

r? @sfackler
cc @durka

6 years agoUse for_each_child_stable in find_module
Maxim Zholobak [Thu, 23 Nov 2017 19:09:27 +0000 (21:09 +0200)]
Use for_each_child_stable in find_module

6 years agoAuto merge of #46087 - vramana:fix-46003, r=arielb1
bors [Thu, 23 Nov 2017 14:48:14 +0000 (14:48 +0000)]
Auto merge of #46087 - vramana:fix-46003, r=arielb1

Fix borrowck compiler errors for upvars contain "spurious" dereferences

Fixes #46003

6 years agoFix borrowck compiler errors for upvars contain "spurious" dereferences
Ramana Venkata [Sat, 18 Nov 2017 22:32:05 +0000 (04:02 +0530)]
Fix borrowck compiler errors for upvars contain "spurious" dereferences

Fixes #46003

6 years agoAdd module population and case of enum in place of expression
Maxim Zholobak [Thu, 23 Nov 2017 13:10:23 +0000 (15:10 +0200)]
Add module population and case of enum in place of expression

6 years agointroduce macros for type-foldable, convert stuff to use them
Niko Matsakis [Sat, 11 Nov 2017 18:04:36 +0000 (13:04 -0500)]
introduce macros for type-foldable, convert stuff to use them

6 years agoAuto merge of #46054 - nikomatsakis:nll-master-to-rust-master-1, r=arielb1
bors [Thu, 23 Nov 2017 10:46:02 +0000 (10:46 +0000)]
Auto merge of #46054 - nikomatsakis:nll-master-to-rust-master-1, r=arielb1

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

6 years agoAuto merge of #46051 - cramertj:in-band-lifetimes, r=nikomatsakis
bors [Thu, 23 Nov 2017 08:20:33 +0000 (08:20 +0000)]
Auto merge of #46051 - cramertj:in-band-lifetimes, r=nikomatsakis

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

6 years agoAuto merge of #46024 - estebank:no-variant, r=petrochenkov
bors [Thu, 23 Nov 2017 05:53:08 +0000 (05:53 +0000)]
Auto merge of #46024 - estebank:no-variant, r=petrochenkov

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(..) =>(),
  |         ^^^^^^^^^^^^^
```

6 years agoAdding `eprint*!` to the list of macros in the `format!` family
David Alber [Thu, 23 Nov 2017 04:44:05 +0000 (20:44 -0800)]
Adding `eprint*!` to the list of macros in the `format!` family

6 years agoAuto merge of #46011 - euclio:reachability-redux, r=nrc
bors [Thu, 23 Nov 2017 03:22:55 +0000 (03:22 +0000)]
Auto merge of #46011 - euclio:reachability-redux, r=nrc

Allow filtering analysis by reachability

Fixes #43521.
Fixes https://github.com/nrc/rls-analysis/issues/79.

This PR allows a user to filter items present in the save-analysis data by setting the `reachable_only` config option. This option is intended for use by the new rustdoc. The PR isn't quite finished, because it's dependent on a new release of rls-data, but I want to make sure that the approach is valid.

https://github.com/nrc/rls-analysis/issues/79 mentions that `pub use` might need to be handled, but my thinking is that the consumer of the analysis data would be able to infer which imports are `pub use`, and which items are only reachable through `pub use`, so that doesn't need to be handled here.

r? @nrc

6 years agoUse multiline text for crate conflict diagnostics
Esteban Küber [Sun, 12 Nov 2017 19:56:59 +0000 (11:56 -0800)]
Use multiline text for crate conflict diagnostics

6 years agoAdd test to new branches
Esteban Küber [Wed, 22 Nov 2017 17:40:52 +0000 (09:40 -0800)]
Add test to new branches

6 years agoClarify stdin behavior of `Command::output`.
Corey Farwell [Thu, 23 Nov 2017 01:47:31 +0000 (20:47 -0500)]
Clarify stdin behavior of `Command::output`.

Fixes #44929.

6 years agoRename param in `[T]::swap_with_slice` from `src` to `other`.
Corey Farwell [Thu, 23 Nov 2017 00:56:48 +0000 (19:56 -0500)]
Rename param in `[T]::swap_with_slice` from `src` to `other`.

The idea of ‘source’ and ‘destination’ aren’t very applicable for this
operation since both slices can both be considered sources and
destinations.

6 years agoAuto merge of #45721 - nikomatsakis:hir-tree, r=arielb1
bors [Thu, 23 Nov 2017 00:52:15 +0000 (00:52 +0000)]
Auto merge of #45721 - nikomatsakis:hir-tree, r=arielb1

add -Zunpretty=hir-tree

This uses the debug impls to dump the raw HIR. Particularly useful when
learning how the compiler works.

cc @qmx

6 years agoadd `reachable_only` to save-analysis config
Andy Russell [Wed, 22 Nov 2017 21:09:43 +0000 (16:09 -0500)]
add `reachable_only` to save-analysis config

6 years agorustc: don't mark lifetimes as early-bound in the presence of impl Trait.
Eduard-Mihai Burtescu [Wed, 22 Nov 2017 19:10:55 +0000 (21:10 +0200)]
rustc: don't mark lifetimes as early-bound in the presence of impl Trait.

6 years agoAmend RELEASES for 1.22.1
steveklabnik [Wed, 22 Nov 2017 19:04:41 +0000 (14:04 -0500)]
Amend RELEASES for 1.22.1

and fix the date for 1.22.0

6 years agoadd some tests for the interaction with existential impl trait
Niko Matsakis [Wed, 22 Nov 2017 18:45:42 +0000 (13:45 -0500)]
add some tests for the interaction with existential impl trait

6 years agomodify inherent impls test to indicate `TypeckTables` do not change
Niko Matsakis [Wed, 22 Nov 2017 17:06:19 +0000 (12:06 -0500)]
modify inherent impls test to indicate `TypeckTables` do not change

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.

6 years agoadd debug log with result of writeback
Niko Matsakis [Wed, 22 Nov 2017 15:08:00 +0000 (10:08 -0500)]
add debug log with result of writeback

6 years agoImplement in-band lifetime bindings
Taylor Cramer [Fri, 17 Nov 2017 06:59:45 +0000 (22:59 -0800)]
Implement in-band lifetime bindings

6 years agoAuto merge of #46035 - oli-obk:use_suggestions, r=petrochenkov
bors [Wed, 22 Nov 2017 16:14:13 +0000 (16:14 +0000)]
Auto merge of #46035 - oli-obk:use_suggestions, r=petrochenkov

Add structured suggestions for various "use" suggestions

r? @petrochenkov

6 years agoAuto merge of #45198 - oli-obk:fmt_args, r=sfackler
bors [Wed, 22 Nov 2017 12:34:56 +0000 (12:34 +0000)]
Auto merge of #45198 - oli-obk:fmt_args, r=sfackler

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.

6 years agoAuto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomez
bors [Wed, 22 Nov 2017 09:58:07 +0000 (09:58 +0000)]
Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomez

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.

6 years agonormalize types in ADT constructor
Niko Matsakis [Mon, 20 Nov 2017 18:08:52 +0000 (13:08 -0500)]
normalize types in ADT constructor

Fixes #45940

6 years agohandle the active field index in unions
Niko Matsakis [Sun, 12 Nov 2017 12:03:18 +0000 (07:03 -0500)]
handle the active field index in unions

6 years agoavoid early return
Niko Matsakis [Sun, 12 Nov 2017 11:25:09 +0000 (06:25 -0500)]
avoid early return

6 years agoonly normalize operand types when in an ADT constructor
Niko Matsakis [Sun, 12 Nov 2017 11:02:29 +0000 (06:02 -0500)]
only normalize operand types when in an ADT constructor

6 years agoNormalize LvalueTy for ops and format code to satisfy tidy check
Paul Daniel Faria [Sun, 12 Nov 2017 05:41:29 +0000 (00:41 -0500)]
Normalize LvalueTy for ops and format code to satisfy tidy check

6 years agoRemove attributes and test comments accidentally left behind, add in span_mirbugs
Paul Daniel Faria [Sat, 11 Nov 2017 21:13:23 +0000 (16:13 -0500)]
Remove attributes and test comments accidentally left behind, add in span_mirbugs