]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #47922 - zackmdavis:and_the_case_of_the_unused_field_pattern, r=estebank
Manish Goregaokar [Wed, 7 Feb 2018 16:30:52 +0000 (08:30 -0800)]
Rollup merge of #47922 - zackmdavis:and_the_case_of_the_unused_field_pattern, r=estebank

correct unused field pattern suggestions

![unused_field_pattern_local](https://user-images.githubusercontent.com/1076988/35662336-7a69488a-06cc-11e8-9901-8d22b5cf924f.png)

r? @estebank

6 years agoRollup merge of #47883 - yurydelendik:wasm-map, r=alexcrichton
Manish Goregaokar [Wed, 7 Feb 2018 16:30:51 +0000 (08:30 -0800)]
Rollup merge of #47883 - yurydelendik:wasm-map, r=alexcrichton

Export wasm source map when debug information is enabled

We use binaryen's linker to produce a wasm file (via s2wasm). The wasm writer has capabilities to export source maps. The pilot support for source maps is added to Firefox.

The produced source map contains references to the original file, that might require additional source map file processing to include / package original files with it.

/cc @alexcrichton

6 years agoRollup merge of #47810 - GuillaumeGomez:fix-theme-but-position, r=QuietMisdreavus
Manish Goregaokar [Wed, 7 Feb 2018 16:30:49 +0000 (08:30 -0800)]
Rollup merge of #47810 - GuillaumeGomez:fix-theme-but-position, r=QuietMisdreavus

Fix rendering issues on mobile

Fixes #47723

r? @QuietMisdreavus

6 years agoRollup merge of #47631 - SimonSapin:nonnull, r=alexcrichton
Manish Goregaokar [Wed, 7 Feb 2018 16:30:48 +0000 (08:30 -0800)]
Rollup merge of #47631 - SimonSapin:nonnull, r=alexcrichton

Add some APIs to ptr::NonNull and fix `since` attributes

This is a follow-up to its stabilization in https://github.com/rust-lang/rust/pull/46952. Tracking issue: https://github.com/rust-lang/rust/issues/27730.

* These trait impls are insta-stable: `Hash`, `PartialEq`, `Eq`, `PartialOrd` and `Ord`.
* The new `cast<U>() -> NonNull<U>`  method is `#[unstable]`. It was proposed in https://github.com/rust-lang/rust/pull/46952#issuecomment-359220010.

6 years agoRollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakis
Manish Goregaokar [Wed, 7 Feb 2018 16:30:47 +0000 (08:30 -0800)]
Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakis

Add filtering options to `rustc_on_unimplemented`

- Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments.
- Add a way to provide custom notes.
- Tweak binops text.
- Add filter to detect wether `Self` is local or belongs to another crate.
- Add filter to `Iterator` diagnostic for `&str`.

Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.

6 years agoAuto merge of #47607 - davidtwco:issue-45697, r=nikomatsakis
bors [Wed, 7 Feb 2018 02:20:23 +0000 (02:20 +0000)]
Auto merge of #47607 - davidtwco:issue-45697, r=nikomatsakis

MIR-borrowck: augmented assignment causes duplicate errors

Fixes #45697. This PR resolves the error duplication. I attempted to replace the existing sets since there were quite a few but only managed to replace two of them.

r? @nikomatsakis

6 years agoAuto merge of #48040 - kennytm:rollup, r=kennytm
bors [Tue, 6 Feb 2018 19:28:54 +0000 (19:28 +0000)]
Auto merge of #48040 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #46962, #47986, #48012, #48013, #48026, #48031, #48036
- Failed merges:

6 years agoRollup merge of #48036 - durka:proc-macro-doteq, r=alexcrichton
kennytm [Tue, 6 Feb 2018 19:23:30 +0000 (03:23 +0800)]
Rollup merge of #48036 - durka:proc-macro-doteq, r=alexcrichton

proc_macro: don't panic parsing ..= (fix #47950)

6 years agoRollup merge of #48031 - matthiaskrgr:exampleconfigtoml_typos, r=kennytm
kennytm [Tue, 6 Feb 2018 19:23:29 +0000 (03:23 +0800)]
Rollup merge of #48031 - matthiaskrgr:exampleconfigtoml_typos, r=kennytm

config.toml.example: fix typos.

Most of them were found by codespell: https://github.com/lucasdemarchi/codespell

6 years agoRollup merge of #48026 - Badel2:doc-assoc-const-object-safe, r=nikomatsakis
kennytm [Tue, 6 Feb 2018 19:23:28 +0000 (03:23 +0800)]
Rollup merge of #48026 - Badel2:doc-assoc-const-object-safe, r=nikomatsakis

Document that associated constants prevent a trait from being made into an object

Fixes https://github.com/rust-lang/rust/issues/47952

Add a short mention of associated constants to E0038

6 years agoRollup merge of #48013 - onur:use-time-in-bootstrap-dist, r=alexcrichton
kennytm [Tue, 6 Feb 2018 19:23:26 +0000 (03:23 +0800)]
Rollup merge of #48013 - onur:use-time-in-bootstrap-dist, r=alexcrichton

Use time crate in bootstrap dist instead of date

`bootstrap dist` command is trying to run *NIX specific `date` command to get current month and year. This command keep failing when it's called on a Windows command prompt. This patch is making it use time crate.

Closes: #47908
6 years agoRollup merge of #48012 - scottmcm:faster-rangeinclusive-fold, r=alexcrichton
kennytm [Tue, 6 Feb 2018 19:23:25 +0000 (03:23 +0800)]
Rollup merge of #48012 - scottmcm:faster-rangeinclusive-fold, r=alexcrichton

Override try_[r]fold for RangeInclusive

Because the last item needs special handling, it seems that LLVM has trouble canonicalizing the loops in external iteration.  With the override, it becomes obvious that the start==end case exits the loop (as opposed to the one *after* that exiting the loop in external iteration).

Demo adapted from https://github.com/rust-lang/rust/issues/45222
```rust
#[no_mangle]
pub fn foo3r(n: u64) -> u64 {
    let mut count = 0;
    (0..n).for_each(|_| {
        (0 ..= n).rev().for_each(|j| {
            count += j;
        })
    });
    count
}
```

<details>
 <summary>Current nightly ASM, 100 lines (https://play.rust-lang.org/?gist=f5674c702c6e2045c3aab5d03763e5f6&version=nightly&mode=release)</summary>

```asm
foo3r:
pushq %rbx
.Lcfi0:
.Lcfi1:
testq %rdi, %rdi
je .LBB0_1
testb $1, %dil
jne .LBB0_4
xorl %eax, %eax
xorl %r8d, %r8d
cmpq $1, %rdi
jne .LBB0_11
jmp .LBB0_23
.LBB0_1:
xorl %eax, %eax
popq %rbx
retq
.LBB0_4:
xorl %r8d, %r8d
movq $-1, %r9
xorl %eax, %eax
movq %rdi, %r11
xorl %r10d, %r10d
jmp .LBB0_5
.LBB0_8:
addq %r11, %rax
movq %rsi, %r11
movq %rdx, %r10
.LBB0_5:
cmpq %r11, %r10
movl $1, %ecx
cmovbq %r9, %rcx
cmoveq %r8, %rcx
testq %rcx, %rcx
movl $0, %esi
movl $1, %edx
je .LBB0_8
cmpq $-1, %rcx
jne .LBB0_9
leaq -1(%r11), %rsi
movq %r10, %rdx
jmp .LBB0_8
.LBB0_9:
movl $1, %r8d
cmpq $1, %rdi
je .LBB0_23
.LBB0_11:
xorl %r9d, %r9d
movq $-1, %r10
.LBB0_12:
movq %rdi, %rsi
xorl %r11d, %r11d
jmp .LBB0_13
.LBB0_16:
addq %rsi, %rax
movq %rcx, %rsi
movq %rbx, %r11
.LBB0_13:
cmpq %rsi, %r11
movl $1, %edx
cmovbq %r10, %rdx
cmoveq %r9, %rdx
testq %rdx, %rdx
movl $0, %ecx
movl $1, %ebx
je .LBB0_16
cmpq $-1, %rdx
jne .LBB0_17
leaq -1(%rsi), %rcx
movq %r11, %rbx
jmp .LBB0_16
.LBB0_17:
movq %rdi, %rcx
xorl %r11d, %r11d
jmp .LBB0_18
.LBB0_21:
addq %rcx, %rax
movq %rsi, %rcx
movq %rbx, %r11
.LBB0_18:
cmpq %rcx, %r11
movl $1, %edx
cmovbq %r10, %rdx
cmoveq %r9, %rdx
testq %rdx, %rdx
movl $0, %esi
movl $1, %ebx
je .LBB0_21
cmpq $-1, %rdx
jne .LBB0_22
leaq -1(%rcx), %rsi
movq %r11, %rbx
jmp .LBB0_21
.LBB0_22:
addq $2, %r8
cmpq %rdi, %r8
jne .LBB0_12
.LBB0_23:
popq %rbx
retq
.Lfunc_end0:
```
</details><br>

With this PR:
```asm
foo3r:
test rcx, rcx
je .LBB3_1
lea r8, [rcx - 1]
lea rdx, [rcx - 2]
mov rax, r8
mul rdx
shld rdx, rax, 63
imul r8, r8
add r8, rcx
sub r8, rdx
imul r8, rcx
mov rax, r8
ret
.LBB3_1:
xor r8d, r8d
mov rax, r8
ret
```

6 years agoRollup merge of #47986 - Gilnaa:libtest_relaxed, r=Mark-Simulacrum
kennytm [Tue, 6 Feb 2018 19:23:24 +0000 (03:23 +0800)]
Rollup merge of #47986 - Gilnaa:libtest_relaxed, r=Mark-Simulacrum

libtest: Replace panics with error messages

This replaces explicit panics on failures in libtest with prints to stderr.
Where "failures" == CLI argument parsing and such

Before:
```
$ ./foo-stable --not-an-option
thread 'main' panicked at '"Unrecognized option: \'not-an-option\'"', libtest/lib.rs:251:27
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

After:
```
$ ./foo-nightly --not-an-option
error: Unrecognized option: 'not-an-option'
```

6 years agoRollup merge of #46962 - clarcharr:os_raw_docs, r=QuietMisdreavus
kennytm [Tue, 6 Feb 2018 19:23:23 +0000 (03:23 +0800)]
Rollup merge of #46962 - clarcharr:os_raw_docs, r=QuietMisdreavus

Document std::os::raw.

This adds a brief explanation to each type and its definition according to C. This also helps clarify that the definitions of the types, as described by rustdoc, are not necessarily the same from platform to platform.

6 years agoTrait objects cannot contain associated constants
Badel2 [Tue, 6 Feb 2018 01:13:39 +0000 (02:13 +0100)]
Trait objects cannot contain associated constants

6 years agoAdded and updated tests to enable/disable overflow checks.
David Wood [Tue, 6 Feb 2018 17:37:49 +0000 (17:37 +0000)]
Added and updated tests to enable/disable overflow checks.

6 years agofix docs link
QuietMisdreavus [Tue, 6 Feb 2018 15:26:15 +0000 (09:26 -0600)]
fix docs link

6 years agoproc_macro: don't panic parsing ..= (fix #47950)
Alex Burka [Tue, 6 Feb 2018 14:43:01 +0000 (14:43 +0000)]
proc_macro: don't panic parsing ..= (fix #47950)

6 years agoconfig.toml.example: fix typos.
Matthias Krüger [Tue, 6 Feb 2018 11:59:06 +0000 (12:59 +0100)]
config.toml.example: fix typos.

Most of them were found by codespell: https://github.com/lucasdemarchi/codespell

6 years agoAuto merge of #47203 - varkor:output-filename-conflicts-with-directory, r=estebank
bors [Tue, 6 Feb 2018 09:51:03 +0000 (09:51 +0000)]
Auto merge of #47203 - varkor:output-filename-conflicts-with-directory, r=estebank

Warn when rustc output conflicts with existing directories

When the compiled executable would conflict with a directory, display a
rustc error instead of a verbose and potentially-confusing linker
error. This is a usability improvement, and doesn’t actually change
behaviour with regards to compilation success. This addresses the
concern in #35887. Fixes #13098.

6 years agoAuto merge of #48017 - kennytm:rollup, r=kennytm
bors [Tue, 6 Feb 2018 07:02:25 +0000 (07:02 +0000)]
Auto merge of #48017 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #46030, #47496, #47543, #47704, #47753, #47807, #47948, #47959, #48003, #48007
- Failed merges:

6 years agoSwapped order of left/right visits to ensure consistency in read/write pass ordering...
David Wood [Mon, 5 Feb 2018 22:31:56 +0000 (22:31 +0000)]
Swapped order of left/right visits to ensure consistency in read/write pass ordering when -O is passed.

6 years agoRollup merge of #48007 - nrc:rls-field-init, r=eddyb
kennytm [Mon, 5 Feb 2018 18:13:55 +0000 (02:13 +0800)]
Rollup merge of #48007 - nrc:rls-field-init, r=eddyb

save-analysis: avoid implicit unwrap

When looking up a field defintion, since the name might be incorrect in the field init shorthand case.

cc https://github.com/rust-lang-nursery/rls/issues/699

r? @eddyb

6 years agoRollup merge of #48003 - mbrubeck:docs, r=steveklabnik
kennytm [Mon, 5 Feb 2018 18:13:54 +0000 (02:13 +0800)]
Rollup merge of #48003 - mbrubeck:docs, r=steveklabnik

Fix info about generic impls in AsMut docs

This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed some additional adjustments for correctness.

6 years agoRollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum
kennytm [Mon, 5 Feb 2018 18:13:52 +0000 (02:13 +0800)]
Rollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum

Fix rustdoc ICE on macros defined within functions

fixes #47639

6 years agoRollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, r=petrochenkov
kennytm [Mon, 5 Feb 2018 18:13:51 +0000 (02:13 +0800)]
Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, r=petrochenkov

Stabilize use_nested_groups

As requested in #44494. Documentation PRs already sent.

6 years agoRollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik
kennytm [Mon, 5 Feb 2018 18:13:50 +0000 (02:13 +0800)]
Rollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik

Make wording around 0-cost casts more precise

6 years agoRollup merge of #47753 - steveklabnik:update-book, r=alexcrichton
kennytm [Mon, 5 Feb 2018 18:13:49 +0000 (02:13 +0800)]
Rollup merge of #47753 - steveklabnik:update-book, r=alexcrichton

Update book

This PR does two things:

1. update the book to include https://github.com/rust-lang/book/pull/1088
2. update to mdbook 0.1

Both of these things are big changes, so I want to land them now, well before the next branch, so we can kick the tires.

------------------------------

Locally, I'm seeing some weirdness around the reference and this:

![image](https://user-images.githubusercontent.com/27786/35411917-8dcbb31a-01e8-11e8-8c30-0bd280d93b9d.png)

Putting this PR up so others can try and build and see if it reproduces for them.

6 years agoRollup merge of #47704 - dsprenkels:issue-44415, r=alexcrichton
kennytm [Mon, 5 Feb 2018 18:13:48 +0000 (02:13 +0800)]
Rollup merge of #47704 - dsprenkels:issue-44415, r=alexcrichton

Add a regression test for #44415

This PR adds a regression test for issue #44415.

Fixes #44415.

6 years agoRollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakis
kennytm [Mon, 5 Feb 2018 18:13:46 +0000 (02:13 +0800)]
Rollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakis

Disallow mutable borrow to non-mut statics

Closes #42344.

6 years agoRollup merge of #47496 - QuietMisdreavus:rls-doc-include, r=estebank
kennytm [Mon, 5 Feb 2018 18:13:45 +0000 (02:13 +0800)]
Rollup merge of #47496 - QuietMisdreavus:rls-doc-include, r=estebank

add documentation from doc(include) to analysis data

cc #44732

Currently save-analysis only loads docs from plain doc comments and doc attributes. Since `#[doc(include="filename.md")]` doesn't create a plain doc attribute when it loads the file, we need to be sure to pick up this info for the analysis data.

6 years agoRollup merge of #46030 - Zoxc:asm-volatile, r=nikomatsakis
kennytm [Mon, 5 Feb 2018 18:13:44 +0000 (02:13 +0800)]
Rollup merge of #46030 - Zoxc:asm-volatile, r=nikomatsakis

Make inline assembly volatile if it has no outputs. Fixes #46026

6 years agoAuto merge of #47881 - oli-obk:miri_clippy, r=Manishearth
bors [Mon, 5 Feb 2018 15:05:43 +0000 (15:05 +0000)]
Auto merge of #47881 - oli-obk:miri_clippy, r=Manishearth

Update clippy and miri submodule

r? @Manishearth

cc @kennytm I needed to touch the miri submodule's Cargo.toml to make sure that clippy gets the newest compiletest_rs. This will not fix miri, but since I touched the miri submodule, will this PR fail?

miri is unfixable until #46882 is merged

6 years agoMake inline assembly volatile if it has no outputs. Fixes #46026
John Kåre Alsaker [Thu, 16 Nov 2017 09:08:19 +0000 (10:08 +0100)]
Make inline assembly volatile if it has no outputs. Fixes #46026

6 years agoUpdate clippy and miri submodule
Oliver Schneider [Tue, 30 Jan 2018 14:12:12 +0000 (15:12 +0100)]
Update clippy and miri submodule

6 years agoStabilize use_nested_groups
Pietro Albini [Thu, 1 Feb 2018 21:55:20 +0000 (22:55 +0100)]
Stabilize use_nested_groups

6 years agoAuto merge of #47920 - Aaron1011:nll-overflow, r=pnkfelix
bors [Mon, 5 Feb 2018 09:17:00 +0000 (09:17 +0000)]
Auto merge of #47920 - Aaron1011:nll-overflow, r=pnkfelix

Fix overflow when performing drop check calculations in NLL

Clearing out the infcx's region constraints after processing each type
ends up interacting badly with normalizing associated types. This commit
keeps all region constraints intact until the end of
TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized
types are able to re-use existing inference variables.

Fixes #47589

6 years agoUse time crate in bootstrap dist instead of date
Onur Aslan [Mon, 5 Feb 2018 08:39:54 +0000 (11:39 +0300)]
Use time crate in bootstrap dist instead of date

6 years agoOverride try_[r]fold for RangeInclusive
Scott McMurray [Mon, 5 Feb 2018 07:48:40 +0000 (23:48 -0800)]
Override try_[r]fold for RangeInclusive

Because the last item needs special handling, it seems that LLVM has trouble canonicalizing the loops in external iteration.  With the override, it becomes obvious that the start==end case exits the loop (as opposed to the one *after* that exiting the loop in external iteration).

6 years agoAuto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakis
bors [Mon, 5 Feb 2018 04:32:06 +0000 (04:32 +0000)]
Auto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakis

Fix ref-to-ptr coercions not working with NLL in certain cases

Implicit coercions from references to pointers were lowered to slightly
different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
in certain uses of self-referential structs compiling correctly when an
explicit cast was used, but not when the implicit coercion was used.

To fix this, this commit adds an outer 'Use' expr when applying a
raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
identical to that of explicit coercions, allowing the original code to
compile regardless of how the raw ptr cast occurs.

Fixes #47722

6 years agoAuto merge of #47865 - Manishearth:cleanup-shim, r=nikomatsakis
bors [Mon, 5 Feb 2018 01:45:46 +0000 (01:45 +0000)]
Auto merge of #47865 - Manishearth:cleanup-shim, r=nikomatsakis

Cleanup the shim code

 - We now write directly to `RETURN_PLACE` instead of creating intermediates
 - `tuple_like_shim` takes an iterator (used by #47867)
 - `tuple_like_shim` no longer relies on it being the first thing to create blocks, and uses relative block indexing in a cleaner way (necessary for #47867)
 - All the shim builders take `dest, src` arguments instead of hardcoding RETURN_PLACE

r? @eddyb

6 years agoAuto merge of #47998 - kennytm:rollup, r=kennytm
bors [Sun, 4 Feb 2018 22:58:10 +0000 (22:58 +0000)]
Auto merge of #47998 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #47862, #47877, #47896, #47912, #47947, #47958, #47978, #47996, #47999, #47892
- Failed merges:

6 years agosave-analysis: avoid implicit unwrap
Nick Cameron [Sun, 4 Feb 2018 22:00:56 +0000 (11:00 +1300)]
save-analysis: avoid implicit unwrap

When looking up a field defintion, since the name might be incorrect in the field init shorthand case.

cc https://github.com/rust-lang-nursery/rls/issues/699

6 years agoadd exceptions for new deps
steveklabnik [Sat, 3 Feb 2018 16:00:39 +0000 (11:00 -0500)]
add exceptions for new deps

6 years agoupdate mdbook to 0.1.2
steveklabnik [Thu, 25 Jan 2018 17:32:25 +0000 (12:32 -0500)]
update mdbook to 0.1.2

and improve printing of errors

6 years agoupdate reference
steveklabnik [Fri, 26 Jan 2018 17:32:33 +0000 (12:32 -0500)]
update reference

6 years agoupdate trpl
steveklabnik [Thu, 25 Jan 2018 17:24:27 +0000 (12:24 -0500)]
update trpl

Includes https://github.com/rust-lang/book/pull/1088 and
https://github.com/rust-lang/book/commit/62210e326c27697e94ce429c1683dcea4e4887e4

6 years agoFix info about generic impls in AsMut docs
Matt Brubeck [Sun, 4 Feb 2018 19:57:36 +0000 (11:57 -0800)]
Fix info about generic impls in AsMut docs

This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed
some additional adjustments for correctness.

6 years agoRollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk
kennytm [Sun, 4 Feb 2018 17:27:36 +0000 (01:27 +0800)]
Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk

Turn `type_id` into a constant intrinsic

https://github.com/rust-lang/rust/issues/27745

The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.

6 years agoRollup merge of #47999 - jaystrictor:master, r=Mark-Simulacrum
kennytm [Sun, 4 Feb 2018 17:20:56 +0000 (01:20 +0800)]
Rollup merge of #47999 - jaystrictor:master, r=Mark-Simulacrum

Remove 'the this' in doc comments.

6 years agoRollup merge of #47996 - Zoxc:run-make-last, r=Mark-Simulacrum
kennytm [Sun, 4 Feb 2018 17:19:41 +0000 (01:19 +0800)]
Rollup merge of #47996 - Zoxc:run-make-last, r=Mark-Simulacrum

Run the `run-make` tests last, so more tests run on Windows when `make` is unavailable

6 years agoRollup merge of #47978 - eddyb:iu, r=kennytm
kennytm [Sun, 4 Feb 2018 15:29:01 +0000 (23:29 +0800)]
Rollup merge of #47978 - eddyb:iu, r=kennytm

ui tests: diff from old (expected) to new (actual) instead of backwards.

Previously `actual` was "old" and `expected` was "new" which resulted in `+` before `-`.
AFAIK all diff tools put `-` before `+`, which made the previous behavior *very confusing*.

r? @nikomatsakis

6 years agoRollup merge of #47958 - frewsxcv:frewsxcv-try-clone, r=aidanhs
kennytm [Sun, 4 Feb 2018 15:28:59 +0000 (23:28 +0800)]
Rollup merge of #47958 - frewsxcv:frewsxcv-try-clone, r=aidanhs

Clarify shared file handler behavior of File::try_clone.

Fixes https://github.com/rust-lang/rust/issues/46578.

6 years agoRollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov
kennytm [Sun, 4 Feb 2018 15:28:58 +0000 (23:28 +0800)]
Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov

Stabilize feature(match_beginning_vert)

With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm.

Reference PR: rust-lang-nursery/reference#231

Closes #44101

6 years agoRollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton
kennytm [Sun, 4 Feb 2018 15:28:57 +0000 (23:28 +0800)]
Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton

Use a range to identify SIGSEGV in stack guards

Previously, the `guard::init()` and `guard::current()` functions were
returning a `usize` address representing the top of the stack guard,
respectively for the main thread and for spawned threads.  The `SIGSEGV`
handler on `unix` targets checked if a fault was within one page below that
address, if so reporting it as a stack overflow.

Now `unix` targets report a `Range<usize>` representing the guard memory,
so it can cover arbitrary guard sizes.  Non-`unix` targets which always
return `None` for guards now do so with `Option<!>`, so they don't pay any
overhead.

For `linux-gnu` in particular, the previous guard upper-bound was
`stackaddr + guardsize`, as the protected memory was *inside* the stack.
This was a glibc bug, and starting from 2.27 they are moving the guard
*past* the end of the stack.  However, there's no simple way for us to know
where the guard page actually lies, so now we declare it as the whole range
of `stackaddr ± guardsize`, and any fault therein will be called a stack
overflow.  This fixes #47863.

6 years agoRollup merge of #47896 - zackmdavis:and_the_case_of_the_necessary_unnecessary_parens...
kennytm [Sun, 4 Feb 2018 15:28:56 +0000 (23:28 +0800)]
Rollup merge of #47896 - zackmdavis:and_the_case_of_the_necessary_unnecessary_parens, r=nikomatsakis

decline to lint technically-unnecessary parens in function or method arguments inside of nested macros

In #46980 ("in which the unused-parens lint..." (14982db2d6)), the
unused-parens lint was made to check function and method arguments,
which it previously did not (seemingly due to oversight rather than
willful design). However, in #47775 and discussion thereon,
user–developers of Geal/nom and graphql-rust/juniper reported that the
lint was seemingly erroneously triggering on certain complex macros in
those projects. While this doesn't seem like a bug in the lint in the
particular strict sense that the expanded code would, in fact, contain
unncecessary parentheses, it also doesn't seem like the sort of thing
macro authors should have to think about: the spirit of the
unused-parens lint is to prevent needless clutter in code, not to give
macro authors extra heartache in the handling of token trees.

We propose the expediency of declining to lint unused parentheses in
function or method args inside of nested expansions: we believe that
this should eliminate the petty, troublesome lint warnings reported
in the issue, without forgoing the benefits of the lint in simpler
macros.

It seemed like too much duplicated code for the `Call` and `MethodCall`
match arms to duplicate the nested-macro check in addition to each
having their own `for` loop, so this occasioned a slight refactor so
that the function and method cases could share code—hopefully the
overall intent is at least no less clear to the gentle reader.

This is concerning #47775.

6 years agoRollup merge of #47877 - spastorino:lifetime-bounds-in-copy, r=nikomatsakis
kennytm [Sun, 4 Feb 2018 15:28:54 +0000 (23:28 +0800)]
Rollup merge of #47877 - spastorino:lifetime-bounds-in-copy, r=nikomatsakis

Do not ignore lifetime bounds in Copy impls

cc #29149

r? @nikomatsakis

6 years agoRollup merge of #47862 - GuillaumeGomez:const-evaluation-ice, r=eddyb
kennytm [Sun, 4 Feb 2018 15:28:53 +0000 (23:28 +0800)]
Rollup merge of #47862 - GuillaumeGomez:const-evaluation-ice, r=eddyb

Fix const evaluation ICE in rustdoc

Fixes #47860.

r? @eddyb

6 years agoRemove 'the this' in doc comments.
Jay Strict [Sun, 4 Feb 2018 15:24:18 +0000 (16:24 +0100)]
Remove 'the this' in doc comments.

6 years agoAuto merge of #47834 - Mark-Simulacrum:no-cgu-release, r=alexcrichton
bors [Sun, 4 Feb 2018 15:06:06 +0000 (15:06 +0000)]
Auto merge of #47834 - Mark-Simulacrum:no-cgu-release, r=alexcrichton

Do not enable ThinLTO on stable, beta, or nightly builds.

Fixes #45444

6 years agoRun the `run-make` tests last, so more tests run on Windows when `make` is unavailable
John Kåre Alsaker [Sun, 4 Feb 2018 13:52:31 +0000 (14:52 +0100)]
Run the `run-make` tests last, so more tests run on Windows when `make` is unavailable

6 years agoImprove big sidebar elements display
Guillaume Gomez [Sun, 4 Feb 2018 12:47:35 +0000 (13:47 +0100)]
Improve big sidebar elements display

6 years agoFix not selectable search input
Guillaume Gomez [Sun, 4 Feb 2018 12:38:39 +0000 (13:38 +0100)]
Fix not selectable search input

6 years agoAuto merge of #47991 - nrc:update, r=alexcrichton
bors [Sun, 4 Feb 2018 12:26:09 +0000 (12:26 +0000)]
Auto merge of #47991 - nrc:update, r=alexcrichton

Update RLS and Rustfmt

r? @alexcrichton

6 years agoRemove delay_span_bug() in check_aliasability
Seiichi Uchida [Sun, 4 Feb 2018 08:31:00 +0000 (17:31 +0900)]
Remove delay_span_bug() in check_aliasability

This path was considered to be unreachable. However,
`&mut` could potentially live inside `static`.
For example, `static TAB: [&mut [u8]; 0] = [];`.

6 years agolibtest: Replace panics with error messages
Gilad Naaman [Sat, 27 Jan 2018 20:34:05 +0000 (22:34 +0200)]
libtest: Replace panics with error messages

6 years agoAuto merge of #47915 - eddyb:layout-of, r=nikomatsakis
bors [Sun, 4 Feb 2018 03:33:44 +0000 (03:33 +0000)]
Auto merge of #47915 - eddyb:layout-of, r=nikomatsakis

rustc: prefer ParamEnvAnd and LayoutCx over tuples for LayoutOf.

This PR provides `tcx.layout_of(param_env.and(ty))` as the idiomatic replacement for the existing `(tcx, param_env).layout_of(ty)` and removes fragile (coherence-wise) layout-related tuple impls.

r? @nikomatsakis

6 years agoUpdate RLS and Rustfmt
Nick Cameron [Thu, 1 Feb 2018 05:56:48 +0000 (18:56 +1300)]
Update RLS and Rustfmt

6 years agoDisable ThinLTO for dist builds.
Mark Simulacrum [Sun, 28 Jan 2018 22:50:03 +0000 (15:50 -0700)]
Disable ThinLTO for dist builds.

Dist builds should always be as fast as we can make them, and since
those run on CI we don't care quite as much for the build being somewhat
slower. As such, we don't automatically enable ThinLTO on builds for the
dist builders.

6 years agoAuto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakis
bors [Sat, 3 Feb 2018 17:28:08 +0000 (17:28 +0000)]
Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakis

Generator bugfixes

r? @nikomatsakis

6 years agoClarify shared file handler behavior of File::try_clone.
Corey Farwell [Fri, 2 Feb 2018 04:36:33 +0000 (23:36 -0500)]
Clarify shared file handler behavior of File::try_clone.

Fixes https://github.com/rust-lang/rust/issues/46578.

6 years agoAuto merge of #46254 - Dylan-DPC:ellided-lifetime, r=nikomatsakis
bors [Sat, 3 Feb 2018 14:38:52 +0000 (14:38 +0000)]
Auto merge of #46254 - Dylan-DPC:ellided-lifetime, r=nikomatsakis

elided lifetime

Closes #45992

Hey
Having a problem with my config so decided to make a WIP PR nevertheless. Will add some more tests.

6 years agoFix rendering issues on mobile
Guillaume Gomez [Sat, 27 Jan 2018 17:58:59 +0000 (18:58 +0100)]
Fix rendering issues on mobile

6 years agoAuto merge of #47962 - kennytm:rollup, r=kennytm
bors [Sat, 3 Feb 2018 12:02:33 +0000 (12:02 +0000)]
Auto merge of #47962 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #46156, #47829, #47842, #47898, #47914, #47916, #47919, #47942, #47951, #47973
- Failed merges: #47753

6 years agoFix const evaluation ICE in rustdoc
Guillaume Gomez [Mon, 29 Jan 2018 22:04:43 +0000 (23:04 +0100)]
Fix const evaluation ICE in rustdoc

6 years agoRollup merge of #47973 - perlun:patch-1, r=dtolnay
kennytm [Sat, 3 Feb 2018 08:08:27 +0000 (16:08 +0800)]
Rollup merge of #47973 - perlun:patch-1, r=dtolnay

copy_nonoverlapping example: Fixed typo

The comment referred to a variable using an incorrect name. (it has probably been renamed since the comment was written, or the comment was copied elsewhere - I noted the example in libcore has the `tmp` name for the temporary variable.)

6 years agoAuto merge of #47791 - estebank:mismatched-trait-impl, r=nikomatsakis
bors [Sat, 3 Feb 2018 01:26:56 +0000 (01:26 +0000)]
Auto merge of #47791 - estebank:mismatched-trait-impl, r=nikomatsakis

Tweak presentation on lifetime trait mismatch

 - On trait/impl method discrepancy, add label pointing at trait signature.
 - Point only at method definition when referring to named lifetimes on lifetime mismatch.
 - When the sub and sup expectations are the same, tweak the output to avoid repeated spans.

Fix #30790, CC #18759.

6 years agoui tests: diff from old (expected) to new (actual) instead of backwards.
Eduard-Mihai Burtescu [Sat, 3 Feb 2018 00:51:16 +0000 (02:51 +0200)]
ui tests: diff from old (expected) to new (actual) instead of backwards.

6 years agocopy_nonoverlapping example: Fixed typo
Per Lundberg [Fri, 2 Feb 2018 20:44:14 +0000 (22:44 +0200)]
copy_nonoverlapping example: Fixed typo

The comment referred to a variable using an incorrect name. (it has probably been renamed since the comment was written, or the comment was copied elsewhere - I noted the example in libcore has the `tmp` name for the temporary variable.)

6 years agoRemove commented-out code
Aaron Hill [Fri, 2 Feb 2018 19:59:27 +0000 (14:59 -0500)]
Remove commented-out code

6 years agoRollup merge of #47951 - GuillaumeGomez:sidebar-hover, r=QuietMisdreavus Fix ugly...
kennytm [Fri, 2 Feb 2018 08:29:26 +0000 (16:29 +0800)]
Rollup merge of #47951 - GuillaumeGomez:sidebar-hover, r=QuietMisdreavus Fix ugly hover in sidebar In the sidebar, the elements under `Structs`, `Enums`... have an ugly hover if they're not selected. This fixes it. r? @QuietMisdreavus

6 years agoRollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird spans...
kennytm [Fri, 2 Feb 2018 08:29:24 +0000 (16:29 +0800)]
Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480.

6 years agoRollup merge of #47919 - varkor:to_degrees-precision, r=rkruppe Use constant for...
kennytm [Fri, 2 Feb 2018 08:29:23 +0000 (16:29 +0800)]
Rollup merge of #47919 - varkor:to_degrees-precision, r=rkruppe Use constant for 180/π in to_degrees The current `f32|f64.to_degrees` implementation uses a division to calculate `180/π`, which causes a loss of precision. Using a constant is still not perfect (implementing a maximally-precise algorithm would come with a high performance cost), but improves precision with a minimal change. As per the discussion in #29944, this fixes #29944 (the costs of improving the precision further would not outweigh the gains).

6 years agoRollup merge of #47916 - vmx:patch-2, r=kennytm Fix lang items box example code The...
kennytm [Fri, 2 Feb 2018 08:29:21 +0000 (16:29 +0800)]
Rollup merge of #47916 - vmx:patch-2, r=kennytm Fix lang items box example code The `exchange_free` lang item is gone in favour of `box_free` [1]. Some warnings are also fixed by this commit. [1]: https://github.com/rust-lang/rust/commit/ca115dd083a1fe1d2b4892c5e50e49eb83ff1f3

6 years agoRollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, r=petrochenkov...
kennytm [Fri, 2 Feb 2018 08:29:20 +0000 (16:29 +0800)]
Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902

6 years agoRollup merge of #47898 - Aaron1011:static-ref-nll, r=nikomatsakis Fix ICE when assign...
kennytm [Fri, 2 Feb 2018 08:29:19 +0000 (16:29 +0800)]
Rollup merge of #47898 - Aaron1011:static-ref-nll, r=nikomatsakis Fix ICE when assigning references to a static mut with NLL is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789

6 years agoRollup merge of #47842 - Manishearth:dead-code, r=nagisa Remove dead code The Clone...
kennytm [Fri, 2 Feb 2018 08:29:17 +0000 (16:29 +0800)]
Rollup merge of #47842 - Manishearth:dead-code, r=nagisa Remove dead code The Clone impl makes the lint ignore the type.

6 years agoRollup merge of #47829 - estebank:break-in-for, r=cramertj Suggest removing value...
kennytm [Fri, 2 Feb 2018 08:29:16 +0000 (16:29 +0800)]
Rollup merge of #47829 - estebank:break-in-for, r=cramertj Suggest removing value from `break` when invalid When attempting to use `break` with a value in a type of loop where it'd be invalid (any non-`loop`), suggest using `break` on its own. Close #34359.

6 years agoRollup merge of #46156 - SimonSapin:patch-14, r=withoutboats
kennytm [Fri, 2 Feb 2018 08:29:11 +0000 (16:29 +0800)]
Rollup merge of #46156 - SimonSapin:patch-14, r=withoutboats

Document the size of bool

6 years agoAdd regression test
Manish Goregaokar [Fri, 2 Feb 2018 06:41:16 +0000 (12:11 +0530)]
Add regression test

6 years agoFix rustdoc ICE on macros defined within functions
Manish Goregaokar [Fri, 2 Feb 2018 06:39:25 +0000 (12:09 +0530)]
Fix rustdoc ICE on macros defined within functions

fixes #47639

6 years agoAuto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakis
bors [Fri, 2 Feb 2018 04:19:12 +0000 (04:19 +0000)]
Auto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakis

Include space in suggestion `mut` in bindings

Fix #46614.

6 years agoRemove dead code
Manish Goregaokar [Mon, 29 Jan 2018 05:44:55 +0000 (11:14 +0530)]
Remove dead code

6 years agoAuto merge of #47102 - Diggsey:wasm-syscall, r=alexcrichton
bors [Fri, 2 Feb 2018 01:27:14 +0000 (01:27 +0000)]
Auto merge of #47102 - Diggsey:wasm-syscall, r=alexcrichton

Implement extensible syscall interface for wasm

Currently it's possible to run tests with the native wasm target, but it's not possible to tell whether they pass or to capture the output, because libstd throws away stdout, stderr and the exit code. While advanced libstd features should probably require more specific targets (eg. wasm-unknown-web) I think even the unknown target should at least support basic I/O.

Any solution is constrained by these factors:
- It must not be javascript specific
- There must not be too strong coupling between libstd and the host environment (because it's an "unknown" target)
- WebAssembly does not allow "optional" imports - all imports *must* be resolved.
- WebAssembly does not support calling the host environment through any channel *other* than imports.

The best solution I could find to these constraints was to give libstd a single required import, and implement a syscall-style interface through that import. Each syscall is designed such that a no-op implementation gives the most reasonable fallback behaviour. This means that the following import table would be perfectly valid:
```javascript
imports.env = { rust_wasm_syscall: function(index, data) {} }
```

Currently I have implemented these system calls:
- Read from stdin
- Write to stdout/stderr
- Set the exit code
- Get command line arguments
- Get environment variable
- Set environment variable
- Get time

It need not be extended beyond this set if being able to run tests for this target is the only goal.

edit:
As part of this PR I had to make a further change. Previously, the rust entry point would be automatically called when the webassembly module was instantiated. This was problematic because from the javascript side it was impossible to call exported functions, access program memory or get a reference to the instance.

To solve this, ~I changed the default behaviour to not automatically call the entry point, and added a crate-level attribute to regain the old behaviour. (`#![wasm_auto_run]`)~ I disabled this behaviour when building tests.

6 years agoFix test after rebase
Esteban Küber [Thu, 1 Feb 2018 22:16:53 +0000 (14:16 -0800)]
Fix test after rebase

6 years agoRemove support for `Self` in attributes
Esteban Küber [Thu, 1 Feb 2018 20:12:55 +0000 (12:12 -0800)]
Remove support for `Self` in attributes

6 years agoFix tests
Esteban Küber [Tue, 23 Jan 2018 03:13:06 +0000 (19:13 -0800)]
Fix tests

6 years agoRework `parse_ident_attr`
Esteban Küber [Tue, 23 Jan 2018 03:03:51 +0000 (19:03 -0800)]
Rework `parse_ident_attr`

6 years agoRemove cast suggestions
Esteban Küber [Sat, 20 Jan 2018 10:36:39 +0000 (02:36 -0800)]
Remove cast suggestions

6 years agoAdd filter to detect local crates for rustc_on_unimplemented
Esteban Küber [Sat, 20 Jan 2018 09:33:39 +0000 (01:33 -0800)]
Add filter to detect local crates for rustc_on_unimplemented