]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoIncrement Nightly version to 1.24.0
Simon Sapin [Sun, 26 Nov 2017 22:04:40 +0000 (23:04 +0100)]
Increment Nightly version to 1.24.0

The beta channel is now at 1.23.0-beta.1.

6 years agoDocument non-obvious behavior of fmt::UpperHex & co for negative integers
Simon Sapin [Sun, 26 Nov 2017 21:53:03 +0000 (22:53 +0100)]
Document non-obvious behavior of fmt::UpperHex & co for negative integers

Before stabilization I’d have suggested changing the behavior,
but that time is past.

6 years agoDeprecate the Formatter::flags method, fix #46237
Simon Sapin [Sun, 26 Nov 2017 21:43:56 +0000 (22:43 +0100)]
Deprecate the Formatter::flags method, fix #46237

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 agoMake impl-trait ciclical reference error point to def_span
Esteban Küber [Sun, 26 Nov 2017 20:35:19 +0000 (12:35 -0800)]
Make impl-trait ciclical reference error point to def_span

6 years agoMove "auto trait leak" impl-trait cycle dependency test to ui
Esteban Küber [Sun, 26 Nov 2017 20:32:30 +0000 (12:32 -0800)]
Move "auto trait leak" impl-trait cycle dependency test to ui

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 agoimprove error messages
Ariel Ben-Yehuda [Sun, 26 Nov 2017 17:01:19 +0000 (19:01 +0200)]
improve error messages

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 agoChanged to correct quotes ` `
colinmarsh19 [Sun, 26 Nov 2017 14:40:29 +0000 (07:40 -0700)]
Changed to correct quotes ` `

6 years agoAdded .rs extension
colinmarsh19 [Sun, 26 Nov 2017 14:36:56 +0000 (07:36 -0700)]
Added .rs extension

6 years agomark rustfmt as broken
Ariel Ben-Yehuda [Thu, 23 Nov 2017 20:18:48 +0000 (22:18 +0200)]
mark rustfmt as broken

There's a trailing whitespace problem in one of the tests. @nrc said
he'll go fix it quickly, but until then I'll like to land this PR.

I suspect this happened because one of the dependencies in the
Cargo.lock I updated had changed the format of the XML they emit, but
that has to be investigated.

6 years agofix NetBSD
Ariel Ben-Yehuda [Thu, 23 Nov 2017 12:17:56 +0000 (14:17 +0200)]
fix NetBSD

6 years agolimit packed copy-out to non-generic Copy structs
Ariel Ben-Yehuda [Sun, 19 Nov 2017 15:04:24 +0000 (17:04 +0200)]
limit packed copy-out to non-generic Copy structs

6 years agofix #[derive] implementation for repr(packed) structs
Ariel Ben-Yehuda [Mon, 2 Oct 2017 13:15:23 +0000 (15:15 +0200)]
fix #[derive] implementation for repr(packed) structs

Fix the derive implementation for repr(packed) structs to move the
fields out instead of calling functions on references to each subfield.

That's it, `#[derive(PartialEq)]` on a packed struct now does:
```Rust
fn eq(&self, other: &Self) {
    let field_0 = self.0;
    let other_field_0 = other.0;
    &field_0 == &other_field_0
}
```

Instead of
```Rust
fn eq(&self, other: &Self) {
    let ref field_0 = self.0;
    let ref other_field_0 = other.0;
    &*field_0 == &*other_field_0
}
```

Taking (unaligned) references to each subfield is undefined, unsound and
is an error with MIR effectck, so it had to be prevented. This causes
a borrowck error when a `repr(packed)` struct has a non-Copy field (and
therefore is a [breaking-change]), but I don't see a sound way to avoid
that error.

6 years agomake accessing packed fields a future-compat warning
Ariel Ben-Yehuda [Thu, 16 Nov 2017 18:12:23 +0000 (20:12 +0200)]
make accessing packed fields a future-compat warning

6 years agofix codegen of drops of fields of packed structs
Ariel Ben-Yehuda [Tue, 3 Oct 2017 14:01:01 +0000 (16:01 +0200)]
fix codegen of drops of fields of packed structs

6 years agoupdate Cargo.lock & rustdoc
Ariel Ben-Yehuda [Mon, 2 Oct 2017 13:40:19 +0000 (15:40 +0200)]
update Cargo.lock & rustdoc

This is required because the old version depended on tendril 0.3.1,
which used `repr(packed)` incorrectly - see
https://github.com/kuchiki-rs/kuchiki/pull/38

