]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoThe `proc_macro_raw_ident` feature is now at #54723
Alex Crichton [Mon, 1 Oct 2018 17:44:19 +0000 (10:44 -0700)]
The `proc_macro_raw_ident` feature is now at #54723

5 years agoThe `proc_macro_quote` feature now lives at #54722
Alex Crichton [Mon, 1 Oct 2018 17:42:16 +0000 (10:42 -0700)]
The `proc_macro_quote` feature now lives at #54722

5 years agoAuto merge of #54667 - RalfJung:maybe-uninit, r=pnkfelix
bors [Mon, 1 Oct 2018 14:58:24 +0000 (14:58 +0000)]
Auto merge of #54667 - RalfJung:maybe-uninit, r=pnkfelix

Panic when using mem::uninitialized or mem::zeroed on an uninhabited type

All code by @japaric. This re-submits one half of https://github.com/rust-lang/rust/pull/53508. This is likely not the one that introduced the perf regression, but just to be sure I'll do a perf run anyway.

5 years agoAuto merge of #54711 - kennytm:rollup, r=kennytm
bors [Mon, 1 Oct 2018 10:16:00 +0000 (10:16 +0000)]
Auto merge of #54711 - kennytm:rollup, r=kennytm

Rollup of 13 pull requests

Successful merges:

 - #53784 (Document that slices cannot be larger than `isize::MAX` bytes)
 - #54308 (Better user experience when attempting to call associated functions with dot notation)
 - #54488 (in which we include attributes in unused `extern crate` suggestion spans)
 - #54544 (Indicate how to move value out of Box in docs.)
 - #54623 (Added help message for `impl_trait_in_bindings` feature gate)
 - #54641 (A few cleanups and minor improvements to rustc/infer)
 - #54656 (Correct doc for WorkQueue<T>::pop().)
 - #54674 (update miri)
 - #54676 (Remove `-Z disable_ast_check_for_mutation_in_guard`)
 - #54679 (Improve bug! message for impossible case in Relate)
 - #54681 (Rename sanitizer runtime libraries on OSX)
 - #54708 (Make ./x.py help <cmd> invoke ./x.py <cmd> -h on its own)
 - #54713 (Add nightly check for tool_lints warning)

5 years agoRollup merge of #54676 - pnkfelix:issue-15287-kill-zflag-disabling-ast-check, r=alexc...
kennytm [Mon, 1 Oct 2018 09:49:33 +0000 (17:49 +0800)]
Rollup merge of #54676 - pnkfelix:issue-15287-kill-zflag-disabling-ast-check, r=alexcrichton

Remove `-Z disable_ast_check_for_mutation_in_guard`

One should use `#![feature(bind_by_move_pattern_guards)]` over `-Z disable_ast_check_for_mutation_in_guard`

cc #15287

5 years agoRollup merge of #54713 - flip1995:tool_lints_nightly, r=Manishearth
kennytm [Mon, 1 Oct 2018 09:49:09 +0000 (17:49 +0800)]
Rollup merge of #54713 - flip1995:tool_lints_nightly, r=Manishearth

Add nightly check for tool_lints warning

cc #54358

Let's add the nightly check, just in case something prevents a stabilization until 1.31.beta.

5 years agoRollup merge of #54674 - RalfJung:miri, r=oli-obk
kennytm [Mon, 1 Oct 2018 09:47:14 +0000 (17:47 +0800)]
Rollup merge of #54674 - RalfJung:miri, r=oli-obk

update miri

5 years agoAdd nightly check for tool_lints warning
flip1995 [Mon, 1 Oct 2018 09:11:58 +0000 (11:11 +0200)]
Add nightly check for tool_lints warning

cc #54358

5 years agoRollup merge of #54708 - collin5:b49475, r=Mark-Simulacrum
kennytm [Mon, 1 Oct 2018 08:13:05 +0000 (16:13 +0800)]
Rollup merge of #54708 - collin5:b49475, r=Mark-Simulacrum

Make ./x.py help <cmd> invoke ./x.py <cmd> -h on its own

Fixes #49475

r? @Mark-Simulacrum

5 years agoRollup merge of #54681 - alexcrichton:san-names, r=kennytm
kennytm [Mon, 1 Oct 2018 08:13:04 +0000 (16:13 +0800)]
Rollup merge of #54681 - alexcrichton:san-names, r=kennytm

Rename sanitizer runtime libraries on OSX

Currently we ship sanitizer libraries as they're built, but these names
unfortunately conflict with the names of the sanitizer libraries
installed on the system. If a crate, for example, links in C code that
wants to use the system sanitizer and the Rust code doesn't use
sanitizers at all, then using `cargo` may accidentally pull in the
Rust-installed sanitizer library due to a conflict in names.

This change is intended to be entirely transparent for Rust users of
sanitizers, it should only hopefully improve our story with other users!

Closes #54134

5 years agoRollup merge of #54679 - phansch:improve_bug_message, r=matthewjasper
kennytm [Mon, 1 Oct 2018 08:13:03 +0000 (16:13 +0800)]
Rollup merge of #54679 - phansch:improve_bug_message, r=matthewjasper

Improve bug! message for impossible case in Relate

Hitting this branch [in Clippy][clippy_issue] and I think it makes sense to print
both values here in case other people hit this branch, too.

(still have to figure out why this branch is hit)

[clippy_issue]: https://github.com/rust-lang-nursery/rust-clippy/issues/2831#issuecomment-424597092

5 years agoRollup merge of #54656 - nieksand:workqueue_doc, r=varkor
kennytm [Mon, 1 Oct 2018 08:13:02 +0000 (16:13 +0800)]
Rollup merge of #54656 - nieksand:workqueue_doc, r=varkor

