]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFixes issue 39827: ICE in volatile_store intrinsic
Alexey Tarasov [Sat, 12 Aug 2017 08:42:44 +0000 (18:42 +1000)]
Fixes issue 39827: ICE in volatile_store intrinsic

- adds handling of zero-sized types for volatile_store.
- adds type size checks and warnigns for other volatile intrinsics.
- adds a test to check warnings emitting.

Cause of the issue

While preparing for trans_intrinsic_call() invoke arguments are
processed with trans_argument() method which excludes zero-sized types
from argument list (to be more correct - all arguments for which
ArgKind is Ignore are filtered out). As result volatile_store() intrinsic
gets one argument instead of expected address and value.

How it is fixed

Modification of the trans_argument() method may cause side effects,
therefore change was implemented in volatile_store() intrinsic building
code itself. Now it checks function signature and if it was specialised
with zero-sized type, then emits C_nil() instead of accessing
non-existing second argument.

Additionally warnings are added for all volatile operations which are
specialised with zero-sized arguments. In fact, those operations are omitted
in LLVM backend if no memory affected at all, e.g. number of elements
is zero or type is zero-sized. This was not explicitly documented before
and could lead to potential issues if developer expects volatile behaviour,
but type has degraded to zero-sized.

6 years agoAuto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv
bors [Sat, 12 Aug 2017 03:22:09 +0000 (03:22 +0000)]
Auto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv

Document the doc attribute

cc #42322

6 years agoAuto merge of #43772 - arielb1:nonfree-block, r=nagisa
bors [Sat, 12 Aug 2017 00:54:38 +0000 (00:54 +0000)]
Auto merge of #43772 - arielb1:nonfree-block, r=nagisa

For box expressions, use NZ drop instead of a free block

This falls naturally out of making drop elaboration work with `box`
expressions, which is probably required for sane MIR borrow-checking.
This is a pure refactoring with no intentional functional effects.

r? @nagisa

6 years agoAuto merge of #43766 - michaelwoerister:trans-scheduler-touch-up, r=alexcrichton
bors [Fri, 11 Aug 2017 22:23:10 +0000 (22:23 +0000)]
Auto merge of #43766 - michaelwoerister:trans-scheduler-touch-up, r=alexcrichton

Improve LLVM/trans scheduling a bit

Currently it's possible that the main thread is waiting on LLVM threads to finish work while its implicit token is going to waste. This PR let's the main thread take over, so one of the running LLVM threads can free its token earlier.

r? @alexcrichton

6 years agoaddress review feedback
steveklabnik [Fri, 11 Aug 2017 20:24:18 +0000 (16:24 -0400)]
address review feedback

6 years agoAuto merge of #43750 - tbu-:pr_fn_unreachable, r=sfackler
bors [Fri, 11 Aug 2017 19:43:44 +0000 (19:43 +0000)]
Auto merge of #43750 - tbu-:pr_fn_unreachable, r=sfackler

Put `intrinsics::unreachable` on a possible path to stabilization

Mark it with the `unreachable` feature and put it into the `mem` module.
This is a pretty straight-forward API that can already be simulated in
stable Rust by using `transmute` to create an uninhabited enum that can
be matched.

6 years agoAuto merge of #42932 - bjorn3:no_llvm_try2, r=eddyb
bors [Fri, 11 Aug 2017 15:45:10 +0000 (15:45 +0000)]
Auto merge of #42932 - bjorn3:no_llvm_try2, r=eddyb

Support compiling rustc without LLVM (try 2)

Now doesn't change rustc_driver.

Supersedes #42752

6 years agoAuto merge of #43748 - RalfJung:mir-validate2, r=arielb1
bors [Fri, 11 Aug 2017 13:04:59 +0000 (13:04 +0000)]
Auto merge of #43748 - RalfJung:mir-validate2, r=arielb1

AddValidation: handle Call terminators into blocks that have multiple incoming edges

The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.

6 years agoRemove some unused dependencies from rustc_trans_utils
bjorn3 [Fri, 11 Aug 2017 09:08:01 +0000 (11:08 +0200)]
Remove some unused dependencies from rustc_trans_utils

6 years agoIt now completely compiles without LLVM!!!
bjorn3 [Fri, 11 Aug 2017 08:35:01 +0000 (10:35 +0200)]
It now completely compiles without LLVM!!!

6 years agoActually make rustc_driver compile without llvm
bjorn3 [Sat, 5 Aug 2017 14:55:23 +0000 (16:55 +0200)]
Actually make rustc_driver compile without llvm

