]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agorustc: Start a custom cabi module for wasm32
Alex Crichton [Mon, 12 Mar 2018 20:09:03 +0000 (13:09 -0700)]
rustc: Start a custom cabi module for wasm32

It actually was already using the `cabi_asmjs` module but that was by accident,
so route the new `wasm32-unknown-unknown` target to a new `cabi_wasm32` module.
The first entries in this module are to use `signext` and `zeroext` for types
that are under 32 bytes in size

Closes rust-lang-nursery/rust-wasm#88

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 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 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 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 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 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 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 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 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 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

6 years agoUse clearer name for integer bit width helper function
Oliver Schneider [Fri, 23 Feb 2018 12:52:33 +0000 (13:52 +0100)]
Use clearer name for integer bit width helper function

6 years agoReuse `Integer::from_attr`
Oliver Schneider [Fri, 23 Feb 2018 12:39:41 +0000 (13:39 +0100)]
Reuse `Integer::from_attr`

6 years agoRemove unused error code
Oliver Schneider [Fri, 23 Feb 2018 10:20:51 +0000 (11:20 +0100)]
Remove unused error code

6 years agoGenerator assertions are unconditionally triggered
Oliver Schneider [Fri, 23 Feb 2018 08:21:31 +0000 (09:21 +0100)]
Generator assertions are unconditionally triggered

6 years agoAddress review comments
Oliver Schneider [Thu, 22 Feb 2018 16:29:39 +0000 (17:29 +0100)]
Address review comments

6 years agoAdjust test which differs between 32 bit and 64 bit
Oliver Schneider [Thu, 22 Feb 2018 15:56:14 +0000 (16:56 +0100)]
Adjust test which differs between 32 bit and 64 bit

The differences are not part of what the test is testing, so they were simply removed.

6 years agoDecide signdedness on the layout instead of the type
Oliver Schneider [Thu, 22 Feb 2018 13:59:18 +0000 (14:59 +0100)]
Decide signdedness on the layout instead of the type

6 years agoDeduplicate some code
Oliver Schneider [Thu, 22 Feb 2018 08:37:20 +0000 (09:37 +0100)]
Deduplicate some code

6 years agoDon't use the undefined bytes of PrimVal::Bytes
Oliver Schneider [Wed, 21 Feb 2018 21:02:52 +0000 (22:02 +0100)]
Don't use the undefined bytes of PrimVal::Bytes

6 years agoFix mozjs crater failure
Oliver Schneider [Tue, 20 Feb 2018 10:49:50 +0000 (11:49 +0100)]
Fix mozjs crater failure

6 years agoConst eval will oom together with rustc now
Oliver Schneider [Tue, 20 Feb 2018 09:32:33 +0000 (10:32 +0100)]
Const eval will oom together with rustc now

6 years agoStep limit is now terminator limit
Oliver Schneider [Mon, 19 Feb 2018 11:00:15 +0000 (12:00 +0100)]
Step limit is now terminator limit

6 years agoAdd regression test
Oliver Schneider [Mon, 19 Feb 2018 09:26:53 +0000 (10:26 +0100)]
Add regression test

6 years agoRebase fallout
Oliver Schneider [Fri, 9 Feb 2018 08:38:45 +0000 (09:38 +0100)]
Rebase fallout

6 years agoReport tcx errors with the span of the currently evaluating statement
Oliver Schneider [Tue, 6 Feb 2018 17:33:59 +0000 (18:33 +0100)]
Report tcx errors with the span of the currently evaluating statement

6 years agoReport a best guess span if no stack is available anymore
Oliver Schneider [Tue, 6 Feb 2018 14:35:43 +0000 (15:35 +0100)]
Report a best guess span if no stack is available anymore

6 years agoUpdate compile-fail tests
Oliver Schneider [Tue, 6 Feb 2018 13:15:36 +0000 (14:15 +0100)]
Update compile-fail tests

6 years agoAdd a test for transmuting via unions in constants
Oliver Schneider [Tue, 6 Feb 2018 13:05:06 +0000 (14:05 +0100)]
Add a test for transmuting via unions in constants

6 years agoTypo
Oliver Schneider [Tue, 6 Feb 2018 13:04:42 +0000 (14:04 +0100)]
Typo

6 years agoUnregress error spans in constant errors
Oliver Schneider [Tue, 6 Feb 2018 13:04:35 +0000 (14:04 +0100)]
Unregress error spans in constant errors

6 years agoStage 2 doesn't see suggestion_approximate
Oliver Schneider [Tue, 6 Feb 2018 09:51:54 +0000 (10:51 +0100)]
Stage 2 doesn't see suggestion_approximate

6 years agoRemove dead code
Oliver Schneider [Tue, 6 Feb 2018 09:24:53 +0000 (10:24 +0100)]
Remove dead code

6 years agoAdd some documentation to pattern/const conversions
Oliver Schneider [Tue, 6 Feb 2018 08:52:56 +0000 (09:52 +0100)]
Add some documentation to pattern/const conversions

6 years agoReduce code duplication
Oliver Schneider [Tue, 6 Feb 2018 08:52:08 +0000 (09:52 +0100)]
Reduce code duplication

6 years agoTidy fix
Oliver Schneider [Wed, 31 Jan 2018 14:45:59 +0000 (15:45 +0100)]
Tidy fix

6 years agoConst eval error refactoring
Oliver Schneider [Wed, 31 Jan 2018 14:06:45 +0000 (15:06 +0100)]
Const eval error refactoring

6 years agoAdd stack traces to miri errors
Oliver Schneider [Wed, 31 Jan 2018 09:39:30 +0000 (10:39 +0100)]
Add stack traces to miri errors

6 years agoUpdate tests
Oliver Schneider [Wed, 31 Jan 2018 09:20:30 +0000 (10:20 +0100)]
Update tests