]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #48934 - Phlosioneer:42453-debug-hygene, r=petrochenkov
kennytm [Mon, 12 Mar 2018 16:54:33 +0000 (00:54 +0800)]
Rollup merge of #48934 - Phlosioneer:42453-debug-hygene, r=petrochenkov

Fix hygene issue when deriving Debug

The code for several of the core traits doesn't use hygenic macros.
This isn't a problem, except for the Debug trait, which is the only
one that uses a variable, named "builder".

Variables can't share names with unit structs, so attempting to
[derive(Debug)] on any type while a unit struct with the name
"builder" was in scope would result in an error.

This commit just changes the name of the variable to
"__debug_trait_builder", because I couldn't figure out how to get a
list of all unit structs in-scope from within the derive expansion
function. If someone wants to have a unit struct with
the exact name "__debug_trait_builder", they'll just have to do it
without a [derive(Debug)].

I also checked the implementations of the other built-in derives to
ensure they didn't declare any variables.

6 years agoRollup merge of #48928 - zackmdavis:span_suggestion_field_day, r=estebank
kennytm [Mon, 12 Mar 2018 16:54:32 +0000 (00:54 +0800)]
Rollup merge of #48928 - zackmdavis:span_suggestion_field_day, r=estebank

in which some labels and notes are upgraded to structured suggestions

(Meanwhile, a couple of parse-fail tests are moved to UI tests so that
the reader can see the new output, and an existing UI test is given a
more evocative name.)

r? @estebank

6 years agoRollup merge of #48887 - alexcrichton:update-stdsimd, r=kennytm
kennytm [Mon, 12 Mar 2018 16:54:31 +0000 (00:54 +0800)]
Rollup merge of #48887 - alexcrichton:update-stdsimd, r=kennytm

Update stdsimd module

Pulls in a redesigned `std::simd` module as well as a replacement for the
`is_target_feature_detected!` macro

6 years agoRollup merge of #48880 - petrochenkov:badstderr, r=kennytm
kennytm [Mon, 12 Mar 2018 16:54:30 +0000 (00:54 +0800)]
Rollup merge of #48880 - petrochenkov:badstderr, r=kennytm

tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories

6 years agoRollup merge of #48877 - GuillaumeGomez:vec-missing-links, r=QuietMisdreavus
kennytm [Mon, 12 Mar 2018 16:54:28 +0000 (00:54 +0800)]
Rollup merge of #48877 - GuillaumeGomez:vec-missing-links, r=QuietMisdreavus

Add missing urls

r? @QuietMisdreavus

6 years agoRollup merge of #48824 - davidalber:update-conduct, r=steveklabnik
kennytm [Mon, 12 Mar 2018 16:54:27 +0000 (00:54 +0800)]
Rollup merge of #48824 - davidalber:update-conduct, r=steveklabnik

Propagating upstream code of conduct changes

