Commit Graph

74951 Commits

Author SHA1 Message Date
Bastien Orivel
4858065ab9 Reupdate rust-installer
Removes the walkdir 1.0 and same-file 0.1 dependencies
2018-03-02 16:49:01 +01:00
Bastien Orivel
75fd9109a3 Update rust-installer
This removes the last dependency on rayon 0.9
2018-03-02 15:34:32 +01:00
bors
9cb18a92ad Auto merge of #48653 - Manishearth:rollup2, r=Manishearth
Another rollup

None
2018-03-02 06:08:15 +00:00
bors
ddfbf2b0f4 Auto merge of #47861 - sgrif:sg-rebase-chalkify-universe-refactorings, r=nikomatsakis
Rebased refactorings for Chalk

The code is Niko's, I just handled the rebase.

r? @nikomatsakis
2018-03-01 21:14:35 +00:00
kennytm
2b3c815ddf Rollup merge of #48570 - Amanieu:aarch64_features, r=alexcrichton
Add AArch64 features to whitelist
2018-03-01 09:29:43 -08:00
Manish Goregaokar
a080d7b2b2 Rollup merge of #48626 - teiesti:fix-readme, r=frewsxcv
Fix link to rustc guide in README.md

This is a follow-up to #48479 and fixes a minor bug with the link to the rustc guide in the README.

r? @nikomatsakis

cc @mark-i-m
2018-03-01 09:29:42 -08:00
Manish Goregaokar
cf0638cfde Rollup merge of #48610 - ishitatsuyuki:ishitatsuyuki-patch-1, r=nikomatsakis
Add regression test for #48551

