Commit Graph

88171 Commits

Author SHA1 Message Date
Sean Griffin
1cd1ddbbaa
Fix typo in pin documentation
Affect is a verb, effect is a noun
2018-12-27 08:53:43 -07:00
bors
f2b92174e3 Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis
Call poly_project_and_unify_type on types that contain inference types

Commit f57247c48c (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).

This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.

Fixes #56822
2018-12-27 14:35:58 +00:00
Ralf Jung
c118b17953 use a better way to get at the type parameter 2018-12-27 14:25:05 +01:00
Vadim Petrochenkov
bc16edeb28 Fix rebase and more CI failures 2018-12-27 15:51:37 +03:00
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
Ralf Jung
fff905bc69 panic when calling MaybeUninhabited::into_inner on uninhabited type 2018-12-27 13:04:53 +01: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
David Wood
fcad209449
Add closure cannot be moved note.
This commit extends existing logic for checking whether a closure that
is `FnOnce` and therefore moves variables that it captures from the
environment has already been invoked when being invoked again.

Now, this logic will also check whether the closure is being moved after
previously being moved or invoked and add an appropriate note.
2018-12-26 21:55:45 +01: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