[This repository's code of conduct](https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md) is out of sync with the [rust-www code of conduct](https://github.com/rust-lang/rust-www/blob/master/en-US/conduct.md) due changes from rust-lang/rust-www#1062. This PR propagates those changes and brings the files back into sync.

r? @steveklabnik

6 years agoRollup merge of #48725 - humenda:master, r=nikomatsakis
kennytm [Mon, 12 Mar 2018 16:54:26 +0000 (00:54 +0800)]
Rollup merge of #48725 - humenda:master, r=nikomatsakis

Update L4Re target specification

Due to the dynamically generated linker arguments of the L4Re build system, it is not a good idea to hard-code them in Rust. This PR undoes this step. It also adds an empty implementation to retrieve the number of CPUs.

6 years agoRollup merge of #48705 - klnusbaum:update_rfc_process, r=aturon
kennytm [Mon, 12 Mar 2018 16:54:25 +0000 (00:54 +0800)]
Rollup merge of #48705 - klnusbaum:update_rfc_process, r=aturon

Update Feature Request instructions

As noted in #48393 the contribution instructions for submitting a Feature Request are a little hasty, suggesting that the user immediately create an issue in the RFC repository. For users that want to submit a feature request, let's instead point them directly to the README file for the RFC repository, which contains detailed instructions on how to submit a Feature Request.

6 years agoRollup merge of #48201 - NovemberZulu:master, r=steveklabnik
kennytm [Mon, 12 Mar 2018 16:54:24 +0000 (00:54 +0800)]
Rollup merge of #48201 - NovemberZulu:master, r=steveklabnik

rephrase UnsafeCell doc

As shown by discussions on users.rust-lang.org [[1]], [[2]], UnsafeCell doc is not totally clear. I tried to made the doc univocal regarding what is allowed and what is not. The edits are based on my understanding following [[1]].

[1]: https://users.rust-lang.org/t/unsafecell-behavior-details/1560
[2]: https://users.rust-lang.org/t/is-there-a-better-way-to-overload-index-indexmut-for-a-rc-refcell/15591/12

6 years agoAuto merge of #48770 - bobtwinkles:two_phase_borrows_rewrite, r=pnkfelix
bors [Mon, 12 Mar 2018 12:58:09 +0000 (12:58 +0000)]
Auto merge of #48770 - bobtwinkles:two_phase_borrows_rewrite, r=pnkfelix

Two phase borrows rewrite

This definitely needs a careful review. Both @pnkfelix and @nikomatsakis  were involved with the design of this so they're natural choices here. I'm r?'ing @pnkfelix since they wrote the original two-phase borrow implementation. Also ping @KiChjang who expressed interest in working on this. I'm going to leave a few comments below pointing out some of the more dangerous changes I made (i.e. what I would like reviewers to pay special attention too.)

r? @pnkfelix

6 years agoAuto merge of #48295 - Keruspe:master, r=alexcrichton
bors [Mon, 12 Mar 2018 08:11:19 +0000 (08:11 +0000)]
Auto merge of #48295 - Keruspe:master, r=alexcrichton

rustbuild: pass datadir to rust-installer

This fixes zsh completion install when $datadir != $prefix/share

6 years agoAuto merge of #48938 - alexcrichton:no-leak-makeflags, r=kennytm
bors [Mon, 12 Mar 2018 05:28:13 +0000 (05:28 +0000)]
Auto merge of #48938 - alexcrichton:no-leak-makeflags, r=kennytm

test: Forcibly remove MAKEFLAGS in compiletest

When executing run-make tests we run a risk of leaking the `MAKEFLAGS`
environment variable if `./x.py` itself was called from `make` (aka `make check
-j3` as the OSX bots do). We may then leak accidentally fds into the child
process and trick it into thinking it's got a jobserver!

Hopefully addresses [this] spurious failure

[this]: https://github.com/rust-lang/rust/pull/48295#issuecomment-372134717

6 years agoAuto merge of #48549 - alexcrichton:update-cargo, r=Mark-Simulacrum
bors [Sun, 11 Mar 2018 20:28:34 +0000 (20:28 +0000)]
Auto merge of #48549 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update Cargo submodule

Hopefully a routine update...

6 years agotest: Forcibly remove MAKEFLAGS in compiletest
Alex Crichton [Sun, 11 Mar 2018 20:15:46 +0000 (13:15 -0700)]
test: Forcibly remove MAKEFLAGS in compiletest

When executing run-make tests we run a risk of leaking the `MAKEFLAGS`
environment variable if `./x.py` itself was called from `make` (aka `make check
-j3` as the OSX bots do). We may then leak accidentally fds into the child
process and trick it into thinking it's got a jobserver!

Hopefully addresses [this] spurious failure

[this]: https://github.com/rust-lang/rust/pull/48295#issuecomment-372134717

6 years agoUpdate Cargo submodule
Alex Crichton [Mon, 26 Feb 2018 17:07:16 +0000 (09:07 -0800)]
Update Cargo submodule

Required moving all fulldeps tests depending on `rand` to different locations as
now there's multiple `rand` crates that can't be implicitly linked against.

6 years agoUpdate stdsimd module
Alex Crichton [Fri, 9 Mar 2018 19:31:04 +0000 (11:31 -0800)]
Update stdsimd module

Pulls in a redesigned `std::simd` module as well as a replacement for the
`is_target_feature_detected!` macro

6 years agoAuto merge of #48599 - Mark-Simulacrum:rustbuild-updates-step-1, r=alexcrichton
bors [Sun, 11 Mar 2018 17:54:18 +0000 (17:54 +0000)]
Auto merge of #48599 - Mark-Simulacrum:rustbuild-updates-step-1, r=alexcrichton

Remove ONLY_BUILD and ONLY_BUILD_TARGETS

Primarily removes `ONLY_BUILD` and `ONLY_BUILD_TARGETS`. These aren't actually needed in the new system since we can simply not take the relevant `host` and `target` fields if we don't want to run with them in `Step::make_run`.

This PR also includes a few other commits which generally clean up the state of rustbuild, but are not related to the `Step` changes.

6 years agoFix hygene issue when deriving Debug
Phlosioneer [Sun, 11 Mar 2018 14:03:23 +0000 (10:03 -0400)]
Fix hygene issue when deriving Debug

The code for several of the core traits doesn't use hygenic macros.
This isn't a problem, except for the Debug trait, which is the only
one that uses a variable, named "builder".

Variables can't share names with unit structs, so attempting to
[derive(Debug)] on any type while a unit struct with the name
"builder" was in scope would result in an error.

This commit just changes the name of the variable to
"__debug_trait_builder", because I couldn't figure out how to get a
list of all unit structs in-scope from within the derive expansion
function. If someone wants to have a unit struct with
the exact name "__debug_trait_builder", they'll just have to do it
without a [derive(Debug)].

6 years agoAuto merge of #48907 - kennytm:minor-ci-stuff, r=alexcrichton
bors [Sun, 11 Mar 2018 13:40:13 +0000 (13:40 +0000)]
Auto merge of #48907 - kennytm:minor-ci-stuff, r=alexcrichton

Some minor CI changes

1. On macOS, ensure crash log printing won't error, and only real crash logs are printed. This may avoid the `find` process exiting abnormally and truncated the Travis log (I guess).

2. Print `/proc/cpuinfo` and `/proc/meminfo`. To determine if there's any variation in the reported clock rate between jobs.

6 years agoAuto merge of #48799 - alexcrichton:more-osx-cores, r=Mark-Simulacrum
bors [Sun, 11 Mar 2018 09:43:50 +0000 (09:43 +0000)]
Auto merge of #48799 - alexcrichton:more-osx-cores, r=Mark-Simulacrum

travis: Upgrade OSX builders

This upgrades the OSX builders to the `xcode9.3-moar` image which has 3 cores as
opposed to the 2 that our builders currently have. Should help make those OSX
builds a bit speedier!

6 years agoin which some labels and notes are upgraded to structured suggestions
Zack M. Davis [Sun, 11 Mar 2018 08:04:15 +0000 (00:04 -0800)]
in which some labels and notes are upgraded to structured suggestions

(Meanwhile, a couple of parse-fail tests are moved to UI tests so that
the reader can see the new output, and an existing UI test is given a
more evocative name.)

6 years agoAuto merge of #48908 - varkor:bss-undefined-globals, r=alexcrichton
bors [Sun, 11 Mar 2018 07:05:00 +0000 (07:05 +0000)]
Auto merge of #48908 - varkor:bss-undefined-globals, r=alexcrichton

Merge LLVM fix for undefined bss globals

This fixes #41315.

r? @japaric

6 years agoAuto merge of #48691 - Zoxc:profq-chan, r=michaelwoerister
bors [Sun, 11 Mar 2018 04:34:07 +0000 (04:34 +0000)]
Auto merge of #48691 - Zoxc:profq-chan, r=michaelwoerister

Move PROFQ_CHAN to a Session field

r? @michaelwoerister

6 years agoAuto merge of #48419 - bobtwinkles:fix_late_bound_reg_self, r=nikomatsakis
bors [Sat, 10 Mar 2018 23:34:11 +0000 (23:34 +0000)]
Auto merge of #48419 - bobtwinkles:fix_late_bound_reg_self, r=nikomatsakis

Use free regions when determining self type in `compare_impl_method`

The ExplicitSelf::determine function expects to be able to compare regions. However, when the compare_self_type error reporting code runs we haven't resolved bound regions yet. Thus we replace them with free regions first. Fixes #48276

6 years agoadd stub for retrieving number of CPUs
Sebastian Humenda [Sat, 10 Mar 2018 14:01:51 +0000 (15:01 +0100)]
add stub for retrieving number of CPUs

6 years agoremove linker arguments from L4Re target
Sebastian Humenda [Sat, 10 Mar 2018 14:00:26 +0000 (15:00 +0100)]
remove linker arguments from L4Re target

These change from release to release and are impossible to get right,
since they are generated by Make magic.

6 years agoAuto merge of #48388 - kyrias:relro-level-cg, r=alexcrichton
bors [Sat, 10 Mar 2018 13:31:06 +0000 (13:31 +0000)]
Auto merge of #48388 - kyrias:relro-level-cg, r=alexcrichton

Add relro-level tests

The `relro-level` debugging flag was added in #43170 which was merged in July 2017.  This PR moves this flag to be a proper codegen flag.

6 years agoMerge LLVM fix for undefined bss globals
varkor [Sat, 10 Mar 2018 12:38:41 +0000 (12:38 +0000)]
Merge LLVM fix for undefined bss globals

This fixes #41315.

6 years agoPrint /proc/cpuinfo and /proc/meminfo before starting to build.
kennytm [Sat, 10 Mar 2018 11:55:04 +0000 (19:55 +0800)]
Print /proc/cpuinfo and /proc/meminfo before starting to build.

6 years agoPrevents the crash log printer on macOS from crashing the entire job.
kennytm [Sat, 10 Mar 2018 10:38:27 +0000 (18:38 +0800)]
Prevents the crash log printer on macOS from crashing the entire job.

6 years agoAuto merge of #47574 - zilbuz:issue-14844, r=nikomatsakis
bors [Sat, 10 Mar 2018 10:52:07 +0000 (10:52 +0000)]
Auto merge of #47574 - zilbuz:issue-14844, r=nikomatsakis

Show the used type variable when issuing a "can't use type parameters from outer function" error message

Fix #14844

r? @estebank

6 years agoAuto merge of #48755 - GuillaumeGomez:rustdoc-fixes, r=QuietMisdreavus
bors [Sat, 10 Mar 2018 08:24:08 +0000 (08:24 +0000)]
Auto merge of #48755 - GuillaumeGomez:rustdoc-fixes, r=QuietMisdreavus

Multiple rustdoc fixes

Fixes #48733.

r? @QuietMisdreavus

6 years agoAuto merge of #48901 - alexcrichton:j1-install, r=Mark-Simulacrum
bors [Sat, 10 Mar 2018 03:38:19 +0000 (03:38 +0000)]
Auto merge of #48901 - alexcrichton:j1-install, r=Mark-Simulacrum

rustbuild: Pass `-j1` to OpenSSL `make install`

We explicitly do this when compiling OpenSSL itself due to weird racy issues in
its build system, and now we've started seeing issues in the `make install` step
so let's try and see what ratcheting down the parallelism does here...

6 years agorustbuild: Pass `-j1` to OpenSSL `make install`
Alex Crichton [Sat, 10 Mar 2018 02:49:28 +0000 (18:49 -0800)]
rustbuild: Pass `-j1` to OpenSSL `make install`

We explicitly do this when compiling OpenSSL itself due to weird racy issues in
its build system, and now we've started seeing issues in the `make install` step
so let's try and see what ratcheting down the parallelism does here...

6 years agoRemove some commented out code
bobtwinkles [Sat, 10 Mar 2018 00:02:22 +0000 (19:02 -0500)]
Remove some commented out code

Left over from prior experimentation, no longer required.

6 years agoRemove added two-phase-borrows flag
bobtwinkles [Sat, 10 Mar 2018 00:00:18 +0000 (19:00 -0500)]
Remove added two-phase-borrows flag

It seems whatever was causing problems has been fixed.

6 years agoAuto merge of #48891 - alexcrichton:dist-osx-9.3, r=kennytm
bors [Fri, 9 Mar 2018 21:46:58 +0000 (21:46 +0000)]
Auto merge of #48891 - alexcrichton:dist-osx-9.3, r=kennytm

travis: Upgrade dist builders for OSX

This commit upgrades the dist builders for OSX to Travis's new `xcode9.3-moar`
image which has 3 cores available to it instead of 2. This should help us
provide speedier builds on OSX and hit timeouts less in theory!

Note that historically the dist builders for OSX have been a different version
than the ones that are running tests. I had forgotten why this was the case and
digging around brought up 307615567 where apparently Xcode 8 wasn't able to
compile LLVM with `MACOSX_DEPLOYMENT_TARGET=10.7` which we desired. On a whim I
gave this PR a spin and it [looks like][green] this has since been fixed (maybe
in LLVM?). In any case those green builds should hopefully mean that we can
safely upgrade and get faster infrastructure to boot.

This commit also includes an upgrade of OpenSSL. This is not done for security
reasons but rather build system reasons. Originally builds with the new image
[did not succeed][red] due to weird build failures in OpenSSL, but upgrading
seems to have made the spurious errors go away to here's to also hoping that's
fixed!

[green]: https://travis-ci.org/rust-lang/rust/builds/351353412
[red]: https://travis-ci.org/rust-lang/rust/builds/350969248

6 years agotravis: Upgrade dist builders for OSX
Alex Crichton [Thu, 8 Mar 2018 18:57:03 +0000 (10:57 -0800)]
travis: Upgrade dist builders for OSX

This commit upgrades the dist builders for OSX to Travis's new `xcode9.3-moar`
image which has 3 cores available to it instead of 2. This should help us
provide speedier builds on OSX and hit timeouts less in theory!

Note that historically the dist builders for OSX have been a different version
than the ones that are running tests. I had forgotten why this was the case and
digging around brought up 307615567 where apparently Xcode 8 wasn't able to
compile LLVM with `MACOSX_DEPLOYMENT_TARGET=10.7` which we desired. On a whim I
gave this PR a spin and it [looks like][green] this has since been fixed (maybe
in LLVM?). In any case those green builds should hopefully mean that we can
safely upgrade and get faster infrastructure to boot.

This commit also includes an upgrade of OpenSSL. This is not done for security
reasons but rather build system reasons. Originally builds with the new image
[did not succeed][red] due to weird build failures in OpenSSL, but upgrading
seems to have made the spurious errors go away to here's to also hoping that's
fixed!

[green]: https://travis-ci.org/rust-lang/rust/builds/351353412
[red]: https://travis-ci.org/rust-lang/rust/builds/350969248

6 years agoAuto merge of #48757 - alexcrichton:fix-msbuild-build, r=Mark-Simulacrum
bors [Fri, 9 Mar 2018 19:02:13 +0000 (19:02 +0000)]
Auto merge of #48757 - alexcrichton:fix-msbuild-build, r=Mark-Simulacrum

rustbuild: Fix MSBuild location of `llvm-config.exe`

For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749

6 years agoCheck for two_phase_borrows in the right place
bobtwinkles [Tue, 6 Mar 2018 09:19:41 +0000 (04:19 -0500)]
Check for two_phase_borrows in the right place

Fix a small compilation issue after I missed a critical change after rebasing
yesterday (ref c933440)

6 years agoFix tests after two-phase borrow rewrite
bobtwinkles [Tue, 6 Mar 2018 08:37:21 +0000 (03:37 -0500)]
Fix tests after two-phase borrow rewrite

6 years agoRemove unused field on BorrowData
bobtwinkles [Tue, 6 Mar 2018 05:13:29 +0000 (00:13 -0500)]
Remove unused field on BorrowData

6 years agoComplete re-implementation of 2-phase borrows
bobtwinkles [Tue, 6 Mar 2018 03:43:43 +0000 (22:43 -0500)]
Complete re-implementation of 2-phase borrows

See #48431 for discussion as to why this was necessary and what we hoped to
accomplish. A brief summary:
   - the first implementation of 2-phase borrows was hard to limit in the way we
   wanted. That is, it was too good at accepting all 2-phase borrows rather than
   just autorefs =)
   - Numerous diagnostic regressions were introduced by 2-phase borrow support
   which were difficult to fix

