]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #51729 - matthewjasper:move-errors, r=nikomatsakis
bors [Fri, 29 Jun 2018 12:40:12 +0000 (12:40 +0000)]
Auto merge of #51729 - matthewjasper:move-errors, r=nikomatsakis

[NLL] Better move errors

Make a number of changes to improve the quality of NLL cannot move errors.

* Group errors that occur in the same `match` with the same cause.
* Suggest `ref`, `&` or removing `*` to avoid the move.
* Show the place being matched on.

Differences from AST borrowck:

* `&` is suggested over `ref` when matching on a place that can't be moved from.
* Removing `*` is suggested instead of adding `&` when applicable.
* Sub-pattern spans aren't used, this would probably need Spans on Places.

Closes #45699
Closes #46627
Closes #51187
Closes #51189

r? @pnkfelix

6 years agoAuto merge of #50526 - moxian:just-fix, r=alexcrichton
bors [Fri, 29 Jun 2018 09:42:40 +0000 (09:42 +0000)]
Auto merge of #50526 - moxian:just-fix, r=alexcrichton

Add a fallback for stacktrace printing for older Windows versions.

Some time ago we switched stack inspection functions of dbghelp.dll to their newer alternatives that also capture inlined context.
Unfortunately, said new alternatives are not present in older dbghelp.dll versions.
In particular Windows 7 at the time of writing has dbghelp.dll version 6.1.7601 from 2010, that lacks StackWalkEx and friends.

Tested on my Windows 7 - both msvc and gnu versions produce a readable stacktrace.

Fixes #50138

6 years agoAuto merge of #51290 - Pslydhh:master, r=alexcrichton
bors [Fri, 29 Jun 2018 07:34:13 +0000 (07:34 +0000)]
Auto merge of #51290 - Pslydhh:master, r=alexcrichton

park/park_timeout: prohibit spurious wakeups in next park

<pre><code>
// The implementation currently uses the trivial strategy of a Mutex+Condvar
// with wakeup flag, which does not actually allow spurious wakeups.
</pre></code>

Because does not actually allow spurious wakeups.
so we have let thread.inner.cvar.wait(m) in the loop to prohibit spurious wakeups.
but if notified after we locked, this notification doesn't be consumed, it return, the next park will consume this notification...this is also 'spurious wakeup' case, 'one unpark() wakeups two  park()'.

We should improve this situation:
`thread.inner.state.store(EMPTY, SeqCst);`

6 years agoAuto merge of #50357 - seanmonstar:arc-weak-null, r=KodrAus
bors [Fri, 29 Jun 2018 04:09:02 +0000 (04:09 +0000)]
Auto merge of #50357 - seanmonstar:arc-weak-null, r=KodrAus

Arc: remove unused allocation from Weak::new()

It seems non-obvious that calling `Weak::new()` actually allocates space for the entire size of `T`, even though you can **never** access that data from such a constructed weak pointer. Besides that, if someone were to create many `Weak:new()`s, they could be unknowingly wasting a bunch of memory.

This change makes it so that `Weak::new()` allocates no memory at all. Instead, it is created with a null pointer. The only things done with a `Weak` are trying to upgrade, cloning, and dropping, meaning there are very few places that the code actually needs to check if the pointer is null.

6 years agoAuto merge of #51592 - GuillaumeGomez:fix-macro-doc-search, r=GuillaumeGomez
bors [Fri, 29 Jun 2018 01:05:02 +0000 (01:05 +0000)]
Auto merge of #51592 - GuillaumeGomez:fix-macro-doc-search, r=GuillaumeGomez

Fix macro missing from doc search

Fixes #51095.

r? @QuietMisdreavus

6 years agoAuto merge of #51884 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 28 Jun 2018 22:20:14 +0000 (22:20 +0000)]
Auto merge of #51884 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 6 pull requests

Successful merges:

 - #51636 (Refactor error reporting of constants)
 - #51765 (Use assert_eq! in copy_from_slice)
 - #51822 (Provide existing ref suggestions for more E0308 errors)
 - #51839 (Detect overflows of non u32 shifts)
 - #51868 (Remove process::id from 'Stabilized APIs' in 1.27.0 release notes)
 - #51875 (Explicitely disable WASM code generation for Emscripten)

Failed merges:

r? @ghost