6 years agomake accesses to fields of packed structs unsafe
Ariel Ben-Yehuda [Wed, 27 Sep 2017 11:23:45 +0000 (14:23 +0300)]
make accesses to fields of packed structs unsafe

To handle packed structs with destructors (which you'll think are a rare
case, but the `#[repr(packed)] struct Packed<T>(T);` pattern is
ever-popular, which requires handling packed structs with destructors to
avoid monomorphization-time errors), drops of subfields of packed
structs should drop a local move of the field instead of the original
one.

cc #27060 - this should deal with that issue after codegen of drop glue
is updated.

The new errors need to be changed to future-compatibility warnings, but
I'll rather do a crater run first with them as errors to assess the
impact.

6 years agofix treatment of local types in "remote coherence" mode
Ariel Ben-Yehuda [Wed, 22 Nov 2017 20:39:40 +0000 (22:39 +0200)]
fix treatment of local types in "remote coherence" mode

6 years agoMIR: Fix value moved diagnose messages
Ritiek Malhotra [Thu, 23 Nov 2017 11:36:48 +0000 (17:06 +0530)]
MIR: Fix value moved diagnose messages

MIR: adopt borrowck test

Fix trailing whitespace

span_bug! on unexpected action

Make RegionVid use newtype_index!

Closes #45843

Check rvalue aggregates during check_stmt in tycheck, add initial, (not passing) test

Fix failing test

Remove attributes and test comments accidentally left behind, add in span_mirbugs

Normalize LvalueTy for ops and format code to satisfy tidy check

only normalize operand types when in an ADT constructor

avoid early return

handle the active field index in unions

normalize types in ADT constructor

Fixes #45940

Fix borrowck compiler errors for upvars contain "spurious" dereferences

Fixes #46003

added associated function Box::leak

Box::leak - improve documentation

Box::leak - fixed bug in documentation

Box::leak - relaxed constraints wrt. lifetimes

Box::leak - updated documentation

Box::leak - made an oops, fixed now =)

Box::leak: update unstable issue number (46179).

Add test for #44953

Add missing Debug impls to std_unicode

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

Amend RELEASES for 1.22.1

and fix the date for 1.22.0

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.

Clarify stdin behavior of `Command::output`.

Fixes #44929.

Add hints for the case of confusing enum with its variants

Add failing testcases

Add module population and case of enum in place of expression

Use for_each_child_stable in find_module

Use multiline text for crate conflict diagnostics

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.

Simplify an Iterator::fold to Iterator::any

This method of once-diagnostics doesn't allow nesting

UI tests extract the regular output from the 'rendered' field in json

Merge cfail and ui tests into ui tests

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.

Include tuple projections in MIR tests

Add type checking for the lang item

As part of doing so, add more lang items instead of passing u128 to the i128 ones where it doesn't matter in twos-complement.

Handle shifts properly

* The overflow-checking shift items need to take a full 128-bit type, since they need to be able to detect idiocy like `1i128 << (1u128 << 127)`
* The unchecked ones just take u32, like the `*_sh?` methods in core
* Because shift-by-anything is allowed, cast into a new local for every shift

incr.comp.: Make sure we don't lose unused green results from the query cache.

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

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.

Add enum InitializationRequiringAction

Fix tidy tests

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 agoCompiletest libc dependency can be unix-only
David Tolnay [Sun, 26 Nov 2017 13:08:23 +0000 (05:08 -0800)]
Compiletest libc dependency can be unix-only

In main.rs libc is imported as:

    #[cfg(unix)]
    extern crate libc;

6 years agoFix global search
Guillaume Gomez [Tue, 21 Nov 2017 23:17:30 +0000 (00:17 +0100)]
Fix global search

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 agomake OpenBSD to use libc++ instead of (e)stdc++
Sébastien Marie [Sun, 26 Nov 2017 09:08:25 +0000 (10:08 +0100)]
make OpenBSD to use libc++ instead of (e)stdc++

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 agoDelete bad test file
colinmarsh19 [Sun, 26 Nov 2017 04:14:15 +0000 (21:14 -0700)]
Delete bad test file

6 years agoAdded 46186 stderr
colinmarsh19 [Sun, 26 Nov 2017 02:30:15 +0000 (19:30 -0700)]
Added 46186 stderr

6 years agoUI test 46186
colinmarsh19 [Sun, 26 Nov 2017 02:26:47 +0000 (19:26 -0700)]
UI test 46186

