Commit Graph

87910 Commits

Author SHA1 Message Date
Vadim Petrochenkov
37af04ff8d Address review comments and CI failures 2018-12-27 15:51:37 +03:00
Vadim Petrochenkov
15cefe4b2a Make sure feature gate errors are recoverable 2018-12-27 15:51:37 +03:00
Vadim Petrochenkov
b99fb2f544 Fix trace_macros and log_syntax 2018-12-27 15:51:36 +03:00
Vadim Petrochenkov
4ac592516f Get rid of Block::recovered 2018-12-27 15:51:36 +03:00
Vadim Petrochenkov
fff01ccfa8 Do not abort compilation if expansion produces errors
Fix a number of uncovered deficiencies in diagnostics
2018-12-27 15:51:36 +03:00
Vadim Petrochenkov
a5c52c72ae AST/HIR: Introduce ExprKind::Err for better error recovery in the front-end 2018-12-27 15:51:36 +03:00
bors
d174173552 Auto merge of #57133 - SimonSapin:zero, r=oli-obk
Remove the private generic NonZero<T> wrapper type

Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly on relevant libcore types.
2018-12-27 12:01:08 +00:00
csmoe
8d77c7c037 retrieve ty info from place_ty
describe index with _
2018-12-27 17:25:45 +08:00
bors
d2986970ad Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett
Add `io` and `arch` modules to `std::os::fortanix_sgx`

This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target.

### io
`io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`.

### arch
`arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.
2018-12-27 09:21:06 +00:00
bors
39bc8f5899 Auto merge of #57129 - RalfJung:check-bounds, r=oli-obk
make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead

r? @oli-obk
2018-12-27 06:48:18 +00:00
kennytm
854abd319e
Added a job to dry-run the publish_toolstate.py once 2018-12-27 13:57:29 +08:00
Esteban Küber
5e952e3479 Add span label to unused string formatting argument
Fix #55350.
2018-12-26 20:36:02 -08:00
Esteban Küber
5e75001c59 Point at correct span for arguments in format strings
When a format string has escaped whitespace characters format
arguments were shifted by one per each escaped character. Account
for these escaped characters when synthesizing the spans.

Fix #55155.
2018-12-26 20:36:02 -08:00
bors
a1bad57fa5 Auto merge of #57069 - estebank:str-err, r=@cramertj
Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

```
error: invalid format string: expected `'}'`, found `'t'`
  --> $DIR/ifmt-bad-arg.rs:85:1
   |