[Issue link](https://github.com/rust-lang/rust/issues/48551)
2018-03-01 09:29:42 -08:00
Manish Goregaokar
b812b77094 Rollup merge of #48585 - stjepang:stabilize-localkey-try_with, r=alexcrichton
Stabilize LocalKey::try_with

The `LocalKey::try_with` method is now stabilized.

`LocalKey::state` and `LocalKeyState` marked as deprecated. Although, is there any reason to keep them - should we perhaps remove them completely?

Closes #27716

r? @alexcrichton
2018-03-01 09:29:41 -08:00
Manish Goregaokar
8025e1555c Rollup merge of #48572 - alexcrichton:noexcept-msvc2, r=eddyb
rustc: Tweak funclet cleanups of ffi functions

This commit is targeted at addressing #48251 by specifically fixing a case where
a longjmp over Rust frames on MSVC runs cleanups, accidentally running the
"abort the program" cleanup as well. Added in #46833 `extern` ABI functions in
Rust will abort the process if Rust panics, and currently this is modeled as a
normal cleanup like all other destructors.

Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the
same mechanism used to implement panics in Rust. This means that `longjmp` over
Rust frames will run Rust cleanups (even though we don't necessarily want it
to). Notably this means that if you `longjmp` over a Rust stack frame then that
probably means you'll abort the program because one of the cleanups will abort
the process.

After some discussion on IRC it turns out that `longjmp` doesn't run cleanups
for *caught* exceptions, it only runs cleanups for cleanup pads. Using this
information this commit tweaks the codegen for an `extern` function to
a catch-all clause for exceptions instead of a cleanup block. This catch-all is
equivalent to the C++ code:

    try {
        foo();
    } catch (...) {
        bar();
    }

and in fact our codegen here is designed to match exactly what clang emits for
that C++ code!

With this tweak a longjmp over Rust code will no longer abort the process. A
longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC.
Other non-MSVC platforms will not rust destructors with a longjmp, so we'll
probably still recommend "don't have destructors on the stack", but in any case
this is a more surgical fix than #48567 and should help us stick to standard
personality functions a bit longer.
2018-03-01 09:29:40 -08:00
Manish Goregaokar
75b8c10391 Rollup merge of #48522 - etaoins:fix-find-width-of-character-at-span-bounds-check, r=estebank
Fix find_width_of_character_at_span bounds check

Commit 0bd96671f0 added bounds checking of our current target byte position to prevent infinite loops. Unfortunately it was comparing the file-relative `target` versus the global `file_start_pos` and `file_end_pos`.

The result is failing to detect multibyte characters unless their file-relative offset fit within their global offset. This causes other parts of the compiler to generate spans pointing to the middle of a
multibyte character which will ultimately panic in `bytepos_to_file_charpos`.

Fix by comparing the `target` to the total file size when moving forward and doing checked subtraction when moving backwards. This should preserve the intent of the bounds check while removing the offset confusion.

cc @davidtwco

Fixes #48508
2018-03-01 09:29:40 -08:00
Manish Goregaokar
38f4d557d0 Rollup merge of #48500 - petrochenkov:parpat, r=nikomatsakis
Support parentheses in patterns under feature gate

This is a prerequisite for any other extensions to pattern syntax - `|` with multiple patterns, type ascription, `..PAT` in slice patterns.

Closes https://github.com/rust-lang/rfcs/issues/554
2018-03-01 09:29:39 -08:00
Manish Goregaokar
39d5e1cba6 Rollup merge of #48446 - mark-i-m:e0245, r=mark-i-m
Remove E0245; improve E0404

Fix #36337

Somehow this is currently breaking --explain, but I don't understand how.

r? @estebank
2018-03-01 09:29:38 -08:00
Manish Goregaokar
eadea4ab1a Rollup merge of #48405 - kennytm:autotoolstate-follow-up, r=Mark-Simulacrum
Auto-toolstate management follow-up.

Tracking comment: https://github.com/rust-lang/rust/issues/45861#issuecomment-367302777

* Fixed rust-lang-nursery/rust-toolstate#1, a proper link to the PR will be included.
* Fixed rust-lang-nursery/rust-toolstate#2, a comment will be posted to the PR if the toolstate changed
* Toolstate regression will be rejected at the last week of the 6-week cycle (currently entirely date-based).
* Implemented https://internals.rust-lang.org/t/the-current-submodule-setup-is-not-tenable/6593, moved doc tests of Nomicon, Reference, Rust-by-Example and The Book to the "tools" job and thus allowed to fail like other external tools.
2018-03-01 09:29:37 -08:00
Sean Griffin
fec4d3b711 Bump ena 2018-03-01 08:04:26 -07:00
Sean Griffin
a6d85332f4 Fix breakage in rustdoc 2018-03-01 08:04:26 -07:00
Sean Griffin
e9eb1a6adc Fix bad rebase 2018-03-01 08:04:26 -07:00
Sean Griffin
4fb201dee5 Re-add some removed uses of Kind
Additional uses of this item were added to these files in #45701 and #46479
2018-03-01 08:04:26 -07:00
Sean Griffin
c30183873e Remove dead code
These modules were replaced with re-exports from ena
2018-03-01 08:04:26 -07:00
Sean Griffin
755bdaa190 change skolemizations to use universe index
These changes were meant to be in
2b18d8fe9dc05415a8e6b7cadf879c7f7ebe020a (rebased from
12a230562ece9b0d29018a436676141054dc53b7), but I messed up the rebase a
bit as the file had been moved.
2018-03-01 08:04:26 -07:00
Niko Matsakis
17df455c2e fix tests in librustc_driver 2018-03-01 08:04:26 -07:00
Niko Matsakis
a985634fc0 fix tidy error 2018-03-01 08:04:26 -07:00
Niko Matsakis
35e78b5cdd change skolemizations to use universe index 2018-03-01 08:04:26 -07:00
Niko Matsakis
13efaf0481 add universes to type inference variables 2018-03-01 08:04:26 -07:00
Niko Matsakis
44d992984a remove unnecessary clause propagating divergence
This should not be needed: the new variable will be related to the old
ones, so if they are constrained, so is the new variable; if they are
not, and hence default to diverging, so will the new variable.
2018-03-01 08:04:26 -07:00
Niko Matsakis
69fe43c97e have probe() return TypeVariableValue 2018-03-01 08:04:26 -07:00
Niko Matsakis
ccd92c2a4e correct subtle bug in the type variable code 2018-03-01 08:04:26 -07:00
Niko Matsakis
57a593fcbb store type values in the unification table directly 2018-03-01 08:04:26 -07:00
Niko Matsakis
c7953bb6d6 obtain UnificationTable and snapshot_vec from ena instead
The ena version has an improved interface. I suspect
`librustc_data_structures` should start migrating out to crates.io in
general.
2018-03-01 08:04:26 -07:00
Niko Matsakis
b680b12e94 kill supporting code from type-variable defaults
This was all unused anyway.
2018-03-01 08:04:26 -07:00
Niko Matsakis
047a8d0161 kill custom type inference defaults (these don't really work anyway) 2018-03-01 08:04:26 -07:00
Niko Matsakis
7112d6584c make Default Copy and Clone 2018-03-01 08:04:26 -07:00
Niko Matsakis
d516b263c6 use {} for Known variant just for more parity 2018-03-01 08:04:26 -07:00
Niko Matsakis
d4df52cacb introduce UniverseIndex into ParamEnv
Always using root environment for now.
2018-03-01 08:04:26 -07:00
Niko Matsakis
e7efce2361 add some comments to Obligation 2018-03-01 08:04:26 -07:00
Niko Matsakis
803bd76127 introduce Universe struct 2018-03-01 08:04:26 -07:00
bors
3eeb5a665e Auto merge of #46785 - leodasvacas:type-check-defaults-at-declaration, r=nikomatsakis
[Underspecified semantics] Type check defaults at declaration.

Fixes  #46669. See the test for code that compiles on stable but will no longer compile. This falls under a "Underspecified language semantics" fix. **Needs crater**.

On type and trait declarations, we currently allow anything that name checks as a type parameter default. That allows the user to write a default that can never be applied, or even a default that may conditionally be applied depending on the type of another parameter. Mostly this just defers the error to use sites, but also allows clever hacks such as `Foo<T, U = <T as Iterator>::Item>` where `U` will be able to apply it's default only when `T: Iterator`. Maybe that means this bug is a feature, but it's a fiddly behaviour that seems undesirable.

This PR validates defaults at declaration sites by ensuring all predicates on the parameter are valid for the default. With the exception of `Self: Sized` which we don't want to check to allow things like `trait Add<RHS = Self>`.
2018-03-01 13:19:18 +00:00
Ryan Cumming
363d6040fd Add ignore-pretty for issue-48506.rs
The out-of-line module #37195
2018-03-01 17:51:14 +11:00
Tobias Stolzmann
6edbe37437
Fix link to rustc guide in README.md 2018-03-01 03:13:17 +01:00
bors
a85417f593 Auto merge of #48349 - nrc:update, r=alexcrichton
Update RLS

r? @alexcrichton
2018-03-01 02:11:35 +00:00
bors
0e3c9bba8e Auto merge of #48615 - Manishearth:rollup, r=Manishearth
Rollup of 10 pull requests

- Successful merges: #48355, #48359, #48380, #48419, #48420, #48461, #48522, #48570, #48572, #48603
- Failed merges:
2018-02-28 23:10:14 +00:00
Manish Goregaokar
b2b9707696
Rollup merge of #48603 - pthariensflame:patch-1, r=frewsxcv
Fixes #47311.
r? @nrc
2018-02-28 15:09:31 -08:00
Manish Goregaokar
f57835b7f4
Rollup merge of #48461 - Manishearth:epoch-dyn-trait, r=nmatsakis
Fixes #47311.
r? @nrc
2018-02-28 15:09:29 -08:00
Manish Goregaokar
6b5519ddac
Rollup merge of #48420 - teiesti:path_parents, r=BurntSushi
Fixes #47311.
r? @nrc
2018-02-28 15:09:27 -08:00
Manish Goregaokar
12515608cb
Rollup merge of #48380 - nikomatsakis:issue-48251-master, r=acrichto
Fixes #47311.
r? @nrc
2018-02-28 15:09:26 -08:00
Manish Goregaokar
fac7d7cfb2
Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiyn
Fixes #47311.
r? @nrc
2018-02-28 15:09:24 -08:00
Manish Goregaokar
f59ab8e96a
Rollup merge of #48355 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
Fixes #47311.
r? @nrc
2018-02-28 15:09:22 -08:00
Stjepan Glavina
cb56b2d152 Fix a bug introduced in previous commit 2018-03-01 00:07:27 +01:00
Vadim Petrochenkov
c9aff92e6d Support parentheses in patterns under feature gate
Improve recovery for trailing comma after `..`
2018-03-01 01:47:56 +03:00
Alex Crichton
804666f4ad rustc: Tweak funclet cleanups of ffi functions
This commit is targeted at addressing #48251 by specifically fixing a case where
a longjmp over Rust frames on MSVC runs cleanups, accidentally running the
"abort the program" cleanup as well. Added in #46833 `extern` ABI functions in
Rust will abort the process if Rust panics, and currently this is modeled as a
normal cleanup like all other destructors.

Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the
same mechanism used to implement panics in Rust. This means that `longjmp` over
Rust frames will run Rust cleanups (even though we don't necessarily want it
to). Notably this means that if you `longjmp` over a Rust stack frame then that
probably means you'll abort the program because one of the cleanups will abort
the process.

After some discussion on IRC it turns out that `longjmp` doesn't run cleanups
for *caught* exceptions, it only runs cleanups for cleanup pads. Using this
information this commit tweaks the codegen for an `extern` function to
a catch-all clause for exceptions instead of a cleanup block. This catch-all is
equivalent to the C++ code:

    try {
        foo();
    } catch (...) {
        bar();
    }

and in fact our codegen here is designed to match exactly what clang emits for
that C++ code!

With this tweak a longjmp over Rust code will no longer abort the process. A
longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC.
Other non-MSVC platforms will not rust destructors with a longjmp, so we'll
probably still recommend "don't have destructors on the stack", but in any case
this is a more surgical fix than #48567 and should help us stick to standard
personality functions a bit longer.
2018-02-28 13:31:23 -08:00
Stjepan Glavina
082dd6d7af Fix a few run-pass tests 2018-02-28 20:52:38 +01:00