Correct doc for WorkQueue<T>::pop().

The old function doc looks like copy-pasta from WorkQueue::insert().

WorkQueue::pop() does not enqueue nor does it return a boolean false.  Doc corrected accordingly.

5 years agoRollup merge of #54641 - ljedrz:cleanup_rustc_infer, r=estebank
kennytm [Mon, 1 Oct 2018 08:13:00 +0000 (16:13 +0800)]
Rollup merge of #54641 - ljedrz:cleanup_rustc_infer, r=estebank

A few cleanups and minor improvements to rustc/infer

- use unwrap_or(_else) where applicable
- convert single-branch matches to if-let
- use to_owned instead of to_string with string literals
- improve vector allocations
- readability improvements
- miscellaneous minor code improvements

5 years agoRollup merge of #54623 - alexreg:impl_trait_in_bindings-help, r=estebank
kennytm [Mon, 1 Oct 2018 08:12:59 +0000 (16:12 +0800)]
Rollup merge of #54623 - alexreg:impl_trait_in_bindings-help, r=estebank

Added help message for `impl_trait_in_bindings` feature gate

r? @estebank

CC @Centril

5 years agoRollup merge of #54544 - frewsxcv:frewsxcv-deref, r=GuillaumeGomez
kennytm [Mon, 1 Oct 2018 08:12:58 +0000 (16:12 +0800)]
Rollup merge of #54544 - frewsxcv:frewsxcv-deref, r=GuillaumeGomez

Indicate how to move value out of Box in docs.

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

5 years agoRollup merge of #54488 - zackmdavis:and_the_case_of_the_unused_crate, r=estebank
kennytm [Mon, 1 Oct 2018 08:12:56 +0000 (16:12 +0800)]
Rollup merge of #54488 - zackmdavis:and_the_case_of_the_unused_crate, r=estebank

in which we include attributes in unused `extern crate` suggestion spans

