]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #66466 - RalfJung:seh, r=oli-obk
Yuki Okushi [Sun, 17 Nov 2019 04:36:21 +0000 (13:36 +0900)]
Rollup merge of #66466 - RalfJung:seh, r=oli-obk

miri panic_unwind: fix hack for SEH platforms

The old hack didn't work as we ended up duplicating the `eh_personality` lang item...

I have no idea if rustc cares that `eh_catch_typeinfo` has a certain shape, but better safe than sorry. I cannot test this locally.

r? @oli-obk Cc @Aaron1011

4 years agoRollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=rkruppe
Yuki Okushi [Sun, 17 Nov 2019 04:36:19 +0000 (13:36 +0900)]
Rollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=rkruppe

add missing 'static lifetime in docs

4 years agoRollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum
Yuki Okushi [Sun, 17 Nov 2019 04:36:18 +0000 (13:36 +0900)]
Rollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum

Move `DIAGNOSTICS` usage to `rustc_driver`

Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528.

(May include traces of minor drive-by cleanup.)

r? @Mark-Simulacrum

4 years agoRollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC
Yuki Okushi [Sun, 17 Nov 2019 04:36:16 +0000 (13:36 +0900)]
Rollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC

Centralize panic macro documentation

This is just the main commit from #61511 (which got closed because the author didn't reply) cherry-picked on the current master. Building `core` and `std` on this branch in stage 1 succeeded, which I thinks means the issues from the previous PR should be gone (but let's see what CI says).

4 years agoRollup merge of #66381 - Centril:66340, r=petrochenkov
Yuki Okushi [Sun, 17 Nov 2019 04:36:15 +0000 (13:36 +0900)]
Rollup merge of #66381 - Centril:66340, r=petrochenkov

find_deprecation: deprecation attr may be ill-formed meta.

Fixes #66340.

r? @petrochenkov
cc @pnkfelix

4 years agoRollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper
Yuki Okushi [Sun, 17 Nov 2019 04:36:13 +0000 (13:36 +0900)]
Rollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper

rustc_plugin: Remove `Registry::register_attribute`

Legacy plugins cannot register inert attributes anymore.