6 years agomir dataflow: change graphviz output
bobtwinkles [Sat, 3 Mar 2018 22:44:06 +0000 (17:44 -0500)]
mir dataflow: change graphviz output

The new output format is perhaps a little more readable. As a bonus, we get
labels on the outgoing edges to more easily corroborate the dataflow with the
plain MIR graphviz output.

6 years agoFinally start down the right path
bobtwinkles [Mon, 5 Mar 2018 07:44:10 +0000 (02:44 -0500)]
Finally start down the right path

6 years agoRename BorrowData::location to BorrowData::reserve_location
bobtwinkles [Mon, 5 Mar 2018 02:47:39 +0000 (21:47 -0500)]
Rename BorrowData::location to BorrowData::reserve_location

in preparation for rewritting two phase borrow support

6 years agoFix anchor not always being put at the right place
Guillaume Gomez [Tue, 6 Mar 2018 21:05:41 +0000 (22:05 +0100)]
Fix anchor not always being put at the right place

6 years agoFix escape not working when searchbar selected
Guillaume Gomez [Mon, 5 Mar 2018 22:37:33 +0000 (23:37 +0100)]
Fix escape not working when searchbar selected

6 years agoAdd missing items in the sidebar for functions
Guillaume Gomez [Mon, 5 Mar 2018 21:40:43 +0000 (22:40 +0100)]
Add missing items in the sidebar for functions

