]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoremove pluginmanager
steveklabnik [Wed, 11 Jul 2018 13:08:27 +0000 (09:08 -0400)]
remove pluginmanager

5 years agoAuto merge of #52211 - bjorn3:misc_rustdoc_changes, r=QuietMisdreavus
bors [Mon, 23 Jul 2018 09:37:03 +0000 (09:37 +0000)]
Auto merge of #52211 - bjorn3:misc_rustdoc_changes, r=QuietMisdreavus

Misc rustdoc changes

5 years agoAuto merge of #52612 - matthewjasper:remove-unnecessary-flow, r=nikomatsakis
bors [Mon, 23 Jul 2018 06:44:15 +0000 (06:44 +0000)]
Auto merge of #52612 - matthewjasper:remove-unnecessary-flow, r=nikomatsakis

Don't keep the possibly initialized flow around longer than needed

The possibly initialized flow isn't used after liveness is computed, so don't keep it around. Locally this is about a 10% time win for tuple-stress (which is spending a lot of time calculating flows now that it's not spending so much on liveness).

r? @nikomatsakis

5 years agoAuto merge of #52571 - oli-obk:promotion_abort, r=nagisa
bors [Mon, 23 Jul 2018 03:06:08 +0000 (03:06 +0000)]
Auto merge of #52571 - oli-obk:promotion_abort, r=nagisa

Abort if a promoted fails to be const evaluable and its runtime checks didn't trigger

r? @eddyb

cc @RalfJung @nagisa

cc https://github.com/rust-lang/rust/issues/49760

5 years agoAuto merge of #52568 - oli-obk:span_bug_error, r=varkor
bors [Mon, 23 Jul 2018 01:02:32 +0000 (01:02 +0000)]
Auto merge of #52568 - oli-obk:span_bug_error, r=varkor

Fix loop label resolution around constants

And make `delay_span_bug` a little more helpful

r? @varkor

fixes #52442
fixes #52443

5 years agoAuto merge of #52564 - pnkfelix:issue-52126-lhs-of-assign-op-is-invariant, r=eddyb
bors [Sun, 22 Jul 2018 23:05:11 +0000 (23:05 +0000)]
Auto merge of #52564 - pnkfelix:issue-52126-lhs-of-assign-op-is-invariant, r=eddyb

LHS of assign op is invariant

This addresses a bug injected by #45435. That PR changed the way we type-check `LHS <op> RHS` to coerce the LHS to the expected supertype in much the same way that we coerce the RHS.

The problem is that when we have a case of `LHS <op>= RHS`, we do not want to coerce to a supertype; we need the type to remain invariant. Otherwise we risk leaking a value with short-lifetimes into a expression context that needs to satisfy a long lifetime.

Fix #52126

5 years agoAuto merge of #52069 - zackmdavis:elided_states_of_america—and_to_the_re-pub-lic...
bors [Sun, 22 Jul 2018 20:54:05 +0000 (20:54 +0000)]
Auto merge of #52069 - zackmdavis:elided_states_of_america—and_to_the_re-pub-lic, r=nikomatsakis

add structured suggestions and fix false-positive for elided-lifetimes-in-paths lint

This adds structured suggestions to the elided-lifetimes-in-paths lint (introduced in Nov. 2017's #46254), prevents it from emitting a false-positive on anonymous (underscore) lifetimes (!), and adds it to the idioms-2018 group (#52041).

~~As an aside, "elided-lifetimes-in-paths" seems like an unfortunate name, because it's not clear exactly what "elided" means. The motivation for this lint (see original issue #45992, and [RFC 2115](https://github.com/rust-lang/rfcs/blob/e978a8d3017a01d632f916140c98802505cd1324/text/2115-argument-lifetimes.md#motivation)) seems to be specifically about not supplying angle-bracketed lifetime arguments to non-`&` types, but (1) the phrase "lifetime elision" has historically also referred to the ability to not supply a lifetime name to `&` references, and (2) an `is_elided` method in the HIR returns true for anoymous/underscore lifetimes, which is _not_ what we're trying to lint here. (That naming confusion is almost certainly what led to the false positive addressed here.) Given that the lint is relatively new and is allow-by-default, is it too late to rename it ... um, _again_ (#50879)?~~

~~This does _not_ address a couple of other false positives discovered in https://github.com/rust-lang/rust/issues/52041#issuecomment-402547901.~~

![elided_states](https://user-images.githubusercontent.com/1076988/42302137-2bf9479c-7fce-11e8-8bd0-f29aefc802b6.png)

r? @nikomatsakis
cc @nrc @petrochenkov

5 years agoAuto merge of #52616 - kennytm:rollup, r=kennytm
bors [Sun, 22 Jul 2018 18:51:46 +0000 (18:51 +0000)]
Auto merge of #52616 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #51807 (Deprecation of str::slice_unchecked(_mut))
 - #52051 (mem::swap the obvious way for types smaller than the SIMD optimization's block size)
 - #52465 (Add CI test harness for `thumb*` targets. [IRR-2018-embedded])
 - #52507 (Reword when `_` couldn't be inferred)
 - #52508 (Document that Unique::empty() and NonNull::dangling() aren't sentinel values)
 - #52521 (Fix links in rustdoc book.)
 - #52581 (Avoid using `#[macro_export]` for documenting builtin macros)
 - #52582 (Typo)
 - #52587 (Add missing backtick in UniversalRegions doc comment)
 - #52594 (Run the error index tool against the sysroot libdir)
 - #52615 (Added new lines to .gitignore.)

5 years agoRollup merge of #52051 - scottmcm:swap-directly, r=alexcrichton
kennytm [Sun, 22 Jul 2018 17:02:41 +0000 (01:02 +0800)]
Rollup merge of #52051 - scottmcm:swap-directly, r=alexcrichton

mem::swap the obvious way for types smaller than the SIMD optimization's block size

LLVM isn't able to remove the alloca for the unaligned block in the post-SIMD tail in some cases, so doing this helps SRoA work in cases where it currently doesn't.  Found in the `replace_with` RFC discussion.

Examples of the improvements:
<details>
 <summary>swapping `[u16; 3]` takes 1/3 fewer instructions and no stackalloc</summary>

```rust
type Demo = [u16; 3];
pub fn swap_demo(x: &mut Demo, y: &mut Demo) {
    std::mem::swap(x, y);
}
```

nightly:
```asm
_ZN4blah9swap_demo17ha1732a9b71393a7eE:
.seh_proc _ZN4blah9swap_demo17ha1732a9b71393a7eE
sub rsp, 32
.seh_stackalloc 32
.seh_endprologue
movzx eax, word ptr [rcx + 4]
mov word ptr [rsp + 4], ax
mov eax, dword ptr [rcx]
mov dword ptr [rsp], eax
movzx eax, word ptr [rdx + 4]
mov word ptr [rcx + 4], ax
mov eax, dword ptr [rdx]
mov dword ptr [rcx], eax
movzx eax, word ptr [rsp + 4]
mov word ptr [rdx + 4], ax
mov eax, dword ptr [rsp]
mov dword ptr [rdx], eax
add rsp, 32
ret
.seh_handlerdata
.section .text,"xr",one_only,_ZN4blah9swap_demo17ha1732a9b71393a7eE
.seh_endproc
```

this PR:
```asm
_ZN4blah9swap_demo17ha1732a9b71393a7eE:
mov r8d, dword ptr [rcx]
movzx r9d, word ptr [rcx + 4]
movzx eax, word ptr [rdx + 4]
mov word ptr [rcx + 4], ax
mov eax, dword ptr [rdx]
mov dword ptr [rcx], eax
mov word ptr [rdx + 4], r9w
mov dword ptr [rdx], r8d
ret
```
</details>

<details>
 <summary>`replace_with` optimizes down much better</summary>

Inspired by https://github.com/rust-lang/rfcs/pull/2490,

```rust
fn replace_with<T, F>(x: &mut Option<T>, f: F)
    where F: FnOnce(Option<T>) -> Option<T>
{
    *x = f(x.take());
}

pub fn inc_opt(mut x: &mut Option<i32>) {
    replace_with(&mut x, |i| i.map(|j| j + 1));
}
```

Rust 1.26.0:
```asm
_ZN4blah7inc_opt17heb0acb64c51777cfE:
mov rax, qword ptr [rcx]
movabs r8, 4294967296
add r8, rax
shl rax, 32
movabs rdx, -4294967296
and rdx, r8
xor r8d, r8d
test rax, rax
cmove rdx, rax
setne r8b
or rdx, r8
mov qword ptr [rcx], rdx
ret
```

Nightly (better thanks to ScalarPair, maybe?):
```asm
_ZN4blah7inc_opt17h66df690be0b5899dE:
mov r8, qword ptr [rcx]
mov rdx, r8
shr rdx, 32
xor eax, eax
test r8d, r8d
setne al
add edx, 1
mov dword ptr [rcx], eax
mov dword ptr [rcx + 4], edx
ret
```

This PR:
```asm
_ZN4blah7inc_opt17h1426dc215ecbdb19E:
xor eax, eax
cmp dword ptr [rcx], 0
setne al
mov dword ptr [rcx], eax
add dword ptr [rcx + 4], 1
ret
```

Where that add is beautiful -- using an addressing mode to not even need to explicitly go through a register -- and the remaining imperfection is well-known (https://github.com/rust-lang/rust/pull/49420#issuecomment-376805721).
</details>

5 years agoRollup merge of #52615 - davidtwco:add-to-gitignore, r=nikomatsakis,Mark-Simulacrum
kennytm [Sun, 22 Jul 2018 14:10:21 +0000 (22:10 +0800)]
Rollup merge of #52615 - davidtwco:add-to-gitignore, r=nikomatsakis,Mark-Simulacrum

Added new lines to .gitignore.

There are a handful of files that I often find in my local working directories that I never want to commit that aren't covered in the `.gitignore` file:

`/mir_dump`:
Default output location from `-Z mir-dump=all` for a specific test, I can't think of a reason why this should ever be commited.

`tags*`/`TAGS*`:
I use `vim-gutentags` which outputs `tags` and `tags.temp` which I don't want commited. I also collapsed the `TAGS`, `TAGS.vi`, `TAGS.emacs` into `TAGS*`.

`Session.vim`:
I use `vim-obsession` to save my current session in Vim, it outputs a `Session.vim` file, this also shouldn't be commited.

5 years agoRollup merge of #52594 - Mark-Simulacrum:error-index-stage0, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:20 +0000 (22:10 +0800)]
Rollup merge of #52594 - Mark-Simulacrum:error-index-stage0, r=alexcrichton

Run the error index tool against the sysroot libdir

Previously when building the error index tool in stage 0 we would
attempt to use stage 0 libraries, but because it depends on rustdoc,
those don't exist: rustdoc is built against stage 1 libraries.

This patch aligns those two and passes the stage 1 libdir to the error
index.

@GuillaumeGomez discovered that this hasn't worked (presumably for a long time now, but not sure).

r? @alexcrichton

5 years agoRollup merge of #52587 - csmoe:doc, r=kennytm
kennytm [Sun, 22 Jul 2018 14:10:18 +0000 (22:10 +0800)]
Rollup merge of #52587 - csmoe:doc, r=kennytm

Add missing backtick in UniversalRegions doc comment

r? @QuietMisdreavus

5 years agoRollup merge of #52582 - felixrabe:patch-2, r=pietroalbini
kennytm [Sun, 22 Jul 2018 14:10:17 +0000 (22:10 +0800)]
Rollup merge of #52582 - felixrabe:patch-2, r=pietroalbini

Typo

5 years agoRollup merge of #52581 - petrochenkov:bmacrodoc, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:16 +0000 (22:10 +0800)]
Rollup merge of #52581 - petrochenkov:bmacrodoc, r=alexcrichton

Avoid using `#[macro_export]` for documenting builtin macros

Use a special `rustc_*` attribute instead.

cc https://github.com/rust-lang/rust/pull/52234

5 years agoAuto merge of #52572 - davidtwco:issue-51027, r=nikomatsakis
bors [Sun, 22 Jul 2018 16:48:09 +0000 (16:48 +0000)]
Auto merge of #52572 - davidtwco:issue-51027, r=nikomatsakis

NLL diagnostics replaced nice closure errors w/ indecipherable free region errors

Fixes #51027.

r? @nikomatsakis

5 years agoin which the elided-lifetimes-in-paths lint undergoes a revolution
Zack M. Davis [Tue, 17 Jul 2018 07:30:53 +0000 (00:30 -0700)]
in which the elided-lifetimes-in-paths lint undergoes a revolution

The existing elided-lifetimes-in-paths lint (introduced in Nov. 2017's
accd997b5 / #46254) lacked stuctured suggestions and—much more
alarmingly—produced false positives on associated functions (like
`Ref::clone`) and on anonymous '_ lifetimes (!!—yes, the very
anonymous lifetimes that we meant to suggest "instead"). That this
went apparently unnoticed for so long maybe tells you something about
how many people actually bother to flip on allow-by-default lints.

After many hours of good old-fashioned American elbow grease—and a
little help from expert reviewers—it turns out that getting the right
answer is a lot easier if we fire the lint while lowering the Higher
Intermediate Representation.

The lint is promoted to the idioms-2018 group.

Also, in the matter of test filenames, "elided" only has one 'l' (see,
e.g., https://en.wiktionary.org/wiki/elide).

Resolves #52041.

5 years agoRollup merge of #52521 - ehuss:rustdoc-passes-doc, r=kennytm
kennytm [Sun, 22 Jul 2018 14:10:14 +0000 (22:10 +0800)]
Rollup merge of #52521 - ehuss:rustdoc-passes-doc, r=kennytm

Fix links in rustdoc book.

Due to a change in how mdbook generates section anchors, headers
with non-alphabetic characters now start with "a".

5 years agoRollup merge of #52508 - joshtriplett:dangling-not-sentinel, r=Mark-Simulacrum
kennytm [Sun, 22 Jul 2018 14:10:13 +0000 (22:10 +0800)]
Rollup merge of #52508 - joshtriplett:dangling-not-sentinel, r=Mark-Simulacrum

Document that Unique::empty() and NonNull::dangling() aren't sentinel values

The documentation of Unique::empty() and NonNull::dangling() could
potentially suggest that they work as sentinel values indicating a
not-yet-initialized pointer. However, they both declare a non-null
pointer equal to the alignment of the type, which could potentially
reference a valid value of that type (specifically, the first such valid
value in memory). Explicitly document that the return value of these
functions does not work as a sentinel value.

5 years agoRollup merge of #52507 - estebank:infer-type, r=nikomatsakis
kennytm [Sun, 22 Jul 2018 14:10:11 +0000 (22:10 +0800)]
Rollup merge of #52507 - estebank:infer-type, r=nikomatsakis

Reword when `_` couldn't be inferred

r? @nikomatsakis

5 years agoRollup merge of #52465 - sekineh:add-ci-thumb, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:10 +0000 (22:10 +0800)]
Rollup merge of #52465 - sekineh:add-ci-thumb, r=alexcrichton

Add CI test harness for `thumb*` targets. [IRR-2018-embedded]

This pull request will do the following (rather trivial) changes:
- Fix #52163. In other words, we enabled `./x.py test src/test/run-make` for `no_std` targets.
- Modify `dist-various-1` Dockerfile.
  - CI now performs `run-make` test run on the targets below:
    - `thumbv6m-none-eabi`
    - `thumbv7m-none-eabi`
    - `thumbv7em-none-eabi`
    - `thumbv7em-none-eabihf`.
- ~~Add `thumb-none` Dockerfile.~~
  - ~~Initially, `thumbv7m-none-eabi`, `thumbv7em-none-eabi` and `thumbv7em-none-eabihf` are included as the tested target. `thumbv6m-none-eabi` is disabled for now because LLVM support is not certain.~~
- ~~Add `thumb-none` to .travis.yml~~

Note:
- `run-make` tests are not implemented yet. This PR is test harness only.

The amount of change is very small, but I'd like to open the pull request while the change is trivial.
Because I'm not very used to pull request process, I want to make a small progress first.  This PR will be a foundation for later additions.

CC @kennytm @jamesmunns @nerdyvaishali

5 years agoRollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:09 +0000 (22:10 +0800)]
Rollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichton

Deprecation of str::slice_unchecked(_mut)

Closes #51715

I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0.

Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.

5 years agoAdded new lines to .gitignore.
David Wood [Sun, 22 Jul 2018 12:14:06 +0000 (13:14 +0100)]
Added new lines to .gitignore.

5 years agoUse correct exclusion comment
Oliver Schneider [Sun, 22 Jul 2018 12:44:17 +0000 (14:44 +0200)]
Use correct exclusion comment

5 years agoFallback to general error handling in ICE cases.
David Wood [Sat, 21 Jul 2018 14:50:06 +0000 (15:50 +0100)]
Fallback to general error handling in ICE cases.

5 years agoModified how constraint classification happens to upvars, can now handle function...
David Wood [Sat, 21 Jul 2018 14:03:47 +0000 (15:03 +0100)]
Modified how constraint classification happens to upvars, can now handle function call case.

5 years agoImproved is_upvar_field_projection - no longer need recurse parameter.
David Wood [Sat, 21 Jul 2018 13:16:25 +0000 (14:16 +0100)]
Improved is_upvar_field_projection - no longer need recurse parameter.

5 years agoImproved documentation of functions in new module.
David Wood [Sat, 21 Jul 2018 12:10:33 +0000 (13:10 +0100)]
Improved documentation of functions in new module.

5 years agoImproved closure errors.
David Wood [Fri, 20 Jul 2018 16:30:31 +0000 (17:30 +0100)]
Improved closure errors.

5 years agoClassify aggregate rvalues as assignments.
David Wood [Fri, 20 Jul 2018 11:32:58 +0000 (12:32 +0100)]
Classify aggregate rvalues as assignments.

5 years agoAuto merge of #52368 - GuillaumeGomez:intra_doc_link_resolution_failure-documented...
bors [Sun, 22 Jul 2018 10:48:15 +0000 (10:48 +0000)]
Auto merge of #52368 - GuillaumeGomez:intra_doc_link_resolution_failure-documented, r=QuietMisdreavus

Add "self" intra-link support

Fixes #49583.

r? @QuietMisdreavus

5 years agoDon't keep the possibly init flow around longer than needed
Matthew Jasper [Sun, 22 Jul 2018 10:02:59 +0000 (11:02 +0100)]
Don't keep the possibly init flow around longer than needed

5 years agoAuto merge of #52359 - matthewjasper:combine-move-error-reporting, r=pnkfelix
bors [Sun, 22 Jul 2018 08:52:05 +0000 (08:52 +0000)]
Auto merge of #52359 - matthewjasper:combine-move-error-reporting, r=pnkfelix

[NLL] Small move error reporting improvements

* Use a MirBorrowckContext when reporting errors to be more uniform with other error reporting
* Add a special message for the case of trying to move from capture variables in `Fn` and `FnMut` closures.

part of #51028

5 years agoAuto merge of #52394 - estebank:println, r=oli-obk
bors [Sun, 22 Jul 2018 06:52:48 +0000 (06:52 +0000)]
Auto merge of #52394 - estebank:println, r=oli-obk

Improve suggestion for missing fmt str in println

Avoid using `concat!(fmt, "\n")` to improve the diagnostics being
emitted when the first `println!()` argument isn't a formatting string
literal.

Fix #52347.

5 years agoOnly run the test on x86_64
Scott McMurray [Sun, 22 Jul 2018 06:12:46 +0000 (23:12 -0700)]
Only run the test on x86_64

Smaller platforms don't merge the loads the same way.

5 years agoDon't use SIMD in mem::swap for types smaller than the block size
Scott McMurray [Wed, 4 Jul 2018 09:48:30 +0000 (02:48 -0700)]
Don't use SIMD in mem::swap for types smaller than the block size

LLVM isn't able to remove the alloca for the unaligned block in the SIMD tail in some cases, so doing this helps SRoA work in cases where it currently doesn't.  Found in the `replace_with` RFC discussion.

5 years agofix test
Esteban Küber [Sun, 22 Jul 2018 03:48:15 +0000 (20:48 -0700)]
fix test

5 years agoAuto merge of #52250 - nnethercote:no-SparseBitMatrix, r=nikomatsakis
bors [Sun, 22 Jul 2018 02:43:57 +0000 (02:43 +0000)]
Auto merge of #52250 - nnethercote:no-SparseBitMatrix, r=nikomatsakis

Speed up `SparseBitMatrix` use in `RegionValues`.

In practice, these matrices range from 10% to 90%+ full once they are
filled in, so the dense representation is better.

This reduces the runtime of Check Nll builds of `inflate` by 32%, and
several other benchmarks by 1--5%.

It also increases max-rss of `clap-rs` by 30% and a couple of others by
up to 5%, while decreasing max-rss of `coercions` by 14%. I think the
speed-ups justify the max-rss increases.

r? @nikomatsakis

5 years agofix tidy ~ again
Esteban Küber [Sun, 22 Jul 2018 01:24:10 +0000 (18:24 -0700)]
fix tidy ~ again

5 years agoDon't use the new `eprintln` for stage0 and stage1
Esteban Küber [Sun, 22 Jul 2018 00:59:17 +0000 (17:59 -0700)]
Don't use the new `eprintln` for stage0 and stage1

I'm not entirely sure why (or if) this is needed.

5 years agoFix tidy by adding new feature gate test
Esteban Küber [Sun, 22 Jul 2018 00:35:09 +0000 (17:35 -0700)]
Fix tidy by adding new feature gate test

5 years agofix logic bug
Esteban Küber [Sun, 22 Jul 2018 00:17:49 +0000 (17:17 -0700)]
fix logic bug

5 years agoAuto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomez
bors [Sat, 21 Jul 2018 23:50:28 +0000 (23:50 +0000)]
Auto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomez

Remove highlighting from secondary messages

Deemphasize the secondary messages so that all other highlights stand
out more.

<img width="684" alt="" src="https://user-images.githubusercontent.com/1606434/41261199-7b4fe96e-6d8f-11e8-8619-04d170617df2.png">

5 years agoRemove dependency on `libsyntax`
Esteban Küber [Sat, 21 Jul 2018 23:18:06 +0000 (16:18 -0700)]
Remove dependency on `libsyntax`

5 years agoChange `eprintln!()`
Esteban Küber [Sat, 21 Jul 2018 22:56:37 +0000 (15:56 -0700)]
Change `eprintln!()`

Address #30143 as well. `writeln!()` hasn't been changed.

5 years agoGate `format_args_nll` behind feature flag
Esteban Küber [Sat, 21 Jul 2018 22:50:46 +0000 (15:50 -0700)]
Gate `format_args_nll` behind feature flag

5 years agoAdd "self" intra-link support
Guillaume Gomez [Thu, 12 Jul 2018 20:00:57 +0000 (22:00 +0200)]
Add "self" intra-link support

5 years agoRun the error index tool against the sysroot libdir
Mark Rousskov [Sat, 21 Jul 2018 21:19:39 +0000 (15:19 -0600)]
Run the error index tool against the sysroot libdir

Previously when building the error index tool in stage 0 we would
attempt to use stage 0 libraries, but because it depends on rustdoc,
those don't exist: rustdoc is built against stage 1 libraries.

This patch aligns those two and passes the stage 1 libdir to the error
index.

5 years agoAuto merge of #52115 - Dylan-DPC:feature/nll-liveness-regions, r=nikomatsakis
bors [Sat, 21 Jul 2018 21:01:17 +0000 (21:01 +0000)]
Auto merge of #52115 - Dylan-DPC:feature/nll-liveness-regions, r=nikomatsakis

only compute liveness for variables whose types include regions

Closes #52034

r? @nikomatsakis

5 years agodon't spawn processes on wasm
Oliver Schneider [Sat, 21 Jul 2018 20:59:40 +0000 (22:59 +0200)]
don't spawn processes on wasm

5 years agoSuggest space separated format str literal
Esteban Küber [Sat, 21 Jul 2018 19:16:06 +0000 (12:16 -0700)]
Suggest space separated format str literal

5 years agoAuto merge of #51959 - tmandry:make-implied-outlives-query, r=nikomatsakis
bors [Sat, 21 Jul 2018 18:51:13 +0000 (18:51 +0000)]
Auto merge of #51959 - tmandry:make-implied-outlives-query, r=nikomatsakis

Turn implied_outlives_bounds into a query

Right now all this does is remove the error reporting in `implied_outlives_bounds`, which seems to work. Farming out full tests to Travis.

For #51649. That issue is deferred so not sure what's next.

r? @nikomatsakis

5 years agoupdate tests
Matthew Jasper [Thu, 19 Jul 2018 20:15:10 +0000 (21:15 +0100)]
update tests

5 years agoFix #52416 - ice for move errors in unsafe blocks
Matthew Jasper [Wed, 18 Jul 2018 20:03:07 +0000 (21:03 +0100)]
Fix #52416 - ice for move errors in unsafe blocks

5 years agoAdd specific message when moving from upvars in a non-FnOnce closure
Matthew Jasper [Fri, 13 Jul 2018 22:39:10 +0000 (23:39 +0100)]
Add specific message when moving from upvars  in a non-FnOnce closure

5 years agoUse MirBorrowckCtxt while reporting move errors
Matthew Jasper [Fri, 13 Jul 2018 20:56:04 +0000 (21:56 +0100)]
Use MirBorrowckCtxt while reporting move errors

5 years agoAuto merge of #52405 - matthewjasper:mutability-errors, r=pnkfelix
bors [Sat, 21 Jul 2018 14:37:45 +0000 (14:37 +0000)]
Auto merge of #52405 - matthewjasper:mutability-errors, r=pnkfelix

[NLL] Mutability errors

cc #51028
cc #51170
cc #46559
Closes #46629

* Better explain why the place is immutable ("immutable item" is gone)
* Distinguish &T and *const T
* Use better spans when a mutable borrow is for a closure capture

r? @pnkfelix

5 years agoAdd missing backtick
csmoe [Sat, 21 Jul 2018 14:23:50 +0000 (22:23 +0800)]
Add missing backtick

5 years agodelete tests
dylan_DPC [Sat, 21 Jul 2018 14:16:41 +0000 (19:46 +0530)]
delete tests

5 years agoSequence-field should have plural name
Oliver Schneider [Sat, 21 Jul 2018 14:09:10 +0000 (16:09 +0200)]
Sequence-field should have plural name

5 years agoTreat no_std(target) == None case correctly.
Hideki Sekine [Sat, 21 Jul 2018 13:39:35 +0000 (22:39 +0900)]
Treat no_std(target) == None case correctly.

5 years agowe now get 2 extra mismatched type errors
Niko Matsakis [Thu, 19 Jul 2018 04:10:35 +0000 (00:10 -0400)]
we now get 2 extra mismatched type errors

These new errors actually seem a *tad* clearer than the old one, so
that's good, but now there are 3. Maybe call it a wash?

5 years agouse proper body-id and span when solving obligations
Niko Matsakis [Wed, 18 Jul 2018 19:24:00 +0000 (15:24 -0400)]
use proper body-id and span when solving obligations

5 years agoadd regression test for #52078
Niko Matsakis [Wed, 18 Jul 2018 18:59:36 +0000 (14:59 -0400)]
add regression test for #52078

Fixes #52078

5 years agoskip no-op obligations and add a little debug output
Niko Matsakis [Wed, 18 Jul 2018 15:05:07 +0000 (11:05 -0400)]
skip no-op obligations and add a little debug output

5 years agoConvert implied_outlives_bounds to a query
Tyler Mandry [Wed, 4 Jul 2018 18:07:45 +0000 (13:07 -0500)]
Convert implied_outlives_bounds to a query

5 years agoAuto merge of #52562 - Manishearth:clippyup, r=RalfJung
bors [Sat, 21 Jul 2018 12:32:17 +0000 (12:32 +0000)]
Auto merge of #52562 - Manishearth:clippyup, r=RalfJung

Update clippy

r? @kennytm @oli-obk

5 years agoadd docs
dylan_DPC [Sat, 21 Jul 2018 11:51:04 +0000 (17:21 +0530)]
add docs

5 years agoDon't invent new magic keywords
Oliver Schneider [Sat, 21 Jul 2018 10:36:18 +0000 (12:36 +0200)]
Don't invent new magic keywords

5 years agoAuto merge of #52555 - petrochenkov:mresfact, r=alexcrichton
bors [Sat, 21 Jul 2018 10:30:11 +0000 (10:30 +0000)]
Auto merge of #52555 - petrochenkov:mresfact, r=alexcrichton

resolve: Some renaming, refactoring and comments

Commits are self-descriptive.
The only functional change is https://github.com/rust-lang/rust/commit/34bf2f572e33d4df1459413b5014ca98fc9fa4e0 that tightens shadowing rules for macro paths (makes the second and third cases in `test/ui/imports/glob-shadowing.rs` an error).

5 years agoTypo
Felix Rabe [Sat, 21 Jul 2018 09:49:52 +0000 (11:49 +0200)]
Typo

5 years agoAuto merge of #52552 - eddyb:proc-macro-prep, r=alexcrichton
bors [Sat, 21 Jul 2018 08:31:32 +0000 (08:31 +0000)]
Auto merge of #52552 - eddyb:proc-macro-prep, r=alexcrichton

Prepare proc_macro for decoupling it from the rest of the compiler.

This is #49219 up to the point where the bridge is introduced. Aside from moving some code around, the largest change is the rewrite of `proc_macro::quote` to be simpler and do less introspection.

I'd like to also extend `quote!` with `${stmt;...;expr}` instead of just `$variable` (and maybe even `$(... $iter ...)*`), which seems pretty straight-forward now, but I don't know if/when I should.

r? @alexcrichton or @dtolnay cc @jseyfried @petrochenkov

5 years agoAuto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum
bors [Sat, 21 Jul 2018 06:26:18 +0000 (06:26 +0000)]
Auto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum

Update stdsimd to undo an accidental stabilization

Closes #52403

5 years agoremove unwanted tests and a reference to it in comments
dylan_DPC [Sat, 21 Jul 2018 06:12:44 +0000 (11:42 +0530)]
remove unwanted tests and a reference to it in comments

5 years agoUpdate stdsimd to undo an accidental stabilization
Alex Crichton [Thu, 19 Jul 2018 14:01:37 +0000 (07:01 -0700)]
Update stdsimd to undo an accidental stabilization

Closes #52403

5 years agoAuto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis
bors [Sat, 21 Jul 2018 04:19:15 +0000 (04:19 +0000)]
Auto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis

proc_macro: Preserve spans of attributes on functions

This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.

Closes #47941

5 years agoAuto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb
bors [Sat, 21 Jul 2018 00:55:46 +0000 (00:55 +0000)]
Auto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb

Calculate Vec capacities in librustc

Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.

5 years agoAvoid using `#[macro_export]` for documenting builtin macros
Vadim Petrochenkov [Fri, 20 Jul 2018 23:49:34 +0000 (02:49 +0300)]
Avoid using `#[macro_export]` for documenting builtin macros

5 years agoAuto merge of #52574 - kennytm:rollup, r=kennytm
bors [Fri, 20 Jul 2018 22:52:11 +0000 (22:52 +0000)]
Auto merge of #52574 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #52502 (fix unsafety: don't call ptr_rotate for ZST)
 - #52505 (rustc: Remove a workaround in ThinLTO fixed upstream)
 - #52526 (Enable run-pass/sepcomp-lib-lto.rs on Android)
 - #52527 (Remove duplicate E0396 tests)
 - #52539 (rustc: Fix two custom attributes with custom derive)
 - #52540 (Fix docker/run.sh script when run locally)
 - #52573 (Cleanups)

Failed merges:

r? @ghost

5 years agofix grep test looking for newline
Esteban Küber [Fri, 20 Jul 2018 20:43:06 +0000 (13:43 -0700)]
fix grep test looking for newline

5 years agoClippy opts out of in_external_macro
Oliver Schneider [Fri, 20 Jul 2018 20:50:32 +0000 (22:50 +0200)]
Clippy opts out of in_external_macro

5 years agoAllow individual lints to opt into being reported in external macros
Oliver Schneider [Fri, 20 Jul 2018 20:45:52 +0000 (22:45 +0200)]
Allow individual lints to opt into being reported in external macros

5 years agoRollup merge of #52573 - oli-obk:cleanups, r=RalfJung
kennytm [Fri, 20 Jul 2018 18:59:13 +0000 (02:59 +0800)]
Rollup merge of #52573 - oli-obk:cleanups, r=RalfJung

Cleanups

r? @RalfJung

5 years agoRollup merge of #52540 - alexcrichton:tweak-script, r=kennytm
kennytm [Fri, 20 Jul 2018 18:59:10 +0000 (02:59 +0800)]
Rollup merge of #52540 - alexcrichton:tweak-script, r=kennytm

Fix docker/run.sh script when run locally

Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.

5 years agoRollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov
kennytm [Fri, 20 Jul 2018 18:59:09 +0000 (02:59 +0800)]
Rollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov

rustc: Fix two custom attributes with custom derive

This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.

The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.

Closes #52525

5 years agoRollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk
kennytm [Fri, 20 Jul 2018 18:59:08 +0000 (02:59 +0800)]
Rollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk

Remove duplicate E0396 tests

Resolves FIXME #13973 (erroneously marked as #13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.

5 years agoRollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton
kennytm [Fri, 20 Jul 2018 18:59:06 +0000 (02:59 +0800)]
Rollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton

Enable run-pass/sepcomp-lib-lto.rs on Android

#18800 is fixed, so it should be safe to restore this test.

5 years agoRollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis
kennytm [Fri, 20 Jul 2018 18:59:05 +0000 (02:59 +0800)]
Rollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis

rustc: Remove a workaround in ThinLTO fixed upstream

This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!

[1]: https://bugs.llvm.org/show_bug.cgi?id=35736

5 years agoRollup merge of #52502 - RalfJung:rotate, r=scottmcm
kennytm [Fri, 20 Jul 2018 18:59:04 +0000 (02:59 +0800)]
Rollup merge of #52502 - RalfJung:rotate, r=scottmcm

fix unsafety: don't call ptr_rotate for ZST

`rotate::ptr_rotate` has a comment saying
```
/// # Safety
///
/// The specified range must be valid for reading and writing.
/// The type `T` must have non-zero size.
```
So we better make sure we don't call it on ZST...

Cc @scottmcm (author of https://github.com/rust-lang/rust/pull/41670)

5 years agoRefactor a few push loops to iterators in librustc
ljedrz [Mon, 16 Jul 2018 17:35:45 +0000 (19:35 +0200)]
Refactor a few push loops to iterators in librustc

5 years agoUpdate tests for new NLL mutability errors
Matthew Jasper [Tue, 17 Jul 2018 19:29:48 +0000 (20:29 +0100)]
Update tests for new NLL mutability errors

5 years agoImprove NLL mutability errors
Matthew Jasper [Sun, 15 Jul 2018 14:51:35 +0000 (15:51 +0100)]
Improve NLL mutability errors

* Better explain why the place is immutable
* Distinguish &T and *const T
* Use better spans when a mutable borrow is for a closure capture

5 years agoMove mutability error reporting to its own file
Matthew Jasper [Sun, 15 Jul 2018 14:11:29 +0000 (15:11 +0100)]
Move mutability error reporting to its own file

5 years agoMIR changes to improve NLL cannot mutate errors
Matthew Jasper [Sun, 15 Jul 2018 14:00:58 +0000 (15:00 +0100)]
MIR changes to improve NLL cannot mutate errors

Alway use unique instead of mutable borrows immutable upvars.
Mark variables that are references for a match guard

5 years agoUpdate clippy
Manish Goregaokar [Fri, 20 Jul 2018 07:53:56 +0000 (00:53 -0700)]
Update clippy

5 years agofix rebase
Esteban Küber [Fri, 20 Jul 2018 18:04:23 +0000 (11:04 -0700)]
fix rebase

5 years agoAuto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez
bors [Fri, 20 Jul 2018 18:02:05 +0000 (18:02 +0000)]
Auto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez

stabilize lint handling in rustdoc

When https://github.com/rust-lang/rust/pull/51732 added CLI flags to manipulate lints in rustdoc, they were added as unstable flags. This made sense as they were new additions, but since they mirrored the flags that rustc has, it's worth considering them to not need an unstable period.

Stabilizing them also provides the opportunity for a critical fix: allowing Cargo to pass `--cap-lints allow` when documenting dependencies, the same as when it compiles them.

r? @rust-lang/rustdoc

5 years agoAdd trailing newline
Oliver Schneider [Fri, 20 Jul 2018 17:55:16 +0000 (19:55 +0200)]
Add trailing newline

5 years agoAdd test
Oliver Schneider [Fri, 20 Jul 2018 17:35:08 +0000 (19:35 +0200)]
Add test

5 years agoAbort instead of UB if promotion fails
Oliver Schneider [Fri, 20 Jul 2018 16:43:46 +0000 (18:43 +0200)]
Abort instead of UB if promotion fails

5 years agoRemove unused method
Oliver Schneider [Fri, 20 Jul 2018 16:42:45 +0000 (18:42 +0200)]
Remove unused method