The preferred replacement is to use `register_tool` ([tracking issue](https://github.com/rust-lang/rust/issues/66079)).
```rust
#![register_tool(servo)]

#[servo::must_root]
struct S;
```

The more direct replacement is `register_attribute` ([tracking issue](https://github.com/rust-lang/rust/issues/66080))
```rust
#![register_attr(must_root)]

#[must_root]
struct S;
```
, but it requires registering each attribute individually rather than registering the tool once, and is more likely to be removed rather than stabilized.

4 years agoRollup merge of #66271 - petrochenkov:abism, r=Centril
Yuki Okushi [Sun, 17 Nov 2019 04:36:12 +0000 (13:36 +0900)]
Rollup merge of #66271 - petrochenkov:abism, r=Centril

syntax: Keep string literals in ABIs and `asm!` more precisely

As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently.
Continuation of https://github.com/rust-lang/rust/pull/60679, which did a similar thing with all literals besides those in ABIs and `asm!`.

TODO: Add tests.

Fixes https://github.com/rust-lang/rust/issues/60493
Fixes https://github.com/rust-lang/rust/issues/64561
r? @Centril

4 years agoRollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay
Yuki Okushi [Sun, 17 Nov 2019 04:36:10 +0000 (13:36 +0900)]
Rollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay

Improve documentation of `Vec::split_off(...)`

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.

4 years agoAuto merge of #66394 - wesleywiser:fix_oom, r=oli-obk
bors [Sat, 16 Nov 2019 22:54:33 +0000 (22:54 +0000)]
Auto merge of #66394 - wesleywiser:fix_oom, r=oli-obk

Fix two OOM issues related to `ConstProp`

Fixes #66342
Fixes #66397

r? @oli-obk

4 years agoAdd some more tests
Vadim Petrochenkov [Sat, 16 Nov 2019 22:11:35 +0000 (01:11 +0300)]
Add some more tests

4 years agoAddress review comments
Vadim Petrochenkov [Sat, 16 Nov 2019 17:11:05 +0000 (20:11 +0300)]
Address review comments

4 years agoRevise the text of `vec::split_off()` per review in #65739
Mahmoud Al-Qudsi [Sat, 16 Nov 2019 20:11:08 +0000 (14:11 -0600)]
Revise the text of `vec::split_off()` per review in #65739

Remove the incorrect usage of "copy" as the trait is not called.

4 years agoImprove documentation of `Vec::split_off(...)`
Mahmoud Al-Qudsi [Wed, 23 Oct 2019 21:32:16 +0000 (16:32 -0500)]
Improve documentation of `Vec::split_off(...)`

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.

4 years agoAuto merge of #64694 - petrochenkov:reshelp, r=matthewjasper
bors [Sat, 16 Nov 2019 19:50:48 +0000 (19:50 +0000)]
Auto merge of #64694 - petrochenkov:reshelp, r=matthewjasper

Fully integrate derive helpers into name resolution

```rust
#[derive(Foo)]
#[foo_helper] // already goes through name resolution
struct S {
    #[foo_helper] // goes through name resolution after this PR
    field: u8
}
```
How name resolution normally works:
- We have an identifier we need to resolve, take its location (in some sense) and look what names are in scope in that location.

How derive helper attributes are "resolved" (before this PR):
- After resolving the derive `Foo` we visit the derive's input (`struct S { ... } `) as a piece of AST and mark attributes textually matching one of the derive's helper attributes (`foo_helper`) as "known", so they never go through name resolution.

This PR changes the rules for derive helpers, so they are not proactively marked as known (which is a big hack ignoring any ambiguities or hygiene), but go through regular name resolution instead.
This change was previously blocked by attributes not being resolved in some positions at all (fixed in https://github.com/rust-lang/rust/pull/63468).

"Where exactly are derive helpers in scope?" is an interesting question, and I need some feedback from proc macro authors to answer it, see the post below (https://github.com/rust-lang/rust/pull/64694#issuecomment-533925160).

4 years agoparse: Use string literal parsing in the `asm` macro
Vadim Petrochenkov [Sun, 10 Nov 2019 14:04:12 +0000 (17:04 +0300)]
parse: Use string literal parsing in the `asm` macro

4 years agoparse: Support parsing optional literals
Vadim Petrochenkov [Sun, 10 Nov 2019 12:32:41 +0000 (15:32 +0300)]
parse: Support parsing optional literals

Revert weird renaming of the former `LitError::report`

4 years agoast: Keep string literals in ABIs precisely
Vadim Petrochenkov [Sat, 9 Nov 2019 21:44:59 +0000 (00:44 +0300)]
ast: Keep string literals in ABIs precisely

4 years agoast: Keep `extern` qualifiers in functions more precisely
Vadim Petrochenkov [Sat, 9 Nov 2019 19:05:20 +0000 (22:05 +0300)]
ast: Keep `extern` qualifiers in functions more precisely

4 years agoOnly run tests on x86_64
Wesley Wiser [Fri, 15 Nov 2019 01:48:42 +0000 (20:48 -0500)]
Only run tests on x86_64

4 years agorustc_plugin: Remove `Registry::register_attribute`
Vadim Petrochenkov [Tue, 12 Nov 2019 18:22:16 +0000 (21:22 +0300)]
rustc_plugin: Remove `Registry::register_attribute`

4 years agoAdd some more tests
Vadim Petrochenkov [Sat, 5 Oct 2019 13:59:52 +0000 (16:59 +0300)]
Add some more tests

4 years agoexpand: Stop marking derive helper attributes as known
Vadim Petrochenkov [Sat, 5 Oct 2019 13:30:08 +0000 (16:30 +0300)]
expand: Stop marking derive helper attributes as known

Pass them through name resolution instead

4 years agoresolve: Introduce a new scope for derive helpers
Vadim Petrochenkov [Thu, 3 Oct 2019 22:53:20 +0000 (01:53 +0300)]
resolve: Introduce a new scope for derive helpers

4 years agoresolve: `Scope::DeriveHelpers` -> `Scope::DeriveHelpersCompat`
Vadim Petrochenkov [Thu, 3 Oct 2019 22:44:57 +0000 (01:44 +0300)]
resolve: `Scope::DeriveHelpers` -> `Scope::DeriveHelpersCompat`

These helpers are resolved before their respective derives through a kind of look ahead into future expansions.
Some of these will migrate to proper resolution, others will be deprecated.

```
#[trait_helper] // Deprecate
#[derive(Trait)]
#[trait_helper] // Migrate to proper resolution
```

4 years agoAuto merge of #66333 - mark-i-m:fix-rustc-guide-1, r=ehuss
bors [Sat, 16 Nov 2019 14:27:53 +0000 (14:27 +0000)]
Auto merge of #66333 - mark-i-m:fix-rustc-guide-1, r=ehuss

Fix rustc guide again

r? @ehuss

Sorry, links change fast in this world...

4 years agoavoid linking errors
Ralf Jung [Sat, 16 Nov 2019 08:37:45 +0000 (09:37 +0100)]
avoid linking errors

4 years agomiri panic_unwind: fix hack for SEH platforms
Ralf Jung [Sat, 16 Nov 2019 08:27:06 +0000 (09:27 +0100)]
miri panic_unwind: fix hack for SEH platforms

4 years agoadd missing 'static lifetime in docs
Magnus Ulimoen [Sat, 16 Nov 2019 07:22:40 +0000 (08:22 +0100)]
add missing 'static lifetime in docs

The example refers to a static lifetime parameter that can be elided.
This parameter is not included, meaning lifetime elision is not shown.

4 years agoAuto merge of #66255 - ehuss:update-cc, r=alexcrichton
bors [Sat, 16 Nov 2019 07:26:57 +0000 (07:26 +0000)]
Auto merge of #66255 - ehuss:update-cc, r=alexcrichton

Update cc, git2, num_cpus.

This updates the `cc` crate, bringing in better parallel building support. Also updates `git2` which enables the parallel feature. (Note: I don't expect it will have a significant impact on build time, but seems good to update anyways.)

The main thorn is that `cc` gained knowledge about RISC-V architectures (https://github.com/alexcrichton/cc-rs/pull/428, https://github.com/alexcrichton/cc-rs/pull/429, https://github.com/alexcrichton/cc-rs/pull/430), but the builders on CI do not have the riscv C compiler installed. This means that bootstraps' cc detection was finding a C compiler that isn't installed, and fails.

The solution here is to override the cc detection to `false`. The C compiler isn't actually used on riscv platforms. AFAIK, the only location would be compiler_builtins, and it currently forces C support off (https://github.com/rust-lang/compiler-builtins/blob/a533ae9c5aa325db209659679535fe1f186eae81/build.rs#L49-L55).

Other possible solutions:
- Add the override in cc_detect for riscv (or any "no-C" platform like wasm32 and nvptx)
- Install and use the appropriate c compiler. I tried this the `g++-riscv64-linux-gnu` package, but it failed missing some header file.

Closes #66232

4 years agoAuto merge of #66453 - Centril:rollup-w1ohzxs, r=Centril
bors [Sat, 16 Nov 2019 02:40:52 +0000 (02:40 +0000)]
Auto merge of #66453 - Centril:rollup-w1ohzxs, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #66350 (protect creation of destructors by a mutex)
 - #66407 (Add more tests for fixed ICEs)
 - #66415 (Add --force-run-in-process unstable option to libtest)
 - #66427 (Move the JSON error emitter to librustc_errors)
 - #66441 (libpanic_unwind for Miri: make sure we have the SEH lang items when needed)

Failed merges:

r? @ghost

4 years agomove DIAGNOSTICS usage to rustc_driver
Mazdak Farrokhzad [Fri, 15 Nov 2019 18:41:50 +0000 (19:41 +0100)]
move DIAGNOSTICS usage to rustc_driver

4 years agoAuto merge of #66326 - Nadrieril:refactor-intrange, r=varkor
bors [Fri, 15 Nov 2019 23:28:50 +0000 (23:28 +0000)]
Auto merge of #66326 - Nadrieril:refactor-intrange, r=varkor

Refactor integer range handling in the usefulness algorithm

Integer range handling had accumulated a lot of debt. This cleans up a lot of it.

In particular this:
- removes unnecessary conversions between `Const` and `u128`, and between `Constructor` and `IntRange`
- clearly distinguishes between on the one hand ranges of integers that may or may not be matched exhaustively, and on the other hand ranges of non-integers that are never matched exhaustively and are compared using Const-based shenanigans
- cleans up some overly complicated code paths
- generally tries to be more idiomatic.

As a nice side-effect, I measured a 10% perf increase on `unicode_normalization`.

There's one thing that I feel remains to clean up: the [overlapping range check](https://github.com/rust-lang/rust/pull/64007), which is currently quite ad-hoc. But that is intricate enough that I'm leaving it out of this PR.

There's also one little thing I'm not sure I understand: can `try_eval_bits` fail for an integer constant value in that code ? What would that mean, and how do I construct a test case for this possibility ?

4 years agoRespond to review feedback
Wesley Wiser [Thu, 14 Nov 2019 11:17:41 +0000 (06:17 -0500)]
Respond to review feedback

4 years ago[ConstProp] Avoid OOM crashes by not evaluating large Places
Wesley Wiser [Thu, 14 Nov 2019 01:37:33 +0000 (20:37 -0500)]
[ConstProp] Avoid OOM crashes by not evaluating large Places

Fixes #66397

4 years agoFix spurious CI filures due to OOM
Wesley Wiser [Thu, 14 Nov 2019 00:19:25 +0000 (19:19 -0500)]
Fix spurious CI filures due to OOM

Fixes #66342

4 years agoRollup merge of #66441 - RalfJung:seh, r=oli-obk
Mazdak Farrokhzad [Fri, 15 Nov 2019 17:02:04 +0000 (18:02 +0100)]
Rollup merge of #66441 - RalfJung:seh, r=oli-obk

libpanic_unwind for Miri: make sure we have the SEH lang items when needed

r? @oli-obk  @alexcrichton This is required to fix the Miri toolstate. Turns out rustc complains when doing codegen for MSVC and these lang items do not exist. For now `cfg(miri)` needs to still be able to codegen (we [plan to change that](https://github.com/rust-lang/miri/pull/1048#issuecomment-554108470) but that's a larger project requiring improvements to xargo and maybe also cargo; that should not block fixing the toolstate). Yes, this is a hack, but it is inside `cfg(miri)` so I hope this is okay.

Cc @Aaron1011

4 years agoRollup merge of #66427 - Mark-Simulacrum:errors-json, r=Centril
Mazdak Farrokhzad [Fri, 15 Nov 2019 17:02:02 +0000 (18:02 +0100)]
Rollup merge of #66427 - Mark-Simulacrum:errors-json, r=Centril

Move the JSON error emitter to librustc_errors

This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself.

Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).

4 years agoRollup merge of #66415 - tmandry:force-test-in-process, r=alexcrichton
Mazdak Farrokhzad [Fri, 15 Nov 2019 17:02:01 +0000 (18:02 +0100)]
Rollup merge of #66415 - tmandry:force-test-in-process, r=alexcrichton

Add --force-run-in-process unstable option to libtest

When running tests with `-Zpanic_abort_tests`, it's sometimes desirable to fall back to the old behavior of only running tests in-process. This comes in handy if the system process launcher is unavailable, or the test code somehow expects all tests to be run in the same process.

For example, in Fuchsia we have unit tests that actually test the process launcher itself, in which case we can't use the process launcher to run the tests :).

r? @alexcrichton
cc @cramertj,@petrhosek

4 years agoRollup merge of #66407 - JohnTitor:add-ice-tests, r=Centril
Mazdak Farrokhzad [Fri, 15 Nov 2019 17:01:59 +0000 (18:01 +0100)]
Rollup merge of #66407 - JohnTitor:add-ice-tests, r=Centril

Add more tests for fixed ICEs

Closes #36122 (fixed in 1.20.0)
Closes #58094 (fixed in #66054)
Also, fix mistaken test case, from #30904 to #30906 (cc @eddyb)

r? @Centril

4 years agoRollup merge of #66350 - hermitcore:hermit, r=rkruppe
Mazdak Farrokhzad [Fri, 15 Nov 2019 17:01:58 +0000 (18:01 +0100)]
Rollup merge of #66350 - hermitcore:hermit, r=rkruppe

protect creation of destructors by a mutex

- add on HermitCore an additional lock to protect static data

4 years agoApply suggestions from code review
Nadrieril [Fri, 15 Nov 2019 17:00:38 +0000 (17:00 +0000)]
Apply suggestions from code review

4 years agoAdd regression test
Nadrieril [Tue, 12 Nov 2019 13:24:04 +0000 (13:24 +0000)]
Add regression test

4 years agoApply suggestions from code review
Nadrieril [Tue, 12 Nov 2019 13:23:27 +0000 (13:23 +0000)]
Apply suggestions from code review

4 years agoFactor out IntRange::is_subrange
Nadrieril [Tue, 12 Nov 2019 13:03:05 +0000 (13:03 +0000)]
Factor out IntRange::is_subrange

4 years agoApply suggestions from code review
Nadrieril Feneanar [Tue, 12 Nov 2019 11:47:34 +0000 (12:47 +0100)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoAdd test for failing `try_eval_bits`
Nadrieril [Tue, 12 Nov 2019 09:42:31 +0000 (09:42 +0000)]
Add test for failing `try_eval_bits`

4 years agoRemove fishy condition
Nadrieril [Sat, 9 Nov 2019 21:46:46 +0000 (21:46 +0000)]
Remove fishy condition

That condition was leftover from a refactor, and was probably not
intended. In fact it can't trigger: it would require a ConstantValue of
an integral type for which `try_eval_bits` fails. But since we only
apply `subtract_ctors` to the output of `all_ctors`, this won't happen.

4 years agoMalformed range patterns can't happen thanks to E0030
Nadrieril [Sat, 9 Nov 2019 21:42:02 +0000 (21:42 +0000)]
Malformed range patterns can't happen thanks to E0030

4 years agoRemove unnecessary data from ConstantValue/ConstantRange
Nadrieril [Sat, 9 Nov 2019 21:11:59 +0000 (21:11 +0000)]
Remove unnecessary data from ConstantValue/ConstantRange

4 years agoStore Const directly in ConstantRange
Nadrieril [Sat, 9 Nov 2019 21:09:12 +0000 (21:09 +0000)]
Store Const directly in ConstantRange

4 years agoMake should_treat_range_exhaustively a method
Nadrieril [Sat, 9 Nov 2019 21:06:41 +0000 (21:06 +0000)]
Make should_treat_range_exhaustively a method

4 years agoInline now-trivial IntRange::from_ctor
Nadrieril [Sat, 9 Nov 2019 21:01:26 +0000 (21:01 +0000)]
Inline now-trivial IntRange::from_ctor

4 years agoFactor out getting the boundaries of an `IntRange`
Nadrieril [Sat, 9 Nov 2019 20:59:10 +0000 (20:59 +0000)]
Factor out getting the boundaries of an `IntRange`

4 years agoEagerly convert ranges to IntRange
Nadrieril [Sat, 9 Nov 2019 13:35:04 +0000 (13:35 +0000)]
Eagerly convert ranges to IntRange

That way no `ConstantRange` or `ConstantValue` ever needs to be
converted to `IntRange`.

4 years agoAdd `IntRange::to_pat` and use it instead of custom `display()`
Nadrieril [Sat, 9 Nov 2019 12:01:47 +0000 (12:01 +0000)]
Add `IntRange::to_pat` and use it instead of custom `display()`

4 years agoFix nll test
Yuki Okushi [Fri, 15 Nov 2019 16:40:59 +0000 (01:40 +0900)]
Fix nll test

4 years agoformatting
Nadrieril [Fri, 15 Nov 2019 16:39:56 +0000 (16:39 +0000)]
formatting

4 years agoIntroduce IntRange constructor
Nadrieril [Fri, 15 Nov 2019 16:39:31 +0000 (16:39 +0000)]
Introduce IntRange constructor

4 years ago`Constructor::display` was only needed for displaying `IntRange`
Nadrieril [Sat, 9 Nov 2019 10:31:53 +0000 (10:31 +0000)]
`Constructor::display` was only needed for displaying `IntRange`

I'm planning to stop using `ConstantRange`/`ConstantValue` for integral
types, so going through `Constructor` will soon not be relevant.

4 years agoAvoid converting through Constructor when subtracting ranges
Nadrieril [Sat, 9 Nov 2019 10:03:18 +0000 (10:03 +0000)]
Avoid converting through Constructor when subtracting ranges

4 years agoSpecial-case subtracting from a range if that range is not an IntRange
Nadrieril [Sat, 9 Nov 2019 09:43:15 +0000 (09:43 +0000)]
Special-case subtracting from a range if that range is not an IntRange

4 years agoPrefer IntRange::into_ctor to range_to_ctor
Nadrieril [Thu, 7 Nov 2019 20:03:50 +0000 (20:03 +0000)]
Prefer IntRange::into_ctor to range_to_ctor

4 years agoMove range exhaustiveness check to IntRange::intersection
Nadrieril [Thu, 7 Nov 2019 19:46:14 +0000 (19:46 +0000)]
Move range exhaustiveness check to IntRange::intersection

Only IntRange should need to worry about range exhaustiveness really.

4 years agoSpecial-case range inclusion when the range is integral but non-exhaustive
Nadrieril [Thu, 7 Nov 2019 18:52:13 +0000 (18:52 +0000)]
Special-case range inclusion when the range is integral but non-exhaustive

4 years agoCleanup `constructor_covered_by_range`
Nadrieril [Thu, 7 Nov 2019 19:15:59 +0000 (19:15 +0000)]
Cleanup `constructor_covered_by_range`

4 years agoIntRange::from_pat is redundant with pat_constructors
Nadrieril [Thu, 7 Nov 2019 18:37:10 +0000 (18:37 +0000)]
IntRange::from_pat is redundant with pat_constructors

4 years ago`pat_constructor` does not need `pcx` anymore
Nadrieril [Thu, 7 Nov 2019 18:27:50 +0000 (18:27 +0000)]
`pat_constructor` does not need `pcx` anymore

4 years agoFactor out range construction in `all_constructors`
Nadrieril [Thu, 7 Nov 2019 18:06:48 +0000 (18:06 +0000)]
Factor out range construction in `all_constructors`

4 years agoClarify conditions for exhaustive integer range matching
Nadrieril [Thu, 7 Nov 2019 17:29:56 +0000 (17:29 +0000)]
Clarify conditions for exhaustive integer range matching

4 years agoNote link between apply/specialize/arity functions
Nadrieril [Thu, 7 Nov 2019 12:09:05 +0000 (12:09 +0000)]
Note link between apply/specialize/arity functions

4 years agomore comment
Ralf Jung [Fri, 15 Nov 2019 14:57:01 +0000 (15:57 +0100)]
more comment

4 years agoApply suggestion from Centril
Yuki Okushi [Thu, 14 Nov 2019 09:14:45 +0000 (18:14 +0900)]
Apply suggestion from Centril

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoFix test case and issue number
Yuki Okushi [Thu, 14 Nov 2019 08:56:36 +0000 (17:56 +0900)]
Fix test case and issue number

4 years agoAdd test for issue-58094
Yuki Okushi [Thu, 14 Nov 2019 07:51:11 +0000 (16:51 +0900)]
Add test for issue-58094

4 years agoAdd test for issue-36122
Yuki Okushi [Thu, 14 Nov 2019 07:50:32 +0000 (16:50 +0900)]
Add test for issue-36122

4 years agoImprove error message for tests with panic=abort
Tyler Mandry [Thu, 14 Nov 2019 15:26:41 +0000 (07:26 -0800)]
Improve error message for tests with panic=abort

4 years agoAdd --force-run-in-process unstable libtest option
Tyler Mandry [Thu, 14 Nov 2019 15:26:22 +0000 (07:26 -0800)]
Add --force-run-in-process unstable libtest option

4 years agoMove JSON emitter to rustc_errors
Mark Rousskov [Thu, 14 Nov 2019 22:24:44 +0000 (17:24 -0500)]
Move JSON emitter to rustc_errors

4 years agoRemove SourceMapper trait
Mark Rousskov [Fri, 15 Nov 2019 13:32:31 +0000 (08:32 -0500)]
Remove SourceMapper trait

SourceMap is now in the root of all rustc-specific crates, syntax_pos,
so there's no need for the trait object to decouple the dependencies
between librustc_errors and libsyntax as was needed previously.

4 years agoAuto merge of #66449 - tmandry:rollup-3p1t0sb, r=tmandry
bors [Fri, 15 Nov 2019 13:45:25 +0000 (13:45 +0000)]
Auto merge of #66449 - tmandry:rollup-3p1t0sb, r=tmandry

Rollup of 4 pull requests

Successful merges:

 - #66197 (Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering)
 - #66429 (Add a regression test for #62524)
 - #66435 (Correct `const_in_array_repeat_expressions` feature name)
 - #66443 (Port erased cleanup)

Failed merges:

r? @ghost

4 years agoRollup merge of #66443 - GuillaumeGomez:port-erased-cleanup, r=Mark-Simulacrum
Tyler Mandry [Fri, 15 Nov 2019 13:44:52 +0000 (14:44 +0100)]
Rollup merge of #66443 - GuillaumeGomez:port-erased-cleanup, r=Mark-Simulacrum

Port erased cleanup

Just realised that the changes I made in #65965 were removed after the move of all error codes so here it is. I made them into separate commits to make the history look better this time.

r? @Mark-Simulacrum

4 years agoRollup merge of #66435 - JohnTitor:fix-spelling, r=Centril
Tyler Mandry [Fri, 15 Nov 2019 13:44:50 +0000 (14:44 +0100)]
Rollup merge of #66435 - JohnTitor:fix-spelling, r=Centril

Correct `const_in_array_repeat_expressions` feature name

Fixes #66433

r? @estebank

4 years agoRollup merge of #66429 - guanqun:add-unit-test, r=Centril
Tyler Mandry [Fri, 15 Nov 2019 13:44:48 +0000 (14:44 +0100)]
Rollup merge of #66429 - guanqun:add-unit-test, r=Centril

Add a regression test for #62524

Closes #62524

4 years agoRollup merge of #66197 - Centril:transparent-ast, r=varkor
Tyler Mandry [Fri, 15 Nov 2019 13:44:47 +0000 (14:44 +0100)]
Rollup merge of #66197 - Centril:transparent-ast, r=varkor

Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering

We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions.  This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported.

r? @varkor

4 years agoMove SourceMap to syntax_pos
Mark Rousskov [Fri, 15 Nov 2019 13:27:09 +0000 (08:27 -0500)]
Move SourceMap to syntax_pos

This does not update the use sites or delete the now unnecessary
SourceMapper trait, to allow git to interpret the file move as a rename
rather than a new file.

4 years agoMove FatalError to syntax_pos
Mark Rousskov [Thu, 14 Nov 2019 19:01:03 +0000 (14:01 -0500)]
Move FatalError to syntax_pos

This is a bit unfortunate, but code needs to be able to fatally error
early on (in particular, syntax_pos after we move SourceMap there). It's
also a tiny bit of code, which means it's ultimately not that bad.

4 years agoClean up E0025, E0034, E0044, E0046 and E0053
Guillaume Gomez [Fri, 15 Nov 2019 12:05:21 +0000 (13:05 +0100)]
Clean up E0025, E0034, E0044, E0046 and E0053

4 years agoClean up E0054
Guillaume Gomez [Fri, 15 Nov 2019 12:21:50 +0000 (13:21 +0100)]
Clean up E0054

4 years agoClean up E0050
Guillaume Gomez [Fri, 15 Nov 2019 12:20:17 +0000 (13:20 +0100)]
Clean up E0050

4 years agoClean up E0049
Guillaume Gomez [Fri, 15 Nov 2019 12:19:34 +0000 (13:19 +0100)]
Clean up E0049

4 years agoClean up E0045
Guillaume Gomez [Fri, 15 Nov 2019 12:18:05 +0000 (13:18 +0100)]
Clean up E0045

4 years agoClean up E0040
Guillaume Gomez [Fri, 15 Nov 2019 12:16:47 +0000 (13:16 +0100)]
Clean up E0040

4 years agoClean up E0033
Guillaume Gomez [Fri, 15 Nov 2019 12:15:05 +0000 (13:15 +0100)]
Clean up E0033

4 years agoClean up E0029
Guillaume Gomez [Fri, 15 Nov 2019 12:14:10 +0000 (13:14 +0100)]
Clean up E0029

4 years agoClean up E0027
Guillaume Gomez [Fri, 15 Nov 2019 12:13:18 +0000 (13:13 +0100)]
Clean up E0027

4 years agoClean up E0026
Guillaume Gomez [Fri, 15 Nov 2019 12:09:46 +0000 (13:09 +0100)]
Clean up E0026

4 years agoAdd link to error code explanation RFC
Guillaume Gomez [Fri, 15 Nov 2019 12:07:37 +0000 (13:07 +0100)]
Add link to error code explanation RFC

4 years agofind_deprecation: deprecation attr may be ill-formed meta.
Mazdak Farrokhzad [Wed, 13 Nov 2019 18:32:12 +0000 (19:32 +0100)]
find_deprecation: deprecation attr may be ill-formed meta.

4 years agoClean up E0023
Guillaume Gomez [Fri, 15 Nov 2019 12:04:52 +0000 (13:04 +0100)]
Clean up E0023

4 years agolibpanic_unwind for Miri: make sure we have the SEH lang items when needed
Ralf Jung [Fri, 15 Nov 2019 10:52:46 +0000 (11:52 +0100)]
libpanic_unwind for Miri: make sure we have the SEH lang items when needed