6 years agorustbuild: Fix MSBuild location of `llvm-config.exe`
Alex Crichton [Mon, 5 Mar 2018 17:47:54 +0000 (09:47 -0800)]
rustbuild: Fix MSBuild location of `llvm-config.exe`

For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749

6 years agotidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories
Vadim Petrochenkov [Fri, 9 Mar 2018 14:11:06 +0000 (17:11 +0300)]
tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories

6 years agoMake the default relro level be doing nothing at all
Johannes Löthberg [Fri, 9 Mar 2018 13:53:15 +0000 (14:53 +0100)]
Make the default relro level be doing nothing at all

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
6 years agoAdd missing urls
Guillaume Gomez [Fri, 9 Mar 2018 13:08:59 +0000 (14:08 +0100)]
Add missing urls

6 years agoAuto merge of #48326 - RalfJung:generic-bounds, r=petrochenkov
bors [Fri, 9 Mar 2018 10:45:29 +0000 (10:45 +0000)]
Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkov

Warn about ignored generic bounds in `for`

This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here.

Questions to the reviewer:
* Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!).
* Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`).
* For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right?

Cc @eddyb

6 years agoMove PROFQ_CHAN to a Session field
John Kåre Alsaker [Sun, 3 Dec 2017 13:21:23 +0000 (14:21 +0100)]
Move PROFQ_CHAN to a Session field

6 years agoAuto merge of #48860 - Manishearth:rollup, r=Manishearth
bors [Fri, 9 Mar 2018 03:59:42 +0000 (03:59 +0000)]
Auto merge of #48860 - Manishearth:rollup, r=Manishearth

Rollup of 5 pull requests

- Successful merges: #48527, #48588, #48801, #48856, #48857
- Failed merges:

6 years agoRefactor run_host_only to have the proper effect.
Mark Simulacrum [Sun, 11 Feb 2018 22:42:05 +0000 (15:42 -0700)]
Refactor run_host_only to have the proper effect.

Previously it was set to true when we didn't run HOSTS steps.

6 years agoDeny warnings
Mark Simulacrum [Fri, 16 Feb 2018 01:31:17 +0000 (18:31 -0700)]
Deny warnings

6 years agoPrint out the sysroot and libdir on verbose builds.
Mark Simulacrum [Thu, 15 Feb 2018 01:50:11 +0000 (18:50 -0700)]
Print out the sysroot and libdir on verbose builds.

6 years agoRemove ONLY_BUILD.
Mark Simulacrum [Sun, 11 Feb 2018 22:41:06 +0000 (15:41 -0700)]
Remove ONLY_BUILD.

All uses are replaced with not accessing run.target/run.host, and
instead directly using run.builder.build.build.

6 years agoRemove ONLY_BUILD_TARGETS.
Mark Simulacrum [Sun, 11 Feb 2018 22:39:09 +0000 (15:39 -0700)]
Remove ONLY_BUILD_TARGETS.

All cases where it is used can be replaced by substituing run.host for
run.builder.build.build; that is its only effect. As such, it is
removable.

6 years agoRollup merge of #48857 - Songbird0:improve_column_macro_documentation, r=joshtriplett
Manish Goregaokar [Fri, 9 Mar 2018 01:25:59 +0000 (17:25 -0800)]
Rollup merge of #48857 - Songbird0:improve_column_macro_documentation, r=joshtriplett

Modify part of `column!` documentation.

Just like `line!` documentation, I've replaced:

> The returned column is not the invocation of the `column!` macro itself

By

> The returned column is *not necessarily* the line of the `column!` invocation itself

See #46997.

6 years agoRollup merge of #48856 - Songbird0:improve_line_macro_documentation, r=joshtriplett
Manish Goregaokar [Fri, 9 Mar 2018 01:25:58 +0000 (17:25 -0800)]
Rollup merge of #48856 - Songbird0:improve_line_macro_documentation, r=joshtriplett

Modify part of `line!` documentation.

In accordance with #46997, I've replaced:

> The returned line is not the invocation of the line! macro itself [...]

By

> The returned line is *not necessarily* the line of the `line!` invocation itself [...]

6 years agoRollup merge of #48801 - Manishearth:epoch-features, r=nikomatsakis
Manish Goregaokar [Fri, 9 Mar 2018 01:25:57 +0000 (17:25 -0800)]
Rollup merge of #48801 - Manishearth:epoch-features, r=nikomatsakis

Add functionality for gating feature flags on epochs ; rejigger epoch lints

fixes #48794

r? @nikomatsakis

6 years agoRollup merge of #48588 - alexcrichton:termcolor, r=BurntSushi
Manish Goregaokar [Fri, 9 Mar 2018 01:25:56 +0000 (17:25 -0800)]
Rollup merge of #48588 - alexcrichton:termcolor, r=BurntSushi

rustc: Migrate to `termcolor` crate from `term`

This crate moves the compiler's error reporting to using the `termcolor` crate
from crates.io. Previously rustc used a super-old version of the `term` crate
in-tree which is basically unmaintained at this point, but Cargo has been using
`termcolor` for some time now and tools like `rg` are using `termcolor` as well,
so it seems like a good strategy to take!

Note that the `term` crate remains in-tree for libtest. Changing libtest will be
a bit tricky due to how the build works, but we can always tackle that later.

cc #45728

6 years agoRollup merge of #48527 - zackmdavis:and_the_social_construction_of_tuples, r=estebank
Manish Goregaokar [Fri, 9 Mar 2018 01:25:55 +0000 (17:25 -0800)]
Rollup merge of #48527 - zackmdavis:and_the_social_construction_of_tuples, r=estebank

in which parentheses are suggested for should-have-been-tuple-patterns

![destructure_suggest_parens](https://user-images.githubusercontent.com/1076988/36638335-48b082d4-19a7-11e8-9726-0d043544df2f.png)

Programmers used to working in some other languages (such as Python or
Go) might expect to be able to destructure values with comma-separated
identifiers but no parentheses on the left side of an assignment.

Previously, the first name in such code would get parsed as a
single-indentifier pattern—recognizing, for example, the
`let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax
error on seeing an unexpected comma rather than the expected semicolon
(all the way nearer to the end of `parse_full_stmt`).