6 years agoRollup merge of #51875 - badboy:emscripten-no-wasm, r=nikomatsakis
Mark Rousskov [Thu, 28 Jun 2018 22:07:16 +0000 (16:07 -0600)]
Rollup merge of #51875 - badboy:emscripten-no-wasm, r=nikomatsakis

Explicitely disable WASM code generation for Emscripten

Emscripten changed the default behavior recently:
https://github.com/kripken/emscripten/blob/bd050e64bb0d9952df1344b8ea9356252328ad83/ChangeLog.markdown#v1381-05172018

It now defaults to WebAssembly and requires an explicit flag to generate asm.js.
WASM=0 is also valid for older emcc and thus doesn't break it.

6 years agoRollup merge of #51868 - Lireer:master, r=pietroalbini
Mark Rousskov [Thu, 28 Jun 2018 22:07:15 +0000 (16:07 -0600)]
Rollup merge of #51868 - Lireer:master, r=pietroalbini

Remove process::id from 'Stabilized APIs' in 1.27.0 release notes

process::id was already stabilized in 1.26.0 and is marked as such in the docs.

6 years agoRollup merge of #51839 - oli-obk:const_shift_overflow, r=nikomatsakis
Mark Rousskov [Thu, 28 Jun 2018 22:07:14 +0000 (16:07 -0600)]
Rollup merge of #51839 - oli-obk:const_shift_overflow, r=nikomatsakis

Detect overflows of non u32 shifts

6 years agoRollup merge of #51822 - estebank:suggest-more, r=nikomatsakis
Mark Rousskov [Thu, 28 Jun 2018 22:07:13 +0000 (16:07 -0600)]
Rollup merge of #51822 - estebank:suggest-more, r=nikomatsakis

Provide existing ref suggestions for more E0308 errors

6 years agoRollup merge of #51765 - jonas-schievink:patch-1, r=KodrAus
Mark Rousskov [Thu, 28 Jun 2018 22:07:12 +0000 (16:07 -0600)]
Rollup merge of #51765 - jonas-schievink:patch-1, r=KodrAus

Use assert_eq! in copy_from_slice

This will print both lengths when the assertion fails instead of just saying that they're different.

Output of current stable and nightly (modulo the exact line number):
```
thread 'main' panicked at 'destination and source slices have different lengths', libcore/slice/mod.rs:1645:9
```

Output after this PR:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `123`,
 right: `456`: destination and source slices have different lengths', libcore/slice/mod.rs:1645:9