6 years agoAuto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 11 Aug 2017 09:37:52 +0000 (09:37 +0000)]
Auto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 18 pull requests

- Successful merges: #43176, #43632, #43650, #43712, #43715, #43721, #43739, #43741, #43744, #43747, #43752, #43760, #43773, #43779, #43783, #43791, #43793, #43795
- Failed merges:

6 years agoMake librustc_driver work without librustc_trans
bjorn3 [Thu, 20 Jul 2017 12:56:53 +0000 (14:56 +0200)]
Make librustc_driver work without librustc_trans

6 years agoBuild support for no llvm
bjorn3 [Sun, 18 Jun 2017 14:00:10 +0000 (16:00 +0200)]
Build support for no llvm

6 years agoRollup merge of #43795 - GuillaumeGomez:improve-variants-doc-style, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:33 +0000 (10:20 +0200)]
Rollup merge of #43795 - GuillaumeGomez:improve-variants-doc-style, r=QuietMisdreavus

Improve enum variants display

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 54" src="https://user-images.githubusercontent.com/3050060/29194776-728ce0e2-7e2b-11e7-8299-8300cc0c168b.png">

After:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 57" src="https://user-images.githubusercontent.com/3050060/29194783-78867558-7e2b-11e7-9226-1327fd20163a.png">

(The doc of the variant is more aligned with the "[-]" now).

6 years agoRollup merge of #43793 - j-browne:master, r=steveklabnik
Guillaume Gomez [Fri, 11 Aug 2017 08:20:32 +0000 (10:20 +0200)]
Rollup merge of #43793 - j-browne:master, r=steveklabnik

Fix broken links in Arc documentation

Some link references had ticks, when they should not have had them.

6 years agoRollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:31 +0000 (10:20 +0200)]
Rollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus

File docs

r? @rust-lang/docs

6 years agoRollup merge of #43783 - prisme60:prisme60-typo, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:30 +0000 (10:20 +0200)]
Rollup merge of #43783 - prisme60:prisme60-typo, r=Mark-Simulacrum

Fix typo corersponding -> corresponding

I was reading the documentation of __Struct std::os::unix::net::UnixListener__ when I saw a typo inside.

6 years agoRollup merge of #43779 - mattico:fix-unicode-typo, r=aidanhs
Guillaume Gomez [Fri, 11 Aug 2017 08:20:29 +0000 (10:20 +0200)]
Rollup merge of #43779 - mattico:fix-unicode-typo, r=aidanhs

Fix typo in unicode char definition

Reference: http://www.fileformat.info/info/unicode/char/16ed/index.htm

6 years agoRollup merge of #43773 - ubsan:patch-1, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:28 +0000 (10:20 +0200)]
Rollup merge of #43773 - ubsan:patch-1, r=eddyb

fix a typo

(this should not have been merged with this typo)

6 years agoRollup merge of #43760 - ollie27:rustdoc_search_css, r=GuillaumeGomez
Guillaume Gomez [Fri, 11 Aug 2017 08:20:27 +0000 (10:20 +0200)]
Rollup merge of #43760 - ollie27:rustdoc_search_css, r=GuillaumeGomez

rustdoc: Fix broken CSS in search results

The layout is currently broken for struct/union fields and enum variants
in the search results when searching from a struct, union or enum page.

Some examples:
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html?search=start
https://doc.rust-lang.org/nightly/std/option/enum.Option.html?search=some

 #34477 was an incomplete fix

6 years agoRollup merge of #43752 - arshiamufti:union-test, r=estebank
Guillaume Gomez [Fri, 11 Aug 2017 08:20:26 +0000 (10:20 +0200)]
Rollup merge of #43752 - arshiamufti:union-test, r=estebank

Add IRC's `!union union` as a test, addresses #43553

This pull request adds a new test, `union` to `weird-exprs.rs`.

6 years agoRollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:25 +0000 (10:20 +0200)]
Rollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus

Improve headers linking

r? @QuietMisdreavus

6 years agoRollup merge of #43744 - MaloJaffre:stage1-test, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:24 +0000 (10:20 +0200)]
Rollup merge of #43744 - MaloJaffre:stage1-test, r=Mark-Simulacrum

Ignore tests that fail on stage1

That makes `./x.py test --stage 1` work on `x86_64-unknown-linux-gnu`.

6 years agoRollup merge of #43741 - Gankro:fix-assert, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:23 +0000 (10:20 +0200)]
Rollup merge of #43741 - Gankro:fix-assert, r=eddyb