Instead, let's look for that comma when parsing the pattern, and if we
see it, make-believe that we're parsing the remaining elements in a
tuple pattern, so that we can suggest wrapping it all in parentheses. We
need to do this in a separate wrapper method called on a "top-level"
pattern, rather than within
`parse_pat` itself, because `parse_pat` gets called recursively to parse
the sub-patterns within a tuple pattern.

~~We could also do this for `match` arms, `if let`, and `while let`, but
we elect not to in this patch, as it seems less likely for users to make
the mistake in those contexts.~~

Resolves #48492.

r? @petrochenkov

6 years agoAdd rust_2018_idioms lint group
Manish Goregaokar [Thu, 8 Mar 2018 21:23:52 +0000 (13:23 -0800)]
Add rust_2018_idioms lint group

6 years agoNote the future epoch for epoch lints
Manish Goregaokar [Thu, 8 Mar 2018 21:16:36 +0000 (13:16 -0800)]
Note the future epoch for epoch lints

6 years agoMake bare_trait_object not be an epoch lint
Manish Goregaokar [Thu, 8 Mar 2018 17:37:50 +0000 (09:37 -0800)]
Make bare_trait_object not be an epoch lint

6 years agoMake tyvar_behind_raw_pointer an epoch lint
Manish Goregaokar [Thu, 8 Mar 2018 17:37:37 +0000 (09:37 -0800)]
Make tyvar_behind_raw_pointer an epoch lint