![unused_extern](https://user-images.githubusercontent.com/1076988/45921698-50243e80-be6f-11e8-930a-7b2a33b4935c.png)

Resolves #54400.

r? @estebank

5 years agoRollup merge of #54308 - dsciarra:issue-22692, r=estebank
kennytm [Mon, 1 Oct 2018 08:12:55 +0000 (16:12 +0800)]
Rollup merge of #54308 - dsciarra:issue-22692, r=estebank

Better user experience when attempting to call associated functions with dot notation

Closes #22692

5 years agoRollup merge of #53784 - tbu-:pr_doc_slice_isize_max, r=RalfJung
kennytm [Mon, 1 Oct 2018 08:12:54 +0000 (16:12 +0800)]
Rollup merge of #53784 - tbu-:pr_doc_slice_isize_max, r=RalfJung

Document that slices cannot be larger than `isize::MAX` bytes

Fixes #53676.

5 years agoAuto merge of #54675 - alexcrichton:defaultlibs, r=varkor
bors [Mon, 1 Oct 2018 03:24:02 +0000 (03:24 +0000)]
Auto merge of #54675 - alexcrichton:defaultlibs, r=varkor

rust: Add a `-C default-linker-libraries` option

This commit adds a new codegen option for the compiler which disables
rustc's passing of `-nodefaultlibs` by default on relevant platforms.
Sometimes Rust is linked with C code which fails to link with
`-nodefaultlibs` and is unnecessarily onerous to get linking correctly
with `-nodefaultlibs`.

An example of this is that when you compile C code with sanitizers and
then pass `-fsanitize=address` to the linker, it's incompatible with
`-nodefaultlibs` also being passed to the linker.

In these situations it's easiest to turn off Rust's default passing of
`-nodefaultlibs`, which was more ideological to start with than
anything! Preserving the default is somewhat important but having this
be opt-in shouldn't cause any breakage.

Closes #54237

5 years agoallow use of ./x.py help <cmd> ...
Collins Abitekaniza [Mon, 1 Oct 2018 01:06:58 +0000 (04:06 +0300)]
allow use of ./x.py help <cmd> ...

5 years agoAuto merge of #54662 - matklad:once-perf, r=alexcrichton
bors [Mon, 1 Oct 2018 00:51:19 +0000 (00:51 +0000)]
Auto merge of #54662 - matklad:once-perf, r=alexcrichton

Fix Once perf regression

Because `call_once` is generic, but `is_completed` is not, we need
`#[inline]` annotation to allow LLVM to inline `is_completed` into
`call_once` in downstream crates.

cc https://github.com/rust-lang/rust/pull/53027/files#r221418859

5 years agoAuto merge of #54650 - eddyb:no-extern's-land, r=alexcrichton
bors [Sun, 30 Sep 2018 22:20:16 +0000 (22:20 +0000)]
Auto merge of #54650 - eddyb:no-extern's-land, r=alexcrichton

Don't lint non-extern-prelude extern crate's in Rust 2018.

Fixes #54381 by silencing the lint telling users to remove `extern crate` when `use` doesn't work.

r? @alexcrichton cc @petrochenkov @nikomatsakis @Centril

5 years agoAdded help message for `impl_trait_in_bindings` feature gate.
Alexander Regueiro [Thu, 27 Sep 2018 21:34:19 +0000 (22:34 +0100)]
Added help message for `impl_trait_in_bindings` feature gate.

5 years agoAuto merge of #53255 - orium:fix-bug-overflow-send, r=arielb1
bors [Sun, 30 Sep 2018 19:41:07 +0000 (19:41 +0000)]
Auto merge of #53255 - orium:fix-bug-overflow-send, r=arielb1

Add a per-tree error cache to the obligation forest

This implements part of what @nikomatsakis mentioned in  https://github.com/rust-lang/rust/pull/30533#issuecomment-170705871:

> 1. If you find that a new obligation is a duplicate of one already in the tree, the proper processing is:
>      * if that other location is your parent, you should abort with a cycle error (or accept it, if coinductive)
>      * if that other location is not an ancestor, you can safely ignore the new obligation

In particular it implements the "if that other location is your parent accept it, if coinductive" part.  This fixes #40827.

I have to say that I'm not 100% confident that this is rock solid.  This is my first pull request :tada:, and I didn't know anything about the trait resolver before this.  In particular I'm not totally sure that comparing predicates is enough (for instance, do we need to compare `param_env` as well?).  Also, I'm not sure what @nikomatsakis mentions [here](https://github.com/rust-lang/rust/issues/30977#issue-127091096), but it might be something that affects this PR:

> In particular, I am wary of getting things wrong around inference variables! We can always add things to the set in their current state, and if unifications occur then the obligation is just kind of out-of-date, but I want to be sure we don't accidentally fail to notice that something is our ancestor. I decided this was subtle enough to merit its own PR.

Anyway, go ahead and review :slightly_smiling_face:.

Ref #30977.

# Performance

We are now copying vectors around, so I decided to do some benchmarking.  A simple benchmark shows that this does not seem to affect performance in a measurable way:

I ran `cargo clean && cargo build` 20 times on actix-web (84b27db) and these are the results:

```text
rustc master:

            Mean        Std.Dev.    Min         Median      Max
real        66.637      2.996       57.220      67.714      69.314
user        307.293     14.741      258.093     312.209     320.702
sys         12.524      0.653       10.499      12.726      13.193

rustc fix-bug-overflow-send:

            Mean        Std.Dev.    Min         Median      Max
real        66.297      4.310       53.532      67.516      70.348
user        306.812     22.371      236.917     314.748     326.229
sys         12.757      0.952       9.671       13.125      13.544
```

I will do a more comprehensive benchmark (compiling rustc stage1) and post the results.

r? @nikomatsakis, @nnethercote

PS: It is better to review this commit-by-commit.

5 years agoDeduplicate errors in the obligation forest.
Diogo Sousa [Sun, 30 Sep 2018 01:41:49 +0000 (02:41 +0100)]
Deduplicate errors in the obligation forest.

Fixes #40827.

5 years agoTypos and style fixes.
Diogo Sousa [Fri, 10 Aug 2018 17:13:43 +0000 (18:13 +0100)]
Typos and style fixes.

5 years agothe test requires unwinding so we don't run it on the wasm32-bare target
Jorge Aparicio [Fri, 21 Sep 2018 21:40:00 +0000 (23:40 +0200)]
the test requires unwinding so we don't run it on the wasm32-bare target

5 years agoadd codegen test
Jorge Aparicio [Thu, 20 Sep 2018 18:57:25 +0000 (20:57 +0200)]
add codegen test

5 years agomake the nil-enum test work again
Jorge Aparicio [Sat, 1 Sep 2018 18:13:13 +0000 (20:13 +0200)]
make the nil-enum test work again

5 years agoadapt to change in Session API
Jorge Aparicio [Thu, 23 Aug 2018 14:18:28 +0000 (16:18 +0200)]
adapt to change in Session API

5 years agoallow dead_code
Jorge Aparicio [Sat, 22 Sep 2018 22:37:08 +0000 (00:37 +0200)]
allow dead_code

5 years agoadd empty enum to the test cases
Jorge Aparicio [Thu, 23 Aug 2018 14:49:35 +0000 (16:49 +0200)]
add empty enum to the test cases

5 years agoimprove the run-pass test
Jorge Aparicio [Thu, 23 Aug 2018 14:49:00 +0000 (16:49 +0200)]
improve the run-pass test

5 years agomove our check to reuse a previous computation
Jorge Aparicio [Thu, 23 Aug 2018 14:39:03 +0000 (16:39 +0200)]
move our check to reuse a previous computation

5 years agoimprove panic message
Jorge Aparicio [Thu, 23 Aug 2018 14:36:51 +0000 (16:36 +0200)]
improve panic message

5 years agouse is_uninhabited in more places
Jorge Aparicio [Thu, 23 Aug 2018 14:34:38 +0000 (16:34 +0200)]
use is_uninhabited in more places

5 years agopanic when instantiating an uninhabited type via mem::{uninitialized,zeroed}
Jorge Aparicio [Sun, 19 Aug 2018 15:36:04 +0000 (17:36 +0200)]
panic when instantiating an uninhabited type via mem::{uninitialized,zeroed}

5 years agoAuto merge of #54622 - matthewjasper:more-nll-mode, r=pnkfelix
bors [Sun, 30 Sep 2018 14:38:47 +0000 (14:38 +0000)]
Auto merge of #54622 - matthewjasper:more-nll-mode, r=pnkfelix

Enable NLL compare mode for more tests

Most of these tests were disabled due to NLL bugs that have since been fixed. A few needed updating for NLL.

r? @nikomatsakis

5 years agoAuto merge of #54596 - mjbshaw:drop, r=RalfJung
bors [Sun, 30 Sep 2018 12:00:45 +0000 (12:00 +0000)]
Auto merge of #54596 - mjbshaw:drop, r=RalfJung

Make core::mem::needs_drop a const fn

This fixes #51929.

5 years agoAuto merge of #53816 - zackmdavis:elided_lifetimes_in_paths_field_day, r=nikomatsakis
bors [Sun, 30 Sep 2018 09:22:31 +0000 (09:22 +0000)]
Auto merge of #53816 - zackmdavis:elided_lifetimes_in_paths_field_day, r=nikomatsakis

don't elide lifetimes in paths in librustc/

In light of the "Apply to rustc" checkbox on #44524 and @nikomatsakis's [recent comment about regularly wanting visual indication of elided lifetimes in types](https://github.com/rust-lang/rust/issues/44524#issuecomment-414663773), I was curious to see what it would look like if we turned the `elided_lifetimes_in_path` lint on in at least one crate in the codebase (I chose librustc). Given that I couldn't figure out how to get `cargo fix` work with the build system, this arguably wasn't a very efficient use of my time, but once I started, the conjunction of moral law and the sunk cost fallacy forced me to continue.

This is mostly applying the `<'_>` suggestions issued by the lint, but there were a few places where I named the lifetimes (_e.g._, `<'a, 'gcx, 'tcx>` on `TyCtxt`) in order to match style with surrounding code.

r? @nikomatsakis

5 years agoAuto merge of #54639 - nagisa:lets-alias-for-now, r=eddyb
bors [Sun, 30 Sep 2018 06:44:13 +0000 (06:44 +0000)]
Auto merge of #54639 - nagisa:lets-alias-for-now, r=eddyb

Do not put noalias annotations by default

This will be re-enabled sooner or later depending on results of further
investigation.

Fixes #54462

Beta backport is: #54640

r? @nikomatsakis

5 years agodon't elide lifetimes in paths in librustc/
Zack M. Davis [Thu, 30 Aug 2018 05:02:42 +0000 (22:02 -0700)]
don't elide lifetimes in paths in librustc/

This seemed like a good way to kick the tires on the
elided-lifetimes-in-paths lint (#52069)—seems to work! This was also
pretty tedious—it sure would be nice if `cargo fix` worked on this
codebase (#53896)!

5 years agoMerge branch 'master' into drop
Michael Bradshaw [Sun, 30 Sep 2018 02:51:09 +0000 (19:51 -0700)]
Merge branch 'master' into drop

5 years agoFix ui/run-pass/union/union-nodrop.rs test
Michael Bradshaw [Sun, 30 Sep 2018 02:49:17 +0000 (19:49 -0700)]
Fix ui/run-pass/union/union-nodrop.rs test

5 years agoAuto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrum
bors [Sun, 30 Sep 2018 01:45:50 +0000 (01:45 +0000)]
Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrum

Bump to 1.31.0 and bootstrap from 1.30 beta

Closes #54594.

5 years agoCorrect doc for WorkQueue<T>::pop().
Niek Sanders [Sat, 29 Sep 2018 22:24:37 +0000 (00:24 +0200)]
Correct doc for WorkQueue<T>::pop().

5 years agoAuto merge of #54591 - ljedrz:cleanup_typeck_rest, r=zackmdavis
bors [Sat, 29 Sep 2018 22:20:01 +0000 (22:20 +0000)]
Auto merge of #54591 - ljedrz:cleanup_typeck_rest, r=zackmdavis

A few cleanups and minor improvements to typeck

This PR complements https://github.com/rust-lang/rust/pull/54533, which was limited to `check`.

- change a few `push` loops to `extend`s
- prefer `to_owned` to `to_string` for string literals
- prefer `if let` to `match` where only one branch matters
- a few other minor improvements
- whitespace fixes

5 years agoRename sanitizer runtime libraries on OSX
Alex Crichton [Sat, 29 Sep 2018 19:37:12 +0000 (12:37 -0700)]
Rename sanitizer runtime libraries on OSX

Currently we ship sanitizer libraries as they're built, but these names
unfortunately conflict with the names of the sanitizer libraries
installed on the system. If a crate, for example, links in C code that
wants to use the system sanitizer and the Rust code doesn't use
sanitizers at all, then using `cargo` may accidentally pull in the
Rust-installed sanitizer library due to a conflict in names.

This change is intended to be entirely transparent for Rust users of
sanitizers, it should only hopefully improve our story with other users!

Closes #54134

5 years agoImprove bug! message for impossible case in Relate
Philipp Hansch [Sat, 29 Sep 2018 06:04:34 +0000 (08:04 +0200)]
Improve bug! message for impossible case in Relate

Hitting this branch in Clippy and I think it makes sense to print
both values here in case other people hit this branch, too.

5 years agoAuto merge of #54240 - csmoe:nonzero_from, r=alexcrichton
bors [Sat, 29 Sep 2018 19:38:12 +0000 (19:38 +0000)]
Auto merge of #54240 - csmoe:nonzero_from, r=alexcrichton

Impl From<NonZero<T>> for T

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

r? @SimonSapin

5 years agoImprove ux when calling associated functions with dot notation
Donato Sciarra [Mon, 17 Sep 2018 21:37:20 +0000 (23:37 +0200)]
Improve ux when calling associated functions with dot notation

Issue: 22692

5 years agorust: Add a `-C default-linker-libraries` option
Alex Crichton [Sat, 29 Sep 2018 18:03:59 +0000 (11:03 -0700)]
rust: Add a `-C default-linker-libraries` option

This commit adds a new codegen option for the compiler which disables
rustc's passing of `-nodefaultlibs` by default on relevant platforms.
Sometimes Rust is linked with C code which fails to link with
`-nodefaultlibs` and is unnecessarily onerous to get linking correctly
with `-nodefaultlibs`.

An example of this is that when you compile C code with sanitizers and
then pass `-fsanitize=address` to the linker, it's incompatible with
`-nodefaultlibs` also being passed to the linker.

In these situations it's easiest to turn off Rust's default passing of
`-nodefaultlibs`, which was more ideological to start with than
anything! Preserving the default is somewhat important but having this
be opt-in shouldn't cause any breakage.

Closes #54237

5 years agoupdate miri
Ralf Jung [Sat, 29 Sep 2018 17:43:15 +0000 (19:43 +0200)]
update miri

5 years agoAuto merge of #54599 - nikomatsakis:issue-54593-impl-Trait, r=eddyb
bors [Sat, 29 Sep 2018 15:07:59 +0000 (15:07 +0000)]
Auto merge of #54599 - nikomatsakis:issue-54593-impl-Trait, r=eddyb

use closure def-id in returns, but base def-id in locals

The refactorings to  handle `let x: impl Trait`  wound up breaking `impl Trait` in closure return types. I think there are some deeper problems with the code in question, but this a least should make @eddyb's example work.

Fixes #54593

r? @eddyb

5 years agorustc/infer: miscellaneous minor code improvements
ljedrz [Fri, 28 Sep 2018 15:38:02 +0000 (17:38 +0200)]
rustc/infer: miscellaneous minor code improvements

5 years agorustc/infer: readability improvements
ljedrz [Fri, 28 Sep 2018 15:35:31 +0000 (17:35 +0200)]
rustc/infer: readability improvements

5 years agorustc/infer: improve vector allocations
ljedrz [Fri, 28 Sep 2018 15:32:22 +0000 (17:32 +0200)]
rustc/infer: improve vector allocations

5 years agorustc/infer: use to_owned instead of to_string with string literals
ljedrz [Fri, 28 Sep 2018 15:28:47 +0000 (17:28 +0200)]
rustc/infer: use to_owned instead of to_string with string literals

5 years agorustc/infer: convert single-branch matches to if-let
ljedrz [Fri, 28 Sep 2018 15:26:10 +0000 (17:26 +0200)]
rustc/infer: convert single-branch matches to if-let

5 years agorustc/infer: use unwrap_or(_else) where applicable
ljedrz [Fri, 28 Sep 2018 15:20:37 +0000 (17:20 +0200)]
rustc/infer: use unwrap_or(_else) where applicable

5 years agoAuto merge of #54660 - kennytm:rollup, r=kennytm
bors [Sat, 29 Sep 2018 12:35:39 +0000 (12:35 +0000)]
Auto merge of #54660 - kennytm:rollup, r=kennytm

Rollup of 8 pull requests

Successful merges:

 - #54564 (Add 1.29.1 release notes)
 - #54567 (Include path in stamp hash for debuginfo tests)
 - #54577 (rustdoc: give proc-macros their own pages)
 - #54590 (std: Don't let `rust_panic` get inlined)
 - #54598 (Remove useless lifetimes from `Pin` `impl`s.)
 - #54604 (Added help message for `self_in_typedefs` feature gate)
 - #54635 (Improve docs for std::io::Seek)
 - #54645 (Compute Android gdb version in compiletest)

5 years agoDo not put noalias annotations by default
Simonas Kazlauskas [Fri, 28 Sep 2018 14:40:06 +0000 (17:40 +0300)]
Do not put noalias annotations by default

This will be re-enabled sooner or later depending on results of further
investigation.

Fixes #54462

5 years agoAuto merge of #54554 - RalfJung:maybe-uninit, r=nagisa
bors [Sat, 29 Sep 2018 09:58:09 +0000 (09:58 +0000)]
Auto merge of #54554 - RalfJung:maybe-uninit, r=nagisa

Revert most of MaybeUninit, except for the new API itself

This reverts most of https://github.com/rust-lang/rust/pull/53508/ for perf reasons (first commit reverts that entire PR), except for the new API itself (added back in 2nd commit).

5 years agoA few cleanups and minor improvements to typeck
ljedrz [Wed, 26 Sep 2018 15:32:23 +0000 (17:32 +0200)]
A few cleanups and minor improvements to typeck

5 years agoRollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomez
kennytm [Sat, 29 Sep 2018 08:46:30 +0000 (16:46 +0800)]
Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomez

rustdoc: give proc-macros their own pages

related to https://github.com/rust-lang/rust/issues/49553 but i don't think it'll fix it

Currently, rustdoc doesn't expose proc-macros all that well. In the source crate, only their definition function is exposed, but when re-exported, they're treated as a macro! This is an awkward situation in all accounts. This PR checks functions to see whether they have any of `#[proc_macro]`, `#[proc_macro_attribute]`, or `#[proc_macro_derive]`, and exposes them as macros instead. In addition, attributes and derives are exposed differently than other macros, getting their own item-type, CSS class, and module heading.

![image](https://user-images.githubusercontent.com/5217170/46044803-6df8da00-c0e1-11e8-8c3b-25d2c3beb55c.png)

Function-like proc-macros are lumped in with `macro_rules!` macros, but they get a different declaration block (i'm open to tweaking this, it's just what i thought of given how function-proc-macros operate):

![image](https://user-images.githubusercontent.com/5217170/46044828-84069a80-c0e1-11e8-9cc4-127e5477c395.png)

Proc-macro attributes and derives get their own pages, with a representative declaration block. Derive macros also show off their helper attributes:

![image](https://user-images.githubusercontent.com/5217170/46094583-ef9f4500-c17f-11e8-8f71-fa0a7895c9f6.png)

![image](https://user-images.githubusercontent.com/5217170/46101529-cab3cd80-c191-11e8-857a-946897750da1.png)

There's one wrinkle which this PR doesn't address, which is why i didn't mark this as fixing the linked issue. Currently, proc-macros don't expose their attributes or source span across crates, so while rustdoc knows they exist, that's about all the information it gets. This leads to an "inlined" macro that has absolutely no docs on it, and no `[src]` link to show you where it was declared.

The way i got around it was to keep proc-macro re-export disabled, since we do get enough information across crates to properly link to the source page:

![image](https://user-images.githubusercontent.com/5217170/46045074-2cb4fa00-c0e2-11e8-81bc-33a8205fbd03.png)

Until we can get a proc-macro's docs (and ideally also its source span) across crates, i believe this is the best way forward.

5 years agoRollup merge of #54645 - tromey:android-gdb-version, r=alexcrichton
kennytm [Sat, 29 Sep 2018 05:21:21 +0000 (13:21 +0800)]
Rollup merge of #54645 - tromey:android-gdb-version, r=alexcrichton

Compute Android gdb version in compiletest

compiletest has special code for running gdb for Android targets.  In
particular it computes a different path to gdb.  However, this gdb is
not used for the version test, which results in some tests being run
when they should not be.  You can see this in #54004.

This patch moves the special case to analyze_gdb and a new helper
function to decide whether the case applies.  This causes the version
check to work properly.

Note that the bulk of the runtest.rs change is just reindentation
caused by moving from a "match" to an "if" -- but there is a (small)
change buried in there.

5 years agoRollup merge of #54635 - neoeinstein:seek-docs, r=alexcrichton
kennytm [Sat, 29 Sep 2018 05:21:18 +0000 (13:21 +0800)]
Rollup merge of #54635 - neoeinstein:seek-docs, r=alexcrichton

Improve docs for std::io::Seek

Fixes #54562

5 years agoRollup merge of #54604 - alexreg:self_in_typedefs-help, r=estebank
kennytm [Sat, 29 Sep 2018 05:21:17 +0000 (13:21 +0800)]
Rollup merge of #54604 - alexreg:self_in_typedefs-help, r=estebank

Added help message for `self_in_typedefs` feature gate

Fixes #54563.

CC @Centril @estebank @leonardo-m

5 years agoRollup merge of #54598 - pthariensflame:patch-1, r=sfackler
kennytm [Sat, 29 Sep 2018 05:21:16 +0000 (13:21 +0800)]
Rollup merge of #54598 - pthariensflame:patch-1, r=sfackler

Remove useless lifetimes from `Pin` `impl`s.

These were evidently left in by accident when the new API was switched over to.

5 years agoRollup merge of #54590 - alexcrichton:inline-never-rust-panic, r=dtolnay
kennytm [Sat, 29 Sep 2018 05:21:15 +0000 (13:21 +0800)]
Rollup merge of #54590 - alexcrichton:inline-never-rust-panic, r=dtolnay

std: Don't let `rust_panic` get inlined

It's meant for breakpoints, so if it gets inlined we can't set a
breakpoint on it easily!

Will hopefully help fix at least one aspect of https://github.com/rust-lang/rust/issues/49013

5 years agoFix Once perf regression
Aleksey Kladov [Sat, 29 Sep 2018 08:07:48 +0000 (11:07 +0300)]
Fix Once perf regression

Because `call_once` is generic, but `is_completed` is not, we need
`#[inline]` annotation to allow LLVM to inline `is_completed` into
`call_once` in downstream crates.

5 years agoadd MaybeUninit
Jorge Aparicio [Sun, 19 Aug 2018 13:51:35 +0000 (15:51 +0200)]
add MaybeUninit

5 years agoRevert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"
Ralf Jung [Tue, 25 Sep 2018 13:07:27 +0000 (15:07 +0200)]
Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"

This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing
changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.

5 years agoAuto merge of #54576 - froydnj:non-x86-abi-adjustment, r=alexcrichton
bors [Sat, 29 Sep 2018 07:23:00 +0000 (07:23 +0000)]
Auto merge of #54576 - froydnj:non-x86-abi-adjustment, r=alexcrichton

ignore {std,fast,vector,this}call on non-x86 windows

MSVC ignores these keywords for C/C++ and uses the standard system
calling convention.  Rust should do so as well.

Fixes #54569.

5 years agoRollup merge of #54567 - tromey:paths-in-stamp-hashes, r=Mark-Simulacrum
kennytm [Sat, 29 Sep 2018 05:21:12 +0000 (13:21 +0800)]
Rollup merge of #54567 - tromey:paths-in-stamp-hashes, r=Mark-Simulacrum

Include path in stamp hash for debuginfo tests

The debuginfo tests are exposed to the environment in a couple of
ways: the path to the gdb executable matters, as does the Python path
used when loading lldb.

This patch incorporates these paths into the hash that is written to
the stamp file, so that changing the path will cause the tests to be
re-run.

5 years agoRollup merge of #54564 - alexcrichton:new-notes, r=kennytm
kennytm [Sat, 29 Sep 2018 05:21:10 +0000 (13:21 +0800)]
Rollup merge of #54564 - alexcrichton:new-notes, r=kennytm

Add 1.29.1 release notes

Forward-port of #54397, should have included it earlier!

5 years agoAuto merge of #54278 - eddyb:spanned-generic-predicates, r=nikomatsakis
bors [Sat, 29 Sep 2018 03:42:38 +0000 (03:42 +0000)]
Auto merge of #54278 - eddyb:spanned-generic-predicates, r=nikomatsakis

rustc: keep a Span for each predicate in ty::GenericPredicates.

This should allow finer-grained diagnostics, including migration suggestions for #54090.
(Note that I haven't changed most of the users of `predicates_of` to use the new spans)

r? @nikomatsakis

5 years agoIndicate how to move value out of Box in docs.
Corey Farwell [Tue, 25 Sep 2018 01:55:54 +0000 (21:55 -0400)]
Indicate how to move value out of Box in docs.

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

5 years agoAuto merge of #53013 - zackmdavis:infer_outlints, r=nikomatsakis
bors [Sat, 29 Sep 2018 01:09:07 +0000 (01:09 +0000)]
Auto merge of #53013 - zackmdavis:infer_outlints, r=nikomatsakis

in which inferable outlives-requirements are linted

RFC 2093 (tracking issue #44493) lets us leave off these
commonsensically inferable `T: 'a` outlives requirements. (A separate
feature-gate was split off for the case of 'static lifetimes, for
which questions still remain.) Detecting these was requested as an
idioms-2018 lint.

Resolves #52042, an item under the fabulous metaïssue #52047.

It's plausible that this shouldn't land until after `infer_outlives_requirements` has been stabilized ([final comment period started](https://github.com/rust-lang/rust/issues/44493#issuecomment-408852946) 4 days ago), but I think there's also a strong case to not-wait in order to maximize the time that [Edition Preview 2](https://internals.rust-lang.org/t/rust-2018-release-schedule-and-extended-beta/8076) users have to kick at it. (It's allow by default, so there's no impact unless you explicitly turn it or the rust-2018-idioms group up to `warn` or higher.)

Questions—

 * Is `explicit-outlives-requirements` a good name? (I chose it as an [RFC 344](https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints)-compliant "inversion" of the feature-gate name, `infer_outlives_requirements`, but I could imagine someone arguing that the word `struct` should be part of the name somewhere, for specificity.)

 * Are there any false-positives or false-negatives? @nikomatsakis [said that](https://github.com/rust-lang/rust/issues/52042#issuecomment-406409795) getting this right would be "fairly hard", which makes me nervous that I'm missing something. The UI test in the initial submission of this pull request just exercises the examples [given in the Edition Guide](https://rust-lang-nursery.github.io/edition-guide/2018/transitioning/ownership-and-lifetimes/struct-inference.html).

![infer_outlints](https://user-images.githubusercontent.com/1076988/43625740-6bf43dca-96a3-11e8-9dcf-793ac83d424d.png)

r? @alexcrichton

5 years agorustc_typeck: don't lint non-extern-prelude extern crate's in Rust 2018.
Eduard-Mihai Burtescu [Fri, 28 Sep 2018 19:54:18 +0000 (22:54 +0300)]
rustc_typeck: don't lint non-extern-prelude extern crate's in Rust 2018.

5 years agoAuto merge of #54643 - Xanewok:fix-rls, r=kennytm
bors [Fri, 28 Sep 2018 20:30:17 +0000 (20:30 +0000)]
Auto merge of #54643 - Xanewok:fix-rls, r=kennytm

Fix RLS toolstate after #54356 merge

Fixes toolstate regression caused by https://github.com/rust-lang/rust/pull/54356.

The `save::process_crate` now needs to be passed an additional `&Input`, this change contains the RLS equivalent of [this](https://github.com/rust-lang/rust/pull/54356/files#diff-707a0eda6b2f1a0537abc3d23133748cR983).

r? @kennytm (or @nrc if you're not away yet)

5 years agorustc_resolve: move extern_prelude from Resolver to Session.
Eduard-Mihai Burtescu [Fri, 28 Sep 2018 19:17:59 +0000 (22:17 +0300)]
rustc_resolve: move extern_prelude from Resolver to Session.

5 years agoCompute Android gdb version in compiletest
Tom Tromey [Fri, 28 Sep 2018 16:32:59 +0000 (10:32 -0600)]
Compute Android gdb version in compiletest

compiletest has special code for running gdb for Android targets.  In
particular it computes a different path to gdb.  However, this gdb is
not used for the version test, which results in some tests being run
when they should not be.  You can see this in #54004.

This patch moves the special case to analyze_gdb and a new helper
function to decide whether the case applies.  This causes the version
check to work properly.

Note that the bulk of the runtest.rs change is just reindentation
caused by moving from a "match" to an "if" -- but there is a (small)
change buried in there.

5 years agoFix RLS toolstate after #54356 merge
Igor Matuszewski [Fri, 28 Sep 2018 14:39:24 +0000 (16:39 +0200)]
Fix RLS toolstate after #54356 merge

5 years agorustc: keep a Span for each predicate in ty::GenericPredicates.
Eduard-Mihai Burtescu [Sun, 16 Sep 2018 17:15:49 +0000 (20:15 +0300)]
rustc: keep a Span for each predicate in ty::GenericPredicates.

5 years agoPrefer `#![feature(bind_by_move_pattern_guards)]` over `-Z disable_ast_check_for_muta...
Felix S. Klock II [Fri, 28 Sep 2018 13:38:42 +0000 (15:38 +0200)]
Prefer `#![feature(bind_by_move_pattern_guards)]` over `-Z disable_ast_check_for_mutation_in_guard`

5 years agoImprove docs for std::io::Seek
Marcus Griep [Fri, 28 Sep 2018 12:01:31 +0000 (08:01 -0400)]
Improve docs for std::io::Seek

Fixes #54562

5 years agoAuto merge of #54356 - Xanewok:save-analysis-invocation, r=nrc
bors [Fri, 28 Sep 2018 11:48:48 +0000 (11:48 +0000)]
Auto merge of #54356 - Xanewok:save-analysis-invocation, r=nrc

Emit used rustc invocation in the save-analysis file

Blocked on https://github.com/nrc/rls-data/pull/19. (I'm guessing it won't pass CI due to an out-of-tree git dependency)

This should allow RLS to recreate a Rust compilation build plan from the save-analysis files alone, which should be useful when fetching those from external build systems, most notably Buck now.

Also this includes some more potentially useful compilation-specific options (e.g. sysroot or the actual path to extern crates) but that's not required for the build plan bits.

cc @jsgf @alexcrichton

r? @nrc

5 years agoAuto merge of #54568 - levex:issue-54130, r=nagisa
bors [Fri, 28 Sep 2018 09:17:28 +0000 (09:17 +0000)]
Auto merge of #54568 - levex:issue-54130, r=nagisa

codegen_llvm: check inline assembly constraints with LLVM

---%<---
Hey all,

As issue #54130 highlights, constraints are not checked and passing bad constraints to LLVM can crash it since a `Verify()` call is placed inside an assertion (see: `src/llvm/lib/IR/InlineAsm.cpp:39`).

As this is my first PR to the Rust compiler (woot! :tada:), there might be better ways of achieving this result. In particular, I am not too happy about generating an error in codegen; it would be much nicer if we did it earlier. However, @rkruppe [noted on IRC](https://botbot.me/mozilla/rustc/2018-09-25/?msg=104791581&page=1) that this should be fine for an unstable feature and a much better solution than the _status quo_, which is an ICE.

Thanks!
--->%---

LLVM provides a way of checking whether the constraints and the actual
inline assembly make sense. This commit introduces a check before
emitting code for the inline assembly. If LLVM rejects the inline
assembly (or its constraints), then the compiler emits an error E0668
("malformed inline assembly").

Fixes: #54130
Signed-off-by: Levente Kurusa \<lkurusa@acm.org\>
5 years agoAuto merge of #54338 - orium:fix-macro-inc-comp, r=nrc
bors [Fri, 28 Sep 2018 06:40:32 +0000 (06:40 +0000)]
Auto merge of #54338 - orium:fix-macro-inc-comp, r=nrc

Use full name to identify a macro in a `FileName`.

Before this two macros with same name would be indistinguishable inside a `FileName`.  This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`.

Fixes #53097.

r? @nrc

5 years agoUpdate ui lines
Josh Stone [Wed, 26 Sep 2018 23:45:09 +0000 (16:45 -0700)]
Update ui lines

5 years agoBump to 1.31.0 and bootstrap from 1.30 beta
Josh Stone [Wed, 26 Sep 2018 21:26:46 +0000 (14:26 -0700)]
Bump to 1.31.0 and bootstrap from 1.30 beta

5 years agoin which inferable outlives-requirements are linted
Zack M. Davis [Sun, 26 Aug 2018 19:22:04 +0000 (12:22 -0700)]
in which inferable outlives-requirements are linted

RFC 2093 (tracking issue #44493) lets us leave off
commonsensically inferable `T: 'a` outlives requirements. (A separate
feature-gate was split off for the case of 'static lifetimes, for
which questions still remain.) Detecting these was requested as an
idioms-2018 lint.

It turns out that issuing a correct, autofixable suggestion here is
somewhat subtle in the presence of other bounds and generic
parameters. Basically, we want to handle these three cases:

 • One outlives-bound. We want to drop the bound altogether, including
   the colon—

   MyStruct<'a, T: 'a>
                 ^^^^ help: remove this bound

 • An outlives bound first, followed by a trait bound. We want to
   delete the outlives bound and the following plus sign (and
   hopefully get the whitespace right, too)—

   MyStruct<'a, T: 'a + MyTrait>
                   ^^^^^ help: remove this bound

 • An outlives bound after a trait bound. We want to delete the
   outlives lifetime and the preceding plus sign—

   MyStruct<'a, T: MyTrait + 'a>
                          ^^^^^ help: remove this bound

This gets (slightly) even more complicated in the case of where
clauses, where we want to drop the where clause altogether if there's
just the one bound. Hopefully the comments are enough to explain
what's going on!

A script (in Python, sorry) was used to generate the
hopefully-sufficiently-exhaustive UI test input. Some of these are
split off into a different file because rust-lang-nursery/rustfix#141
(and, causally upstream of that, #53934) prevents them from being
`run-rustfix`-tested.

We also make sure to include a UI test of a case (copied from RFC
2093) where the outlives-bound can't be inferred. Special thanks to
Niko Matsakis for pointing out the `inferred_outlives_of` query,
rather than blindly stripping outlives requirements as if we weren't a
production compiler and didn't care.

This concerns #52042.

5 years agoAuto merge of #54547 - AstralSorcerer:issue-54028, r=eddyb
bors [Fri, 28 Sep 2018 02:28:25 +0000 (02:28 +0000)]
Auto merge of #54547 - AstralSorcerer:issue-54028, r=eddyb

Rely only on base alignment and offset for computing field alignment

Fix #54028
r? @eddyb

5 years agoUse rls-data 0.18.1
Igor Matuszewski [Tue, 25 Sep 2018 06:32:49 +0000 (08:32 +0200)]
Use rls-data 0.18.1

5 years agoAlso remap absolute source names in save-analysis
Igor Matuszewski [Mon, 24 Sep 2018 14:53:49 +0000 (16:53 +0200)]
Also remap absolute source names in save-analysis

5 years agoMinimize final diff
Igor Matuszewski [Mon, 24 Sep 2018 14:38:54 +0000 (16:38 +0200)]
Minimize final diff

5 years agoRemap only source files in the command line
Igor Matuszewski [Mon, 24 Sep 2018 14:28:53 +0000 (16:28 +0200)]
Remap only source files in the command line

5 years agoEmit only necessary compilation options in save-analysis
Igor Matuszewski [Sat, 22 Sep 2018 21:19:39 +0000 (23:19 +0200)]
Emit only necessary compilation options in save-analysis

This is `command`, `directory` and `output` file.

5 years agoMove `filename_for_metadata` to codegen_utils
Igor Matuszewski [Sat, 22 Sep 2018 20:24:32 +0000 (22:24 +0200)]
Move `filename_for_metadata` to codegen_utils

This function isn't strictly tied to LLVM (it's more of a utility) and
it's now near an analogous, almost identical `filename_for_input` (for
rlibs and so forth).
Also this means not depending on the backend when one wants to know the
accurate .rmeta output filename.