fix assertion - trait object pointers don't have infinite fields

r? @eddyb

6 years agoRollup merge of #43739 - ibabushkin:master, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:22 +0000 (10:20 +0200)]
Rollup merge of #43739 - ibabushkin:master, r=eddyb

Encode proper module spans in crate metadata.

The spans previously encoded only span the first token after the opening
brace, up to the closing brace of inline `mod` declarations. Thus, when
examining exports from an external crate, the spans don't include the
header of inline `mod` declarations.

r? @eddyb

6 years agoRollup merge of #43721 - natboehm:patch-1, r=steveklabnik
Guillaume Gomez [Fri, 11 Aug 2017 08:20:21 +0000 (10:20 +0200)]
Rollup merge of #43721 - natboehm:patch-1, r=steveklabnik

Provide more explanation for Deref in String docs

While working on a different project I encountered a point of confusion where using `&String` to dereference a `String` into `&str` did not compile. I found the explanation of [String Deref](https://doc.rust-lang.org/std/string/struct.String.html#deref), thought that it matched what I was trying to do, and was confused as to why my program did not compile when the docs stated that it would work with 'any function which takes a `&str`'. At the bottom it is mentioned that this will 'generally' work, unless `String` is needed, but I found this statement confusing based on the previous claim of 'any'. Looking further into the docs I was able to find the function `as_str()` that works instead.

I thought it might be helpful to mention here deref coercion, an instance in which using `&String` does not work, to explain why it does not work, then direct users to a different option that should work in this instance. A user casually skimming the page will likely come to this explanation first, then find `as_str()` later, but be no the wiser as to what potentially went wrong.

r? @steveklabnik

6 years agoRollup merge of #43715 - ollie27:docs_long_link, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:20 +0000 (10:20 +0200)]
Rollup merge of #43715 - ollie27:docs_long_link, r=QuietMisdreavus

Stop using URL shortener in docs

tidy will no longer complain about long lines containing links so there
is no reason to use a URL shortener here.

6 years agoRollup merge of #43712 - oli-obk:cfg, r=arielb1
Guillaume Gomez [Fri, 11 Aug 2017 08:20:19 +0000 (10:20 +0200)]
Rollup merge of #43712 - oli-obk:cfg, r=arielb1

Reexport all SyntaxExtension variants

This was previously done very inconsistently and made matches look weird since some variants had the `SyntaxExtension::` prefix while others didn't.

6 years agoRollup merge of #43650 - RalfJung:mir-validate, r=arielb1
Guillaume Gomez [Fri, 11 Aug 2017 08:20:18 +0000 (10:20 +0200)]
Rollup merge of #43650 - RalfJung:mir-validate, r=arielb1

test MIR validation statements in closures

r? @nikomatsakis

6 years agoRollup merge of #43632 - ruuda:allow-long-relative-urls, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:17 +0000 (10:20 +0200)]
Rollup merge of #43632 - ruuda:allow-long-relative-urls, r=Mark-Simulacrum

Detect relative urls in tidy check

This came up in #43631: there can be long relative urls in Markdown comments, that do not start with `http://` or `https://`, so the tidy check will not detect them as urls and complain about the line length. This PR adds detection of relative urls starting with `../`.

6 years agoRollup merge of #43176 - RalfJung:explain, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:16 +0000 (10:20 +0200)]
Rollup merge of #43176 - RalfJung:explain, r=eddyb

E0122: clarify wording

I *assume* the reason these constraints are not hard errors is backwards compatibility. If yes, I think the error explanation (at least the long form) should be clearer about that, which is what this PR does.

If not, the explanation should give some other suitable explanation.

6 years agoAuto merge of #43745 - kennytm:fix-43162, r=aturon
bors [Fri, 11 Aug 2017 07:09:44 +0000 (07:09 +0000)]
Auto merge of #43745 - kennytm:fix-43162, r=aturon

Type-check `break value;` even outside of `loop {}`.

Fix #43162, fix #43727.

6 years agoAuto merge of #43743 - michaelwoerister:gcx-tcx-switcheroo, r=eddyb
bors [Fri, 11 Aug 2017 02:23:16 +0000 (02:23 +0000)]
Auto merge of #43743 - michaelwoerister:gcx-tcx-switcheroo, r=eddyb

Some assorted region hashing fixes.

This PR contains three changes.
1. It changes what we implement `HashStable` for. Previously, the trait was implemented for things in the local `TyCtxt`. That was OK, since we only invoked hashing with a `TyCtxt<'_,  'tcx, 'tcx>` where there is no difference. With query result hashing this becomes a problem though. So we now implement `HashStable` for things in `'gcx`.
2. The PR makes the regular `HashStable` implementation *not* anonymize late-bound regions anymore. It's a waste of computing resources and it's not clear that it would always be correct to do so.
3. The PR adds an option for stable hashing to treat all regions as erased and uses this new option when computing the `TypeId`. This should help with https://github.com/rust-lang/rust/issues/41875.

I did not add a test case for (3) since that's not possible yet. But it looks like @zackmdavis has something in the pipeline there `:)`.

r? @eddyb

6 years agoAdd `#[inline]` to `mem::unreachable`
Tobias Bucher [Fri, 11 Aug 2017 01:42:36 +0000 (03:42 +0200)]
Add `#[inline]` to `mem::unreachable`

6 years agoignore more things
steveklabnik [Fri, 11 Aug 2017 00:17:41 +0000 (20:17 -0400)]
ignore more things

6 years agoreview feedback
steveklabnik [Thu, 10 Aug 2017 22:59:51 +0000 (18:59 -0400)]
review feedback

6 years agodoc doc(inline) and doc(no_inline)
steveklabnik [Thu, 10 Aug 2017 22:52:10 +0000 (18:52 -0400)]
doc doc(inline) and doc(no_inline)

6 years agoImprove enum variants display
Guillaume Gomez [Thu, 10 Aug 2017 22:23:42 +0000 (00:23 +0200)]
Improve enum variants display

6 years agoAuto merge of #43589 - aidanhs:aphs-fix-system-malloc, r=alexcrichton
bors [Thu, 10 Aug 2017 22:32:51 +0000 (22:32 +0000)]
Auto merge of #43589 - aidanhs:aphs-fix-system-malloc, r=alexcrichton

Make a disable-jemalloc build work

Fixes #43510. I've tested this up to building a stage1 compiler.

r? @alexcrichton

cc @cuviper @vorner

@cuviper your fix was almost correct, you just had a stray `!` in there which caused the second error you saw.

6 years agoFix broken links in Arc documentation
Justin Browne [Thu, 10 Aug 2017 22:03:22 +0000 (18:03 -0400)]
Fix broken links in Arc documentation

6 years agoDocument the doc attribute
steveklabnik [Thu, 10 Aug 2017 21:53:36 +0000 (17:53 -0400)]
Document the doc attribute

cc #42322

6 years agoAdd missing links for Error docs
Guillaume Gomez [Thu, 10 Aug 2017 21:14:49 +0000 (23:14 +0200)]
Add missing links for Error docs

6 years agoAdd missing links in io module docs
Guillaume Gomez [Thu, 10 Aug 2017 21:11:40 +0000 (23:11 +0200)]
Add missing links in io module docs

6 years agoAdd missing links in io::Error docs
Guillaume Gomez [Thu, 10 Aug 2017 21:05:50 +0000 (23:05 +0200)]
Add missing links in io::Error docs

6 years agoAdd missing links in ReadDir docs
Guillaume Gomez [Thu, 10 Aug 2017 21:01:59 +0000 (23:01 +0200)]
Add missing links in ReadDir docs

6 years agoAdd missing links on File struct docs
Guillaume Gomez [Thu, 10 Aug 2017 20:50:29 +0000 (22:50 +0200)]
Add missing links on File struct docs

6 years agoAuto merge of #43559 - Nashenas88:nll-region-renumberer, r=arielb1
bors [Thu, 10 Aug 2017 19:48:14 +0000 (19:48 +0000)]
Auto merge of #43559 - Nashenas88:nll-region-renumberer, r=arielb1

Non-lexical lifetimes region renumberer

Regenerates region variables for all regions in a cloned MIR in the nll mir pass. This is part of the work for #43234.

6 years agoFix cross-crate global allocators on windows
Aidan Hobson Sayers [Thu, 10 Aug 2017 13:40:42 +0000 (14:40 +0100)]
Fix cross-crate global allocators on windows

6 years agoAuto merge of #43720 - pornel:staticconst, r=petrochenkov
bors [Thu, 10 Aug 2017 15:10:17 +0000 (15:10 +0000)]
Auto merge of #43720 - pornel:staticconst, r=petrochenkov

Hint correct extern constant syntax

Error message for `extern "C" { const …}` is terse, and the right syntax is hard to guess given unfortunate difference between meaning of `static` in C and Rust.

I've added a hint for the right syntax.

6 years agoFor box expressions, use NZ drop instead of a free block
Ariel Ben-Yehuda [Wed, 9 Aug 2017 19:23:27 +0000 (22:23 +0300)]
For box expressions, use NZ drop instead of a free block

This falls naturally out of making drop elaboration work with `box`
expressions, which is probably required for sane MIR borrow-checking.
This is a pure refactoring with no intentional functional effects.

6 years agoReword error hint
Kornel [Thu, 10 Aug 2017 11:16:01 +0000 (12:16 +0100)]
Reword error hint

6 years agoAuto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoerister
bors [Thu, 10 Aug 2017 11:20:15 +0000 (11:20 +0000)]
Auto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoerister

rustc: Rearchitect lints to be emitted more eagerly

In preparation for incremental compilation this commit refactors the lint
handling infrastructure in the compiler to be more "eager" and overall more
incremental-friendly. Many passes of the compiler can emit lints at various
points but before this commit all lints were buffered in a table to be emitted
at the very end of compilation. This commit changes these lints to be emitted
immediately during compilation using pre-calculated lint level-related data
structures.

Linting today is split into two phases, one set of "early" lints run on the
`syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
"early" lints to running as late as possible in compilation, just before HIR
lowering. This notably means that we're catching resolve-related lints just
before HIR lowering. The early linting remains a pass very similar to how it was
before, maintaining context of the current lint level as it walks the tree.

Post-HIR, however, linting is structured as a method on the `TyCtxt` which
transitively executes a query to calculate lint levels. Each request to lint on
a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
from there about whether the lint should be emitted or not.

The query depends on the entire HIR crate but should be very quick to calculate
(just a quick walk of the HIR) and the red-green system should notice that the
lint level data structure rarely changes, and should hopefully preserve
incrementality.

Overall this resulted in a pretty big change to the test suite now that lints
are emitted much earlier in compilation (on-demand vs only at the end). This in
turn necessitated the addition of many `#![allow(warnings)]` directives
throughout the compile-fail test suite and a number of updates to the UI test
suite.

Closes https://github.com/rust-lang/rust/issues/42511

6 years agoAuto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1
bors [Thu, 10 Aug 2017 08:53:22 +0000 (08:53 +0000)]
Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1

Fixed mutable vars being marked used when they weren't

#### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue.

Fixes #43526, Fixes #30280, Fixes #25049

### Issue
Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings
```
fn do_thing<T>(mut arg : &mut T) {
    ... // don't touch arg - just deref it to access the T
}
```

### Fix
Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables.
#### Why not on things other than local variables?
  * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted.
  * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.

6 years agoFix typo corersponding -> corresponding
Foucher [Thu, 10 Aug 2017 06:49:40 +0000 (08:49 +0200)]
Fix typo corersponding -> corresponding

6 years agoAuto merge of #43737 - GuillaumeGomez:duplicate-method, r=eddyb
bors [Thu, 10 Aug 2017 06:32:19 +0000 (06:32 +0000)]
Auto merge of #43737 - GuillaumeGomez:duplicate-method, r=eddyb

Improve error message when duplicate names for type and trait method

Fixes #43626.

6 years agoAuto merge of #43735 - est31:master, r=alexcrichton
bors [Thu, 10 Aug 2017 04:01:21 +0000 (04:01 +0000)]
Auto merge of #43735 - est31:master, r=alexcrichton

Avoid calling the column!() macro in panic

Closes #43057

This "fix" adds a new macro called `__rust_unstable_column` and to use it instead of the `column` macro inside panic. The new macro can be shadowed as well as `column` can, but its very likely that there is no code that does this in practice.

There is no real way to make "unstable" macros that are usable by stable macros, so we do the next best thing and prefix the macro with `__rust_unstable` to make sure people recognize it is unstable.

r? @alexcrichton

6 years agoAuto merge of #43730 - nrc:driver-shim, r=eddyb
bors [Thu, 10 Aug 2017 01:22:43 +0000 (01:22 +0000)]
Auto merge of #43730 - nrc:driver-shim, r=eddyb

Make the driver API a little more useful for a tools shim

Example use case: https://github.com/nrc/rls-rustc

6 years agoUpdated cargo submodule to fix compile error
Isaac van Bakel [Thu, 10 Aug 2017 01:00:48 +0000 (02:00 +0100)]
Updated cargo submodule to fix compile error

6 years agoAdd a feature gate
est31 [Wed, 9 Aug 2017 23:42:36 +0000 (01:42 +0200)]
Add a feature gate

@alexcrichton figured out a way how to do it :)