6 years agoAdd test
Manish Goregaokar [Thu, 8 Mar 2018 17:30:07 +0000 (09:30 -0800)]
Add test

6 years agoMake bare_trait_lint allow for now
Manish Goregaokar [Wed, 7 Mar 2018 01:32:29 +0000 (17:32 -0800)]
Make bare_trait_lint allow for now

6 years agoMake it possible to ungate features by epoch
Manish Goregaokar [Wed, 7 Mar 2018 00:14:25 +0000 (16:14 -0800)]
Make it possible to ungate features by epoch

6 years agoAllow mentioning an optional epoch on features
Manish Goregaokar [Wed, 7 Mar 2018 00:02:58 +0000 (16:02 -0800)]
Allow mentioning an optional epoch on features

6 years agoMove epochs to libsyntax
Manish Goregaokar [Tue, 6 Mar 2018 22:05:03 +0000 (14:05 -0800)]
Move epochs to libsyntax

6 years agoModify part of `column!` documentation.
Anthony Defranceschi [Thu, 8 Mar 2018 23:43:54 +0000 (00:43 +0100)]
Modify part of `column!` documentation.

Just like `line!` documentation, I've replaced:

> The returned column is not the invocation of the `column!` macro itself

By

> The returned column is *not necessarily* the line of the `column!` invocation itself