6 years agoChanged from note to span_suggestion_short
colinmarsh19 [Sun, 26 Nov 2017 01:34:20 +0000 (18:34 -0700)]
Changed from note to span_suggestion_short

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 agocomments
Ariel Ben-Yehuda [Thu, 23 Nov 2017 21:21:56 +0000 (23:21 +0200)]
comments

6 years agoavoid type-live-for-region obligations on dummy nodes
Ariel Ben-Yehuda [Thu, 23 Nov 2017 21:03:47 +0000 (23:03 +0200)]
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.

6 years agoImplement LinkedList::drain_filter
John-John Tedro [Sat, 25 Nov 2017 20:14:37 +0000 (21:14 +0100)]
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.

6 years agoIntroduce LinkedList::remove_if
John-John Tedro [Sat, 25 Nov 2017 17:35:30 +0000 (18:35 +0100)]
Introduce LinkedList::remove_if

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 agoFix proc_macro output with struct parse error
Esteban Küber [Sat, 25 Nov 2017 16:48:11 +0000 (08:48 -0800)]
Fix proc_macro output with struct parse error

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

6 years agoAdded ;
colinmarsh19 [Sat, 25 Nov 2017 16:06:06 +0000 (09:06 -0700)]
Added ;

6 years agoRemove index type check (review comment)
Esteban Küber [Sat, 25 Nov 2017 14:20:07 +0000 (06:20 -0800)]
Remove index type check (review comment)

6 years agoFixed Err by passing "err"
colinmarsh19 [Sat, 25 Nov 2017 15:47:05 +0000 (08:47 -0700)]
Fixed Err by passing "err"

6 years agoTest for issue #46186
colinmarsh19 [Sat, 25 Nov 2017 15:40:42 +0000 (08:40 -0700)]
Test for issue #46186

6 years agoRemove semicolon note
colinmarsh19 [Sat, 25 Nov 2017 15:38:30 +0000 (08:38 -0700)]
Remove semicolon note

Added note that specifies a semicolon should be removed after a given struct

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 agoAdd inline `compile-fail` markers to tests
Esteban Küber [Sat, 25 Nov 2017 14:26:46 +0000 (06:26 -0800)]
Add inline `compile-fail` markers to tests

6 years agoAdd `compile-fail` style comments to tests
Esteban Küber [Sat, 25 Nov 2017 14:19:39 +0000 (06:19 -0800)]
Add `compile-fail` style comments to tests

6 years agoSuggest using slice when encountering `let x = ""[..];`
Esteban Küber [Fri, 24 Nov 2017 22:47:40 +0000 (14:47 -0800)]
Suggest using slice when encountering `let x = ""[..];`

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 agoExpand docs of <$Int>::from_str_radix, based on that of char::to_digit
Simon Sapin [Fri, 24 Nov 2017 17:52:42 +0000 (18:52 +0100)]
Expand docs of <$Int>::from_str_radix, based on that of char::to_digit

6 years agoConsume trailing doc comments to avoid parse errors
Esteban Küber [Fri, 24 Nov 2017 15:34:24 +0000 (07:34 -0800)]
Consume trailing doc comments to avoid parse errors

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 agoRevert to correct recovery behavior
Esteban Küber [Thu, 23 Nov 2017 21:16:19 +0000 (13:16 -0800)]
Revert to correct recovery behavior

6 years agoEmit `DocComment` in bad location error but continue parsing struct fields
Esteban Küber [Thu, 23 Nov 2017 21:15:31 +0000 (13:15 -0800)]
Emit `DocComment` in bad location error but continue parsing struct fields

6 years agoSuggest macro call when not sure that it is fn definition
Esteban Küber [Wed, 22 Nov 2017 17:49:27 +0000 (09:49 -0800)]
Suggest macro call when not sure that it is fn definition

6 years agoDo not attemt to continue parsing after `pub ident`
Esteban Küber [Tue, 21 Nov 2017 16:03:02 +0000 (08:03 -0800)]
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.

6 years agoDo not rewind parser and ignore following blocks
Esteban Küber [Tue, 21 Nov 2017 14:49:15 +0000 (06:49 -0800)]
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.

6 years agoAccount for missing keyword in fn/struct definition
Esteban Küber [Wed, 15 Nov 2017 01:49:29 +0000 (17:49 -0800)]
Account for missing keyword in fn/struct definition

6 years agoFix underline in suggestions
Esteban Küber [Wed, 15 Nov 2017 01:49:02 +0000 (17:49 -0800)]
Fix underline in suggestions

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 agoImprove documentation for slice swap/copy/clone operations.
Corey Farwell [Thu, 23 Nov 2017 00:54:06 +0000 (19:54 -0500)]
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`

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