6 years agoFix typo in unicode char definition
Matt Ickstadt [Thu, 10 Aug 2017 00:23:05 +0000 (19:23 -0500)]
Fix typo in unicode char definition

6 years agoBetter diagnostics and recovery for `const` in extern blocks
Vadim Petrochenkov [Wed, 9 Aug 2017 22:43:06 +0000 (01:43 +0300)]
Better diagnostics and recovery for `const` in extern blocks

6 years agoAuto merge of #43627 - Aaronepower:master, r=alexcrichton
bors [Wed, 9 Aug 2017 22:41:10 +0000 (22:41 +0000)]
Auto merge of #43627 - Aaronepower:master, r=alexcrichton

Updated release notes for 1.20

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agodriver: factor out `continue_parse_after_error` so it can be controlled via driver API
Nick Cameron [Tue, 8 Aug 2017 05:10:08 +0000 (17:10 +1200)]
driver: factor out `continue_parse_after_error` so it can be controlled via driver API

6 years agofix a typo
nicole mazzuca [Wed, 9 Aug 2017 20:52:43 +0000 (13:52 -0700)]
fix a typo

(this should not have been merged with this typo)

6 years agoAuto merge of #43484 - estebank:point-to-return, r=arielb1
bors [Wed, 9 Aug 2017 19:50:03 +0000 (19:50 +0000)]
Auto merge of #43484 - estebank:point-to-return, r=arielb1