LL | ninth number: {
   |               - because of this opening brace
LL | tenth number: {}",
   | ^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
```

Fix #53837.
2018-12-27 02:00:17 +00:00
Esteban Küber
862ebc4c38 Various changes to string format diagnostics
- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests
2018-12-26 14:29:43 -08:00
bors
79bbce488e Auto merge of #57124 - sunjay:stable_duration_as_u128, r=Centril
Stabilize Duration::{as_millis, as_micros, as_nanos}

Fixes #50202. 🎉

This is the stabilization PR for the `duration_as_u128` feature. I have never made one of these before so please let me know if I missed a step. I followed the [guide in the Rust Forge](https://forge.rust-lang.org/stabilization-guide.html) and also found some old stabilization PRs ([1](https://github.com/rust-lang/rust/pull/57002), [2](https://github.com/rust-lang/rust/pull/56207)) for similar features to base my work on.
2018-12-26 22:19:40 +00:00
Alexander Regueiro
5adf8c358a Changed resolution of enum variants to low priority. 2018-12-26 21:56:47 +00:00
Alexander Regueiro
ab239f37aa Minor cosmetic changes 2018-12-26 21:56:42 +00:00
Alexander Regueiro
87532e99e5 Minor clean-up 2018-12-26 21:54:18 +00:00
Alexander Regueiro
67a30d2d70 Fixed ICE when type arguments are specified on Self type. 2018-12-26 21:54:18 +00:00
Alexander Regueiro
6a3f96d302 Fixed type inference for tuple struct variants. 2018-12-26 21:54:18 +00:00
Alexander Regueiro
fa07e62389 Fixed handling of unit variants of aliased enums in type NS. 2018-12-26 21:54:18 +00:00
Alexander Regueiro
8eb1a9e4e7 Added regression test for using generic parameters on modules. 2018-12-26 21:54:18 +00:00
Alexander Regueiro
5a36f9e6e1 Fixed several ICEs. 2018-12-26 21:40:22 +00:00
Alexander Regueiro
65f50582cf Removed unnecessary special handling of VariantCtor defs in instantiate_value_path. 2018-12-26 21:40:22 +00:00
Alexander Regueiro
37e7f0a629 Expanded tests for enum variants with generic args. 2018-12-26 21:40:22 +00:00
Alexander Regueiro
66409e0334 Fixed issues raised in review. 2018-12-26 21:40:22 +00:00
Alexander Regueiro
248dbbdffa Added tests for enums & enum aliases with various combinations of generic args. 2018-12-26 21:40:22 +00:00
Alexander Regueiro
edabad64b0 Work-around for shadowing of variant names with assoc const names in libproc_macro/bridge/rpc.rs. 2018-12-26 21:40:21 +00:00
Alexander Regueiro
6a2a7edc0b Fixed issues raised in first review. 2018-12-26 21:40:21 +00:00
Alexander Regueiro
74f233388a Added chapter to Unstable Book. 2018-12-26 21:40:21 +00:00
Alexander Regueiro
58a5756f4d Fixed more tests. 2018-12-26 21:40:21 +00:00
Alexander Regueiro
b9326f75fb Fixed tests. 2018-12-26 21:27:08 +00:00
Alexander Regueiro
767ffced91 Made suggestion diagnostics more consistent for enum variant names, relative to method names. 2018-12-26 21:27:08 +00:00
Alexander Regueiro
ecacad0770 Added tests for feature. 2018-12-26 21:27:08 +00:00
Alexander Regueiro
c77fdbf2eb Implemented variants on type aliases in both ctor and pattern position. 2018-12-26 21:27:08 +00:00
Alexander Regueiro
1b150c4043 Store Ident rather than just Name in HIR types Item and ForeignItem. 2018-12-26 21:26:37 +00:00
Taylor Cramer
11f4d3e40e Add Unpin to std prelude, not just core 2018-12-26 12:20:38 -08:00
Simon Sapin
7a09115280 Remove the private generic NonZero<T> wrapper type.
Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly
on relevant libcore types.
2018-12-26 20:54:10 +01:00
bors
a7be40c65a Auto merge of #56534 - xfix:copied, r=@SimonSapin
Add unstable Iterator::copied()

Initially suggested at https://github.com/bluss/rust-itertools/pull/289, however the maintainers of itertools suggested this may be better of in a standard library.

The intent of `copied` is to avoid accidentally cloning iterator elements after doing a code refactoring which causes a structure to be no longer `Copy`. This is a relatively common pattern, as it can be seen by calling `rg --pcre2 '[.]map[(][|](?:(\w+)[|] [*]\1|&(\w+)[|] \2)[)]'` on Rust main repository. Additionally, many uses of `cloned` actually want to simply `Copy`, and changing something to be no longer copyable may introduce unnoticeable performance penalty.

Also, this makes sense because the standard library includes `[T].copy_from_slice` to pair with `[T].clone_from_slice`.

This also adds `Option::copied`, because it makes sense to pair it with `Iterator::copied`. I don't think this feature is particularly important, but it makes sense to update `Option` along with `Iterator` for consistency.
2018-12-26 19:39:19 +00:00
Sunjay Varma
1e82618613 Stabilize duration_as_u128 2018-12-26 12:12:06 -07:00
bors
79d8a0fcef Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
Remove header licenses across the project

This pull request removes the header licenses from files across the Rust repository.

I've attempted to check for any remaining headers and removed all of them -- any we've missed can be removed in the future; there's nothing blocking that.

Unfortunately, not all of the changes are as basic as "removing a header" because some of them required test file updates or otherwise. However, I am fairly confident that the changes in this pull request, while wide-sweeping, are unlikely to actually make any tests fail to properly test the code; any non-script based changes were manual and carefully verified.

r? @pietroalbini cc @rust-lang/infra
2018-12-26 16:16:02 +00:00
Mark Rousskov
e132d9066d Account for no newline before test annotations
Previously the license comment would always provide that newline but
since that's been removed this change is needed.
2018-12-26 09:00:55 -07:00
Ralf Jung
fd69e6e910 make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead 2018-12-26 13:18:24 +01:00
Konrad Borowski
315401ddf8 Add a tracking issue for Iterator::copied 2018-12-26 10:13:44 +01:00
Konrad Borowski
2fcdc9c15d Add a tracking issue for Option::copied 2018-12-26 10:13:02 +01:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
bors
14b96659e4 Auto merge of #57088 - euclio:non-camel-case-early-lint, r=estebank
make non_camel_case_types an early lint

This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.
2018-12-25 16:12:24 +00:00
bors
27a25df2e2 Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelix
address some FIXME whose associated issues were marked as closed

part of #44366
2018-12-25 13:32:31 +00:00
bors
27c4335287 Auto merge of #56983 - ljedrz:parallel_query_tweaks, r=Zoxc
Parallel query tweaks

- faster stack reversal in `remove_cycle`
- insert visited queries more eagerly
- simplify stack trimming in `cycle_check`
- minor refactoring in 2 spots
2018-12-25 10:52:13 +00:00