See #46997.

6 years agoModify part of `line!` documentation.
Anthony Defranceschi [Thu, 8 Mar 2018 23:36:07 +0000 (00:36 +0100)]
Modify part of `line!` documentation.

In accordance with #46997, I've replaced:

> The returned line is not the invocation of the line! macro itself [...]

By

> The returned line is *not necessarily* the line of the `line!` invocation itself [...]

6 years agoAuto merge of #48849 - Manishearth:rollup, r=Manishearth
bors [Thu, 8 Mar 2018 22:08:21 +0000 (22:08 +0000)]
Auto merge of #48849 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #48292, #48682, #48699, #48738, #48752, #48789, #48808
- Failed merges:

6 years agoUpdate tests
Basile Desloges [Wed, 7 Feb 2018 15:26:35 +0000 (16:26 +0100)]
Update tests

6 years agoUpdate "type parameters from outer function" error messages
Basile Desloges [Wed, 7 Feb 2018 10:50:11 +0000 (11:50 +0100)]
Update "type parameters from outer function" error messages

6 years agoAdd codemap functions to retrieve the source before a given span
Basile Desloges [Thu, 22 Feb 2018 14:27:41 +0000 (15:27 +0100)]
Add codemap functions to retrieve the source before a given span

6 years agoand again :(
Maxim Nazarenko [Thu, 8 Mar 2018 21:26:27 +0000 (23:26 +0200)]
and again :(

6 years agotidy. Again
Maxim Nazarenko [Thu, 8 Mar 2018 21:16:31 +0000 (23:16 +0200)]
tidy. Again

6 years agoanother rewrite
Maxim Nazarenko [Thu, 8 Mar 2018 21:15:39 +0000 (23:15 +0200)]
another rewrite

based on @nikomatsakis texthg

6 years agoin which parentheses are suggested for should-have-been-tuple-patterns
Zack M. Davis [Sun, 25 Feb 2018 04:41:16 +0000 (20:41 -0800)]
in which parentheses are suggested for should-have-been-tuple-patterns

Programmers used to working in some other languages (such as Python or
Go) might expect to be able to destructure values with comma-separated
identifiers but no parentheses on the left side of an assignment.

Previously, the first name in such code would get parsed as a
single-indentifier pattern—recognizing, for example, the
`let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax
error on seeing an unexpected comma rather than the expected semicolon
(all the way nearer to the end of `parse_full_stmt`).

Instead, let's look for that comma when parsing the pattern, and if we
see it, momentarily make-believe that we're parsing the remaining
elements in a tuple pattern, so that we can suggest wrapping it all in
parentheses. We need to do this in a separate wrapper method called on
the top-level pattern (or `|`-patterns) in a `let` statement, `for`
loop, `if`- or `while let` expression, or match arm rather than within
`parse_pat` itself, because `parse_pat` gets called recursively to parse
the sub-patterns within a tuple pattern.

Resolves #48492.

6 years agoRollup merge of #48808 - Zoxc:reg-diag, r=michaelwoerister
Manish Goregaokar [Thu, 8 Mar 2018 19:26:02 +0000 (11:26 -0800)]
Rollup merge of #48808 - Zoxc:reg-diag, r=michaelwoerister

Move REGISTERED_DIAGNOSTICS to a ParseSess field

r? @michaelwoerister

6 years agoRollup merge of #48789 - GuillaumeGomez:horizontal-scroll, r=QuietMisdreavus
Manish Goregaokar [Thu, 8 Mar 2018 19:26:00 +0000 (11:26 -0800)]
Rollup merge of #48789 - GuillaumeGomez:horizontal-scroll, r=QuietMisdreavus

Fix sidebar horizontal scroll

Just like @onur said.

r? @QuietMisdreavus

6 years agoRollup merge of #48752 - alexcrichton:fix-target-feature, r=michaelwoerister
Manish Goregaokar [Thu, 8 Mar 2018 19:25:59 +0000 (11:25 -0800)]
Rollup merge of #48752 - alexcrichton:fix-target-feature, r=michaelwoerister

rustc: Fix ICE with `#[target_feature]` on module

This commit fixes an ICE in rustc when `#[target_feature]` was applied to items
other than functions due to the way the feature was validated.

6 years agoRollup merge of #48738 - Songbird0:parseinterror_potential_cause, r=joshtriplett
Manish Goregaokar [Thu, 8 Mar 2018 19:25:58 +0000 (11:25 -0800)]
Rollup merge of #48738 - Songbird0:parseinterror_potential_cause, r=joshtriplett

Add a potential cause raising `ParseIntError`.

Initially, I wanted to add it directly to the documentation of `str. parse()` method, I finally found that it was more relevant (I hope so?) to directly document the structure in question. I've added a scenario, in which we could all get caught at least once, to make it easier to diagnose the problem when parsing integers.

6 years agoRollup merge of #48699 - frewsxcv:frewsxcv-impl-trait, r=nikomatsakis
Manish Goregaokar [Thu, 8 Mar 2018 19:25:57 +0000 (11:25 -0800)]
Rollup merge of #48699 - frewsxcv:frewsxcv-impl-trait, r=nikomatsakis

Replace iterator structures with `impl Trait`.

Two commits:

* Replace iterator structures with `impl Trait`.
* Run rustfmt on `src/librustc_data_structures/graph/mod.rs`.

6 years agoRollup merge of #48682 - spastorino:make_causal_lazy, r=nikomatsakis
Manish Goregaokar [Thu, 8 Mar 2018 19:25:56 +0000 (11:25 -0800)]
Rollup merge of #48682 - spastorino:make_causal_lazy, r=nikomatsakis

[NLL] Make causal tracking lazy

Close #46590

cc @nikomatsakis

6 years agoRollup merge of #48292 - topecongiro:from_str-for-path-and-pathbuf, r=alexcrichton
Manish Goregaokar [Thu, 8 Mar 2018 19:25:54 +0000 (11:25 -0800)]
Rollup merge of #48292 - topecongiro:from_str-for-path-and-pathbuf, r=alexcrichton

Implement FromStr for PathBuf

Closes #44431.

6 years agoAdd a map of `DefId` to `Span` in the `Definitions` struct
Basile Desloges [Sat, 17 Feb 2018 12:22:58 +0000 (13:22 +0100)]
Add a map of `DefId` to `Span` in the `Definitions` struct

6 years agoAuto merge of #46882 - oli-obk:miri3, r=eddyb
bors [Thu, 8 Mar 2018 08:52:23 +0000 (08:52 +0000)]
Auto merge of #46882 - oli-obk:miri3, r=eddyb

Replace all const evaluation with miri

* error reporting in constants prints a stacktrace through all called const fns
* Trivial constant propagation and folding in MIR (always active, irrelevant of the optimization level)
* can now use floating constants in patterns (previously only floating point literals were allowed)
    * the future compat lint is still produced for both cases
* can index into constant arrays during const eval (previously feature gated)
* can create a constant union value with field `a` and read from field `b`
* can dereference references into constants
* can create references inside constants (`const X: &u32 = &22`)
* Tuple struct constructors can be used in constants
* regression in const eval errors spans (some of these need improvements in mir debug info)
* can cast floats to ints and vice versa (in constants, and even nan/inf constants)
* Mir dump prints false/true instead of 0u8/1u8
* `1i8 >> [8][0]` does not lint about exceeding bitshifts anymore.
    * Needs const propagation across projections
* `foo[I]` produces a const eval lint if `foo: [T; N]` and `N < I`
    * Essentially all builtin panics produce lints if they can be statically proven to trigger at runtime. This is on a best effort basis, so there might be some complex cases that don't trigger. (The runtime panic stays there, irrelevant of whether the lint is produced or not)
* can use `union`s to implement `transmute` for `Copy` types in constants without a feature gate. With all the greatness and nasal demons that come with this.
* can convert integers to `&'static T` in constants (useful for embedded)

fixes #34997 (stack overflow with many constants)
fixes #25574 (deref byte strings in patterns)
fixes #27918 (broken mir ICE)
fixes #46114 (ICE on struct constructors in patterns)
fixes #37448 (`SomeStruct { foo } as SomeStruct`)
fixes #43754 (`return` in const fn)
fixes #41898 (tuple struct constructors)
fixes #31364 (infinite recursion with const fn, fixed by miri's recursion limit)
closes #29947 (const indexing stabilization)
fixes #45044 (pattern matching repeat expressions)
fixes #47971 (ICE on const fn + references)
fixes #48081 (ICE on cyclic assoc const error)
fixes #48746 (nonhelpful error message with unions)

r? @eddyb

even though 1k loc are added in tests, this PR reduces the loc in this repository by 700

6 years agoDon't derive traits on packed structs
Oliver Schneider [Wed, 7 Mar 2018 11:56:48 +0000 (12:56 +0100)]
Don't derive traits on packed structs

6 years agoClean up the binary hex lint
Oliver Schneider [Wed, 7 Mar 2018 07:17:03 +0000 (08:17 +0100)]
Clean up the binary hex lint

6 years agosimplify constant value pair field access
Oliver Schneider [Tue, 6 Mar 2018 13:07:52 +0000 (14:07 +0100)]
simplify constant value pair field access

6 years agoUnify the const folding errors
Oliver Schneider [Tue, 6 Mar 2018 11:43:02 +0000 (12:43 +0100)]
Unify the const folding errors

before they differed depending on whether optimizations were on or not

6 years agoCorrect the shift overflow check in miri
Oliver Schneider [Tue, 6 Mar 2018 09:26:23 +0000 (10:26 +0100)]
Correct the shift overflow check in miri

6 years agoRegenerate tests
Oliver Schneider [Mon, 5 Mar 2018 09:21:11 +0000 (10:21 +0100)]
Regenerate tests