Point at return type always when type mismatch against it

Before this, the diagnostic errors would only point at the return type
when changing it would be a possible solution to a type error. Add a
label to the return type without a suggestion to change in order to make
the source of the expected type obvious.

Follow up to #42850, fixes #25133, fixes #41897.

6 years agorun AddCallGuards for *all* call edges before running AddValidation
Ralf Jung [Wed, 9 Aug 2017 18:30:55 +0000 (11:30 -0700)]
run AddCallGuards for *all* call edges before running AddValidation

6 years agoReadd backticks around ()
Esteban Küber [Wed, 9 Aug 2017 16:57:28 +0000 (09:57 -0700)]
Readd backticks around ()

6 years agoAuto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1
bors [Wed, 9 Aug 2017 17:08:13 +0000 (17:08 +0000)]
Auto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1

Fix covered-switch-default warnings in PassWrapper

(See #39063 for explanation)

6 years agotrans-scheduler: Let main thread take over for other worker.
Michael Woerister [Wed, 9 Aug 2017 16:18:48 +0000 (18:18 +0200)]
trans-scheduler: Let main thread take over for other worker.

6 years agorustc: Rearchitect lints to be emitted more eagerly
Alex Crichton [Thu, 27 Jul 2017 04:51:09 +0000 (21:51 -0700)]
rustc: Rearchitect lints to be emitted more eagerly

In preparation for incremental compilation this commit refactors the lint
handling infrastructure in the compiler to be more "eager" and overall more
incremental-friendly. Many passes of the compiler can emit lints at various
points but before this commit all lints were buffered in a table to be emitted
at the very end of compilation. This commit changes these lints to be emitted
immediately during compilation using pre-calculated lint level-related data
structures.

Linting today is split into two phases, one set of "early" lints run on the
`syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
"early" lints to running as late as possible in compilation, just before HIR
lowering. This notably means that we're catching resolve-related lints just
before HIR lowering. The early linting remains a pass very similar to how it was
before, maintaining context of the current lint level as it walks the tree.

Post-HIR, however, linting is structured as a method on the `TyCtxt` which
transitively executes a query to calculate lint levels. Each request to lint on
a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
from there about whether the lint should be emitted or not.

The query depends on the entire HIR crate but should be very quick to calculate
(just a quick walk of the HIR) and the red-green system should notice that the
lint level data structure rarely changes, and should hopefully preserve
incrementality.

Overall this resulted in a pretty big change to the test suite now that lints
are emitted much earlier in compilation (on-demand vs only at the end). This in
turn necessitated the addition of many `#![allow(warnings)]` directives
throughout the compile-fail test suite and a number of updates to the UI test
suite.

6 years agoUpdate RELEASES.md
Aaron Power [Wed, 9 Aug 2017 15:19:54 +0000 (16:19 +0100)]
Update RELEASES.md

6 years agoAuto merge of #43726 - zackmdavis:extended_information_summer_block_party, r=Guillaum...
bors [Wed, 9 Aug 2017 13:33:36 +0000 (13:33 +0000)]
Auto merge of #43726 - zackmdavis:extended_information_summer_block_party, r=GuillaumeGomez

E05XX odyssey

chipping away at the surface exposed by #43709

r? @GuillaumeGomez

6 years agorustdoc: Fix broken CSS in search results
Oliver Middleton [Wed, 9 Aug 2017 12:41:55 +0000 (13:41 +0100)]
rustdoc: Fix broken CSS in search results

The layout is currently broken for struct/union fields and enum variants
in the search results when searching from a struct, union or enum page.

6 years agoErase/anonymize regions while computing TypeId hash.
Michael Woerister [Tue, 8 Aug 2017 16:11:39 +0000 (18:11 +0200)]
Erase/anonymize regions while computing TypeId hash.

6 years agoAuto merge of #43588 - dns2utf8:wrapping_add, r=sfackler
bors [Wed, 9 Aug 2017 11:10:23 +0000 (11:10 +0000)]
Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler

Use explicit wrapping_add …

… to prevent potential unexpected behavior on debug builds.

6 years agoFix errors on Windows
Ariel Ben-Yehuda [Wed, 9 Aug 2017 09:31:10 +0000 (09:31 +0000)]
Fix errors on Windows

6 years agoextended information for E0557 feature has been removed
Zack M. Davis [Mon, 7 Aug 2017 22:37:13 +0000 (15:37 -0700)]
extended information for E0557 feature has been removed

6 years agoextended information for E0552 unrecognized representation hint
Zack M. Davis [Mon, 7 Aug 2017 22:09:53 +0000 (15:09 -0700)]
extended information for E0552 unrecognized representation hint

6 years agoextended information for E0554 feature attributes only work on nightlies
Zack M. Davis [Mon, 7 Aug 2017 17:57:08 +0000 (10:57 -0700)]
extended information for E0554 feature attributes only work on nightlies

It's more pleasing to use the inner-attribute syntax (`#!` rather than
`#`) in the error message, as that is how `feature` attributes in
particular will be declared (as they apply to the entire crate).