```

Note that I have not run the tests locally.

6 years agoRollup merge of #51636 - oli-obk:const_diagnostics, r=eddyb
Mark Rousskov [Thu, 28 Jun 2018 22:07:10 +0000 (16:07 -0600)]
Rollup merge of #51636 - oli-obk:const_diagnostics, r=eddyb

Refactor error reporting of constants

cc @eddyb

This PR should not change any behaviour. It solely simplifies the internal handling of the errors

6 years agoChange traits to bare FnMut where possible.
moxian [Mon, 4 Jun 2018 11:00:12 +0000 (11:00 +0000)]
Change traits to bare FnMut where possible.

6 years agoMake msvc symbol extraction/printing functions generic.
moxian [Fri, 18 May 2018 12:33:23 +0000 (12:33 +0000)]
Make msvc symbol extraction/printing functions generic.

6 years agoMake stackwalking generic instead of matching on enum variants.
moxian [Fri, 18 May 2018 11:38:50 +0000 (11:38 +0000)]
Make stackwalking generic instead of matching on enum variants.

6 years agoLoad backtrace-related functions only once
moxian [Sun, 13 May 2018 08:41:24 +0000 (08:41 +0000)]
Load backtrace-related functions only once

.. and pass them around in BacktraceContext.

6 years agoSplit separate stackwalk variants into their own functions
moxian [Sun, 13 May 2018 04:38:43 +0000 (04:38 +0000)]
Split separate stackwalk variants into their own functions

.. rather than having them be one giant match statement.

6 years agoAdd a fallback for stacktrace printing for older Windows versions.
moxian [Tue, 8 May 2018 06:19:55 +0000 (06:19 +0000)]
Add a fallback for stacktrace printing for older Windows versions.

PR #47252 switched stack inspection functions of dbghelp.dll
to their newer alternatives that also capture inlined context.
Unfortunately, said new alternatives are not present in older
dbghelp.dll versions.
In particular Windows 7 at the time of writing has dbghelp.dll
version 6.1.7601 from 2010, that lacks StackWalkEx and friends.

Fixes #50138

6 years agoArc: remove unused allocation from Weak::new()
Sean McArthur [Thu, 28 Jun 2018 18:49:47 +0000 (11:49 -0700)]
Arc: remove unused allocation from Weak::new()

6 years agoProvide existing ref suggestions for more E0308 errors
Esteban Küber [Tue, 26 Jun 2018 18:39:37 +0000 (11:39 -0700)]
Provide existing ref suggestions for more E0308 errors

6 years agoAuto merge of #51687 - japaric:gh51671, r=alexcrichton
bors [Thu, 28 Jun 2018 15:34:17 +0000 (15:34 +0000)]
Auto merge of #51687 - japaric:gh51671, r=alexcrichton

translate / export weak lang items

see #51671 for details

fixes #51671
fixes #51342

r? @michaelwoerister or @alexcrichton

6 years agoAuto merge of #51630 - joshlf:map-split-perf, r=dtolnay
bors [Thu, 28 Jun 2018 13:23:07 +0000 (13:23 +0000)]
Auto merge of #51630 - joshlf:map-split-perf, r=dtolnay

Optimize RefCell refcount tracking

Address the performance concern raised in https://github.com/rust-lang/rust/pull/51466#issuecomment-398255276

cc @dtolnay  @nnethercote @rust-lang/wg-compiler-performance

cc @RalfJung @jhjourdan for soundness concerns

Can somebody kick off a perf run on this? I'm not sure how that's done, but I understand it has to be started manually.

The idea of this change is to switch to representing mutable refcount as values below 0 to eliminate some branching that was required with the old algorithm.

6 years agoExplicitely disable WASM code generation for Emscripten
Jan-Erik Rediger [Thu, 28 Jun 2018 10:24:14 +0000 (12:24 +0200)]
Explicitely disable WASM code generation for Emscripten

Emscripten changed the default behavior recently:
https://github.com/kripken/emscripten/blob/bd050e64bb0d9952df1344b8ea9356252328ad83/ChangeLog.markdown#v1381-05172018

It now defaults to WebAssembly and requires an explicit flag to generate asm.js.
WASM=0 is also valid for older emcc and thus doesn't break it.

Closes #51856

6 years agoAuto merge of #50997 - michaelwoerister:pre-analyze-filemaps, r=Mark-Simulacrum
bors [Thu, 28 Jun 2018 11:20:41 +0000 (11:20 +0000)]
Auto merge of #50997 - michaelwoerister:pre-analyze-filemaps, r=Mark-Simulacrum

 Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.

This PR removes most of the interior mutability from `FileMap`, which should be beneficial, especially in a multithreaded setting. This is achieved by initializing the state in question when the filemap is constructed instead of during lexing. Hopefully this doesn't degrade performance.

cc @wesleywiser

6 years agoRemove process::id from 'Stabilized APIs' in 1.27
Lireer [Thu, 28 Jun 2018 09:30:53 +0000 (11:30 +0200)]
Remove process::id from 'Stabilized APIs' in 1.27

6 years agoRebase fallout
Oliver Schneider [Thu, 28 Jun 2018 09:19:45 +0000 (11:19 +0200)]
Rebase fallout

6 years agoAuto merge of #51492 - petrochenkov:hirident, r=eddyb
bors [Thu, 28 Jun 2018 09:16:10 +0000 (09:16 +0000)]
Auto merge of #51492 - petrochenkov:hirident, r=eddyb

Use `Ident`s in HIR and remove emulation of hygiene with gensyms

continuation of https://github.com/rust-lang/rust/pull/51072, part of https://github.com/rust-lang/rust/issues/49300

Not all `Name`s in HIR are replaced with `Ident`s, only those needed for hygiene or already having attached spans.

6 years agoTurn the use of erroneous constants into errors again
Oliver Schneider [Wed, 27 Jun 2018 12:55:06 +0000 (14:55 +0200)]
Turn the use of erroneous constants into errors again

6 years agoDon't const propagate the body of constants
Oliver Schneider [Wed, 27 Jun 2018 11:36:30 +0000 (13:36 +0200)]
Don't const propagate the body of constants

6 years agoMerge `ConstVal` and `ConstValue`
Oliver Schneider [Mon, 25 Jun 2018 18:53:02 +0000 (20:53 +0200)]
Merge `ConstVal` and `ConstValue`

6 years agoFixup
Oliver Schneider [Mon, 25 Jun 2018 16:48:11 +0000 (18:48 +0200)]
Fixup

6 years agoMove everything over from `middle::const_val` to `mir::interpret`
Oliver Schneider [Mon, 25 Jun 2018 16:46:02 +0000 (18:46 +0200)]
Move everything over from `middle::const_val` to `mir::interpret`

6 years agoMove the Lrc outside the error type and name the fields
Oliver Schneider [Mon, 25 Jun 2018 15:41:20 +0000 (17:41 +0200)]
Move the Lrc outside the error type and name the fields

6 years agoRemove unused type
Oliver Schneider [Mon, 25 Jun 2018 13:10:33 +0000 (15:10 +0200)]
Remove unused type

6 years agoAddress review comments
Oliver Schneider [Mon, 25 Jun 2018 13:08:05 +0000 (15:08 +0200)]
Address review comments

6 years agoEliminate old CTFE's `ErrKind`
Oliver Schneider [Tue, 19 Jun 2018 14:40:53 +0000 (16:40 +0200)]
Eliminate old CTFE's `ErrKind`

6 years agoSimplify const error reporting
Oliver Schneider [Thu, 14 Jun 2018 23:26:56 +0000 (01:26 +0200)]
Simplify const error reporting

6 years agoFix FileMap::line_begin_pos().
Michael Woerister [Thu, 28 Jun 2018 08:45:57 +0000 (10:45 +0200)]
Fix FileMap::line_begin_pos().

The method relied on the FileMap still being under construction in
order for it to do what the name promises. It's now independent of
the current state.

6 years agoFix rebase
Vadim Petrochenkov [Wed, 27 Jun 2018 21:12:17 +0000 (00:12 +0300)]
Fix rebase

6 years agoincremental: Do not hash spans for things that didn't have spans previously
Vadim Petrochenkov [Sat, 16 Jun 2018 16:44:12 +0000 (19:44 +0300)]
incremental: Do not hash spans for things that didn't have spans previously

6 years agoSupport delegation in stable hashing macros
Vadim Petrochenkov [Sat, 16 Jun 2018 14:09:42 +0000 (17:09 +0300)]
Support delegation in stable hashing macros

6 years agoUse `Ident`s for associated item definitions in HIR
Vadim Petrochenkov [Sun, 10 Jun 2018 19:24:24 +0000 (22:24 +0300)]
Use `Ident`s for associated item definitions in HIR

Remove emulation of hygiene with gensyms

6 years agoUse `Ident`s in a number of structures in HIR
Vadim Petrochenkov [Sun, 10 Jun 2018 16:33:30 +0000 (19:33 +0300)]
Use `Ident`s in a number of structures in HIR

Namely: labels, type parameters, bindings in patterns, parameter names in functions without body.
All of these do not need hygiene after lowering to HIR, only span locations.

6 years agoUse `Ident`s for path segments in HIR
Vadim Petrochenkov [Sun, 10 Jun 2018 14:40:45 +0000 (17:40 +0300)]
Use `Ident`s for path segments in HIR

6 years agoUse `Ident`s for associated type bindings in HIR
Vadim Petrochenkov [Sun, 10 Jun 2018 12:55:48 +0000 (15:55 +0300)]
Use `Ident`s for associated type bindings in HIR

6 years agoUse `Ident`s for lifetimes in HIR
Vadim Petrochenkov [Sat, 9 Jun 2018 20:25:33 +0000 (23:25 +0300)]
Use `Ident`s for lifetimes in HIR

6 years agoAuto merge of #51444 - estebank:impl-static, r=nikomatsakis
bors [Thu, 28 Jun 2018 03:57:28 +0000 (03:57 +0000)]
Auto merge of #51444 - estebank:impl-static, r=nikomatsakis

Suggestion for 'static impl Trait return

When encountering a named or anonymous sup requirement (for example,
`&'a self`) and a `'static` impl Trait return type, suggest adding the
`'_` lifetime constraing to the return type.