6 years agoextended information for E0571 break with value in non-`loop` loop
Zack M. Davis [Mon, 7 Aug 2017 17:38:16 +0000 (10:38 -0700)]
extended information for E0571 break with value in non-`loop` loop

6 years agoOnly refer to return type when it matches
Esteban Küber [Wed, 9 Aug 2017 01:20:36 +0000 (18:20 -0700)]
Only refer to return type when it matches

6 years agoAuto merge of #43728 - zackmdavis:fnused, r=eddyb
bors [Wed, 9 Aug 2017 04:03:49 +0000 (04:03 +0000)]
Auto merge of #43728 - zackmdavis:fnused, r=eddyb

#[must_use] for functions

This implements [RFC 1940](https://github.com/rust-lang/rfcs/pull/1940).

The RFC and discussion thereof seem to suggest that tagging `PartialEq::eq` and friends as `#[must_use]` would automatically lint for unused comparisons, but it doesn't work out that way (at least the way I've implemented it): unused `.eq` method calls get linted, but not `==` expressions. (The lint operates on the HIR, which sees binary operations as their own thing, even if they ultimately just call `.eq` _&c._.)

What do _you_ think??

Resolves #43302.

6 years agoAuto merge of #43595 - oyvindln:master, r=aturon
bors [Wed, 9 Aug 2017 01:30:02 +0000 (01:30 +0000)]
Auto merge of #43595 - oyvindln:master, r=aturon

Add an overflow check in the Iter::next() impl for Range<_> to help with vectorization.

This helps with vectorization in some cases, such as (0..u16::MAX).collect::<Vec<u16>>(),
 as LLVM is able to change the loop condition to use equality instead of less than and should help with #43124. (See also my [last comment](https://github.com/rust-lang/rust/issues/43124#issuecomment-319098625) there.) This PR makes collect on ranges of u16, i16, i8, and u8 **significantly** faster (at least on x86-64 and i686), and pretty close, though not quite equivalent to a [manual unsafe implementation](https://is.gd/nkoecB). 32 ( and 64-bit values on x86-64) bit values were already vectorized without this change, and they still are. This PR doesn't seem to help with 64-bit values on i686, as they still don't vectorize well compared to doing a manual loop.

I'm a bit unsure if this was the best way of implementing this, I tried to do it with as little changes as possible and avoided changing the step trait and the behavior in RangeFrom (I'll leave that for others like #43127 to discuss wider changes to the trait). I tried simply changing the comparison to `self.start != self.end` though that made the compiler segfault when compiling stage0, so I went with this method instead for now.

As for `next_back()`, reverse ranges seem to optimise properly already.

6 years ago`mem::unreachable`: Add tracking issue
Tobias Bucher [Tue, 8 Aug 2017 23:03:50 +0000 (01:03 +0200)]
`mem::unreachable`: Add tracking issue