Fix #43719, #51282.

```
error: cannot infer an appropriate lifetime
  --> $DIR/static-return-lifetime-infered.rs:17:16
   |
LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
   |                                   ----------------------- this return type evaluates to the `'static` lifetime...
LL |         self.x.iter().map(|a| a.0)
   |         ------ ^^^^
   |         |
   |         ...but this borrow...
   |
note: ...can't outlive the anonymous lifetime #1 defined on the method body at 16:5
  --> $DIR/static-return-lifetime-infered.rs:16:5
   |
LL | /     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
LL | |         self.x.iter().map(|a| a.0)
LL | |     }
   | |_____^
help: you can add a constraint to the return type to make it last less than `'static` and match the anonymous lifetime #1 defined on the method body at 16:5
   |
LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

6 years agoAuto merge of #51538 - nikomatsakis:nll-perf-examination, r=eddyb
bors [Thu, 28 Jun 2018 01:41:40 +0000 (01:41 +0000)]
Auto merge of #51538 - nikomatsakis:nll-perf-examination, r=eddyb

convert NLL ops to caches

This is a extension of <https://github.com/rust-lang/rust/pull/51460>. It uses a lot more caching than we used to do. This caching is not yet as efficient as it could be, but I'm curious to see the current perf results.

This is the high-level idea: in the MIR type checker, use [canonicalized queries](https://rust-lang-nursery.github.io/rustc-guide/traits/canonical-queries.html) for all the major operations. This is helpful because the MIR type check is operating in a context where all types are fully known (mostly, anyway) but regions are completely renumbered. This means we often wind up with duplicate queries like `Foo<'1, '2> :Bar` and `Foo<'3, '4>: Bar`. Canonicalized queries let us re-use the results. By the final commit in this PR, we can essentially just "read off" the resulting region relations and add them to the NLL type check.

6 years agoAuto merge of #51859 - kennytm:rollup, r=kennytm
bors [Wed, 27 Jun 2018 23:41:23 +0000 (23:41 +0000)]
Auto merge of #51859 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #49987 (Add str::split_ascii_whitespace.)
 - #50342 (Document round-off error in `.mod_euc()`-method, see issue #50179)
 - #51658 (Only do sanity check with debug assertions on)
 - #51799 (Lower case some feature gate error messages)
 - #51800 (Add a compiletest header for edition)
 - #51824 (Fix the error reference for LocalKey::try_with)
 - #51842 (Document that Layout::from_size_align does not allow align=0)

Failed merges:

r? @ghost

6 years agoRollup merge of #51842 - rust-lang:align-is-nonzero, r=cramertj
kennytm [Wed, 27 Jun 2018 22:15:43 +0000 (06:15 +0800)]
Rollup merge of #51842 - rust-lang:align-is-nonzero, r=cramertj

Document that Layout::from_size_align does not allow align=0

This was already implied since zero is not a power of two, but maybe worth pointing out.

6 years agoRollup merge of #51824 - vorner:thread-local-try-with-doc, r=kennytm
kennytm [Wed, 27 Jun 2018 22:15:42 +0000 (06:15 +0800)]
Rollup merge of #51824 - vorner:thread-local-try-with-doc, r=kennytm

Fix the error reference for LocalKey::try_with

There's no such thing as `ThreadLocalError` and the method obviously returns `AccessError`, so adjusting (probably only outdated docs).

6 years agoRollup merge of #51800 - mark-i-m:edition2018compiletest, r=nikomatsakis
kennytm [Wed, 27 Jun 2018 22:15:41 +0000 (06:15 +0800)]
Rollup merge of #51800 - mark-i-m:edition2018compiletest, r=nikomatsakis

Add a compiletest header for edition

r? @nikomatsakis

Are the `-Zunstable-options` options needed in these tests? It looks like they aren't. If not, I can remove them.

6 years agoRollup merge of #51799 - mark-i-m:lower_case_feature_gate, r=mark-i-m
kennytm [Wed, 27 Jun 2018 22:15:40 +0000 (06:15 +0800)]
Rollup merge of #51799 - mark-i-m:lower_case_feature_gate, r=mark-i-m

Lower case some feature gate error messages

6 years agoRollup merge of #51658 - oli-obk:unregress_perf, r=nikomatsakis
kennytm [Wed, 27 Jun 2018 22:15:39 +0000 (06:15 +0800)]
Rollup merge of #51658 - oli-obk:unregress_perf, r=nikomatsakis

Only do sanity check with debug assertions on

r? @nnethercote

I'm slighty confused. These changes address code that the `unused-warnings` benchmark doesn't go through, yet I see a 5% improvement to nightly on the `check` run, and no improvement on the other runs.

Maybe this change allows unrelated code in the same function to be better optimized?

6 years agoRollup merge of #50342 - fkjogu:euclidean, r=BurntSushi
kennytm [Wed, 27 Jun 2018 22:15:38 +0000 (06:15 +0800)]
Rollup merge of #50342 - fkjogu:euclidean, r=BurntSushi

Document round-off error in `.mod_euc()`-method, see issue #50179

Due to a round-off error the method `.mod_euc()` of both `f32` and `f64` can produce mathematical invalid outputs. If `self` in magnitude is much small than the modulus `rhs` and negative, `self + rhs` in the first branch cannot be represented in the given precision and results into `rhs`. In the mathematical strict sense, this breaks the definition. But given the limitation of floating point arithmetic it can be thought of the closest representable value to the true result, although it is not strictly in the domain `[0.0, rhs)` of the function. It is rather the left side asymptotical limit. It would be desirable that it produces the mathematical more sound approximation of `0.0`, the right side asymptotical limit. But this breaks the property, that `self == self.div_euc(rhs) * rhs + a.mod_euc(rhs)`.

The discussion in issue #50179 did not find an satisfying conclusion to which property is deemed more important. But at least we can document the behaviour. Which this pull request does.

6 years agoRollup merge of #49987 - clarcharr:split_ascii_whitespace, r=SimonSapin
kennytm [Wed, 27 Jun 2018 22:15:37 +0000 (06:15 +0800)]
Rollup merge of #49987 - clarcharr:split_ascii_whitespace, r=SimonSapin

Add str::split_ascii_whitespace.

As mentioned in #48656.

While `str::split_whitespace` now works in `libcore`, it still makes sense to offer this method, considering how it is still more performant in cases where only ASCII is necessary.

6 years agoAdd str::split_ascii_whitespace.
Clar Charr [Sat, 5 May 2018 04:33:20 +0000 (00:33 -0400)]
Add str::split_ascii_whitespace.

6 years agoUpdate tests for grouped nll move errors
Matthew Jasper [Wed, 27 Jun 2018 21:07:20 +0000 (22:07 +0100)]
Update tests for grouped nll move errors

6 years agoGroup move errors before reporting, add suggestions
Matthew Jasper [Wed, 27 Jun 2018 21:06:54 +0000 (22:06 +0100)]
Group move errors before reporting, add suggestions

6 years agoAuto merge of #51139 - vakaras:issue-50716, r=nikomatsakis
bors [Wed, 27 Jun 2018 21:32:44 +0000 (21:32 +0000)]
Auto merge of #51139 - vakaras:issue-50716, r=nikomatsakis

Fix NLL issue 50716 and add a regression test.

Fix for NLL issue #50716.

r? @nikomatsakis

6 years agoUpdate MIR opt tests
Matthew Jasper [Wed, 27 Jun 2018 21:06:21 +0000 (22:06 +0100)]
Update MIR opt tests

6 years agoGenerate a direct assignment in MIR for `let x = y;`
Matthew Jasper [Wed, 27 Jun 2018 21:04:45 +0000 (22:04 +0100)]
Generate a direct assignment in MIR for `let x = y;`

6 years agorustfmt various files
Niko Matsakis [Wed, 27 Jun 2018 20:17:49 +0000 (16:17 -0400)]
rustfmt various files

6 years agochange the `enter_canonical_trait_query` method to give a fulfill cx
Niko Matsakis [Wed, 27 Jun 2018 20:04:32 +0000 (16:04 -0400)]
change the `enter_canonical_trait_query` method to give a fulfill cx

6 years agoupdate comments
Niko Matsakis [Wed, 27 Jun 2018 19:43:23 +0000 (15:43 -0400)]
update comments

6 years agorename `prequery` to `try_fast_path`
Niko Matsakis [Wed, 27 Jun 2018 19:39:20 +0000 (15:39 -0400)]
rename `prequery` to `try_fast_path`

6 years agopull out `ParamEnvAnd` and remove `QueryKey`
Niko Matsakis [Wed, 27 Jun 2018 19:17:03 +0000 (15:17 -0400)]
pull out `ParamEnvAnd` and remove `QueryKey`

6 years agoAuto merge of #51852 - oli-obk:miri_fix, r=Zoxc
bors [Wed, 27 Jun 2018 19:30:14 +0000 (19:30 +0000)]
Auto merge of #51852 - oli-obk:miri_fix, r=Zoxc

Don't use `ParamEnv::reveal_all()` if there is a real one available

fixes #51841

r? @Zoxc

6 years agoAuto merge of #51850 - abarth:draw_again, r=cramertj
bors [Wed, 27 Jun 2018 17:20:27 +0000 (17:20 +0000)]
Auto merge of #51850 - abarth:draw_again, r=cramertj

[fuchsia] Update zx_cprng_draw to target semantics

This change is the final step in improving the semantics of
zx_cprng_draw. Now the syscall always generates the requested number of
bytes. If the syscall would have failed to generate the requested number
of bytes, the syscall either terminates the entire operating system or
terminates the calling process, depending on whether the error is a
result of the kernel misbehaving or the userspace program misbehaving.

6 years agoDon't use `ParamEnv::reveal_all()` if there is a real one available
Oliver Schneider [Wed, 27 Jun 2018 16:24:24 +0000 (18:24 +0200)]
Don't use `ParamEnv::reveal_all()` if there is a real one available

6 years agoFix the error of selecting obligation by not running the borrow checker.
Vytautas Astrauskas [Tue, 26 Jun 2018 15:00:39 +0000 (17:00 +0200)]
Fix the error of selecting obligation by not running the borrow checker.

6 years agoMove regression test from `compile-fail/` to `ui/` test directory.
Felix S. Klock II [Wed, 30 May 2018 14:23:54 +0000 (16:23 +0200)]
Move regression test from `compile-fail/` to `ui/` test directory.

6 years agoFix the regression test for issue 50716.
Vytautas Astrauskas [Tue, 29 May 2018 07:13:49 +0000 (09:13 +0200)]
Fix the regression test for issue 50716.

6 years agoFix NLL issue 50716 and add a regression test.
Vytautas Astrauskas [Mon, 28 May 2018 13:21:47 +0000 (15:21 +0200)]
Fix NLL issue 50716 and add a regression test.

6 years ago[fuchsia] Update zx_cprng_draw to target semantics
Adam Barth [Wed, 27 Jun 2018 15:56:19 +0000 (08:56 -0700)]
[fuchsia] Update zx_cprng_draw to target semantics

This change is the final step in improving the semantics of
zx_cprng_draw. Now the syscall always generates the requested number of
bytes. If the syscall would have failed to generate the requested number
of bytes, the syscall either terminates the entire operating system or
terminates the calling process, depending on whether the error is a
result of the kernel misbehaving or the userspace program misbehaving.

6 years agoAuto merge of #51356 - Zoxc:encode-cleanup, r=michaelwoerister
bors [Wed, 27 Jun 2018 14:25:52 +0000 (14:25 +0000)]
Auto merge of #51356 - Zoxc:encode-cleanup, r=michaelwoerister

Make opaque::Encoder append-only and make it infallible

6 years agomove into `provide` methods
Niko Matsakis [Wed, 27 Jun 2018 13:42:00 +0000 (09:42 -0400)]
move into `provide` methods

6 years agorename to `shrink_to_tcx_lifetime`
Niko Matsakis [Wed, 27 Jun 2018 13:27:07 +0000 (09:27 -0400)]
rename to `shrink_to_tcx_lifetime`

6 years agoDocument that Layout::from_size_align does not allow align=0
Simon Sapin [Wed, 27 Jun 2018 13:04:49 +0000 (15:04 +0200)]
Document that Layout::from_size_align does not allow align=0

This was already implied since zero is not a power of two, but maybe
worth pointing out.

6 years agoextend comment to note complications around lifetimes
Niko Matsakis [Wed, 27 Jun 2018 12:55:41 +0000 (08:55 -0400)]
extend comment to note complications around lifetimes

6 years agosyntax_pos: Store multibyte char size as u8 instead of u32.
Michael Woerister [Tue, 26 Jun 2018 13:37:09 +0000 (15:37 +0200)]
syntax_pos: Store multibyte char size as u8 instead of u32.

6 years agoAdd comments to analzye_filemap().
Michael Woerister [Fri, 1 Jun 2018 10:54:15 +0000 (12:54 +0200)]
Add comments to analzye_filemap().

6 years agoAdd SSE2 accelerated version of FileMap analysis.
Michael Woerister [Tue, 29 May 2018 15:50:13 +0000 (17:50 +0200)]
Add SSE2 accelerated version of FileMap analysis.

6 years agoUse u32 instead of usize of encoding byte count of multi-byte chars.
Michael Woerister [Tue, 29 May 2018 15:49:35 +0000 (17:49 +0200)]
Use u32 instead of usize of encoding byte count of multi-byte chars.

6 years agoUpdate CodeMap tests after changing FileMap construction.
Michael Woerister [Thu, 24 May 2018 09:30:30 +0000 (11:30 +0200)]
Update CodeMap tests after changing FileMap construction.

6 years agoRemove the now redundant CodeMap::new_filemap_with_lines() method.
Michael Woerister [Wed, 23 May 2018 14:19:20 +0000 (16:19 +0200)]
Remove the now redundant CodeMap::new_filemap_with_lines() method.

6 years agoMake FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.
Michael Woerister [Wed, 23 May 2018 13:59:42 +0000 (15:59 +0200)]
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.

6 years agoDetect overflows of non u32 shifts
Oliver Schneider [Wed, 27 Jun 2018 11:47:19 +0000 (13:47 +0200)]
Detect overflows of non u32 shifts

6 years agopacify the mercilous tidy
Niko Matsakis [Wed, 27 Jun 2018 11:28:25 +0000 (07:28 -0400)]
pacify the mercilous tidy

6 years agoimprove comments on `dropck_outlives`
Niko Matsakis [Wed, 27 Jun 2018 11:26:29 +0000 (07:26 -0400)]
improve comments on `dropck_outlives`

6 years agoAuto merge of #51496 - petrochenkov:mhelper2, r=nikomatsakis
bors [Wed, 27 Jun 2018 11:20:16 +0000 (11:20 +0000)]
Auto merge of #51496 - petrochenkov:mhelper2, r=nikomatsakis

Implement `#[macro_export(local_inner_macros)]` (a solution for the macro helper import problem)

Implement a solution for the macro helper issue discussed in https://github.com/rust-lang/rust/issues/35896 as described in https://github.com/rust-lang/rust/issues/35896#issuecomment-395977901.

Macros exported from libraries can be marked with `#[macro_export(local_inner_macros)]` and this annotation changes how nested macros in them are resolved.

If we have a fn-like macro call `ident!(...)` and `ident` comes from a `macro_rules!` macro marked with  `#[macro_export(local_inner_macros)]` then it's replaced with `$crate::ident!(...)` and resolved as such (`$crate` gets the same context as `ident`).

6 years agoimprove comment on instantiate NLL query result fn
Niko Matsakis [Wed, 27 Jun 2018 11:19:17 +0000 (07:19 -0400)]
improve comment on instantiate NLL query result fn

6 years agoremove `either` dependency we are not using
Niko Matsakis [Wed, 27 Jun 2018 11:05:40 +0000 (07:05 -0400)]
remove `either` dependency we are not using

6 years agorename `upcast` to `cast_to_tcx_lifetime` and improve comment
Niko Matsakis [Wed, 27 Jun 2018 11:02:37 +0000 (07:02 -0400)]
rename `upcast` to `cast_to_tcx_lifetime` and improve comment

6 years agofix wrong query description
Niko Matsakis [Wed, 27 Jun 2018 10:57:20 +0000 (06:57 -0400)]
fix wrong query description

6 years agomerge all the `type_op_foo` modules into one as they are so trivial
Niko Matsakis [Wed, 27 Jun 2018 10:53:23 +0000 (06:53 -0400)]
merge all the `type_op_foo` modules into one as they are so trivial

6 years agouse query boiler plate for `normalize_projection_ty` too
Niko Matsakis [Wed, 27 Jun 2018 10:47:55 +0000 (06:47 -0400)]
use query boiler plate for `normalize_projection_ty` too

6 years agouse query boilerplate for prove-predicate -- slightly inefficient
Niko Matsakis [Wed, 27 Jun 2018 10:49:05 +0000 (06:49 -0400)]
use query boilerplate for prove-predicate -- slightly inefficient

This requires us to allocate a single entry vector we didn't use to
allocate. I doubt this makes a difference in practice, as this only
occurs for cache misses.

6 years agouse query boilerplate for subtype
Niko Matsakis [Wed, 27 Jun 2018 10:48:52 +0000 (06:48 -0400)]
use query boilerplate for subtype

6 years agouse query boilerplate for `normalize`
Niko Matsakis [Wed, 27 Jun 2018 10:48:43 +0000 (06:48 -0400)]
use query boilerplate for `normalize`