6 years agoPut `intrinsics::unreachable` on a possible path to stabilization
Tobias Bucher [Tue, 8 Aug 2017 22:47:38 +0000 (00:47 +0200)]
Put `intrinsics::unreachable` on a possible path to stabilization

Mark it with the `unreachable` feature and put it into the `mem` module.
This is a pretty straight-forward API that can already be simulated in
stable Rust by using `transmute` to create an uninhabited enum that can
be matched.

6 years agoAuto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus
bors [Tue, 8 Aug 2017 22:14:12 +0000 (22:14 +0000)]
Auto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus

Fix rustdoc

Fixes #43625.

r? @rust-lang/dev-tools

cc @rust-lang/docs

6 years agoexplain that the example is indeed UB, but that's okay
Ralf Jung [Tue, 8 Aug 2017 21:50:27 +0000 (14:50 -0700)]
explain that the example is indeed UB, but that's okay

6 years agoUse explicit wrapping_add to prevent potential unexpected behavior on debug builds
Stefan Schindler [Tue, 1 Aug 2017 14:25:36 +0000 (16:25 +0200)]
Use explicit wrapping_add to prevent potential unexpected behavior on debug builds

6 years agoFix trait name `Deref`
Natalie Boehm [Tue, 8 Aug 2017 20:57:11 +0000 (16:57 -0400)]
Fix trait name `Deref`

6 years agoImprove headers linking
Guillaume Gomez [Tue, 8 Aug 2017 20:16:08 +0000 (22:16 +0200)]
Improve headers linking

6 years agoAuto merge of #43711 - lu-zero:master, r=nagisa
bors [Tue, 8 Aug 2017 19:34:05 +0000 (19:34 +0000)]
Auto merge of #43711 - lu-zero:master, r=nagisa

More Altivec intrinsics

Beside the usual json + generated files, I added two additional modifiers in the generator.

6 years agoRemove all usage of hoedown_buffer_puts
Guillaume Gomez [Tue, 8 Aug 2017 19:25:39 +0000 (21:25 +0200)]
Remove all usage of hoedown_buffer_puts

6 years agoImprove error message when duplicate names for type and trait method
Guillaume Gomez [Tue, 8 Aug 2017 12:12:06 +0000 (14:12 +0200)]
Improve error message when duplicate names for type and trait method

6 years agoUpdate solution to add using `&*` as well as `as_str()`
Natalie Boehm [Tue, 8 Aug 2017 18:57:34 +0000 (14:57 -0400)]
Update solution to add using `&*` as well as `as_str()`

6 years agomark comparison trait methods as #[must_use]
Zack M. Davis [Tue, 8 Aug 2017 04:23:58 +0000 (21:23 -0700)]
mark comparison trait methods as #[must_use]

Note that this doesn't actually give us warnings on `a == b;` and the like, as
some observers may have hoped.

This is in the matter of #43302.

6 years ago#[must_use] for functions (RFC 1940)
Zack M. Davis [Tue, 8 Aug 2017 00:20:19 +0000 (17:20 -0700)]
#[must_use] for functions (RFC 1940)

The return value of a function annotated with `must_use`, must be used.

This is in the matter of #43302.

6 years agoIgnore tests that fail on stage1
Malo Jaffré [Tue, 8 Aug 2017 14:53:49 +0000 (16:53 +0200)]
Ignore tests that fail on stage1

That makes ./x.py test --stage 1 work on x86_64-unknown-linux-gnu.

6 years agoType-check `break value;` even outside of `loop {}`.
kennytm [Tue, 8 Aug 2017 15:28:09 +0000 (23:28 +0800)]
Type-check `break value;` even outside of `loop {}`.

Fix #43162, fix #43727.

6 years agoImplement HashStable for Xyz<'gcx> instead of Xyz<'lcx>.
Michael Woerister [Tue, 8 Aug 2017 15:56:28 +0000 (17:56 +0200)]
Implement HashStable for Xyz<'gcx> instead of Xyz<'lcx>.