Commit Graph

86733 Commits

Author SHA1 Message Date
ljedrz
cf4f5c3b34 hir: simplify a match expression 2018-11-13 17:35:56 +01:00
ljedrz
3d919297b9 hir: remove an unused type alias 2018-11-13 17:35:25 +01:00
ljedrz
5ea0e0d1aa hir: simplify fmt::Debug for hir::Path 2018-11-13 17:34:51 +01:00
ljedrz
58a2267c15 hir: remove an unused hir_vec macro pattern 2018-11-13 17:34:17 +01:00
cynecx
2f7b95d932 Change sidebar selector to fix compatibility with docs.rs 2018-11-13 17:23:30 +01:00
bors
5c9f7dcd83 Auto merge of #55649 - scalexm:chalk-bound-ty, r=nikomatsakis
Use bound types in `librustc_traits`

r? @nikomatsakis
see the tests which now move the higher-ranked binders to the left in implied bound rules!
2018-11-13 12:22:30 +00:00
scalexm
8d0b9697b5 Fix ui tests 2018-11-13 12:28:43 +01:00
scalexm
afa884c03a Instantiate all bound vars existentially 2018-11-13 12:28:43 +01:00
scalexm
79b6c41bc2 Use a dummy outlives requirement for where Type:, (see #53696)
A `WF(Type)` predicate was used previously, which did not play
well with implied bounds in chalk.
2018-11-13 12:28:43 +01:00
scalexm
156a932eef Reorder code in rustc::traits::structural_impls 2018-11-13 12:28:43 +01:00
scalexm
239df7be37 Bypass ppaux for Outlives predicates 2018-11-13 12:28:43 +01:00
scalexm
3510805f7e Provide program clauses for builtin types 2018-11-13 12:28:43 +01:00
scalexm
79ba84fa79 Adjust documentation 2018-11-13 12:28:43 +01:00
scalexm
eacebf24b0 Pretty print quantified goals and clauses 2018-11-13 12:28:43 +01:00
scalexm
64aac8d4c1 Replace type params with bound vars in rustc_traits::lowering 2018-11-13 12:28:43 +01:00
kennytm
7921572acf
Rollup merge of #55722 - RalfJung:impl-stable-hash, r=varkor
impl_stable_hash_for: support enums and tuple structs with generic parameters

Port a bunch of implementations over to the macro, now that that is possible.
2018-11-13 19:22:53 +08:00
kennytm
2173681647
Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavus
Remove short doc where it starts with a codeblock

Fixes #54975.
2018-11-13 19:21:09 +08:00
kennytm
8a13ae5fce
Rollup merge of #55908 - KWierso:patch-1, r=wesleywiser
Fix their/there grammar nit
2018-11-13 19:21:06 +08:00
kennytm
64ea02a9dd
Rollup merge of #55905 - nnethercote:short_name-to-literal_name, r=Mark-Simulacrum
Change `Lit::short_name` to `Lit::literal_name`.

This avoids a moderately hot allocation in `parse_lit_token`.

r? @Mark-Simulacrum
2018-11-13 19:21:01 +08:00
kennytm
4d764407e9
Rollup merge of #55896 - rust-lang:opt-fuse, r=shepmaster
Document optimizations enabled by FusedIterator

When reading this I wondered what “some significant optimizations” referred to. As far as I can tell from reading code, the specialization of `.fuse()` is the only case where `FusedIterator` has any impact at all. Is this accurate @Stebalien?
2018-11-13 19:20:58 +08:00
kennytm
99986a5a05
Rollup merge of #55889 - RalfJung:global-alloc, r=alexcrichton
global allocators: add a few comments

These comments answer some questions that came up when I tried to understand how the control flow works for the global allocator, `Global` and `System`.

r? @alexcrichton
2018-11-13 19:20:57 +08:00
kennytm
c246a29813
Rollup merge of #55888 - RalfJung:alloc-extra, r=oli-obk
miri: for uniformity, also move memory_deallocated to AllocationExtra

r? @oli-obk
2018-11-13 19:20:55 +08:00
kennytm
675c95c7b8
Rollup merge of #55882 - hugwijst:rc_return_crate_inherent_impls, r=Mark-Simulacrum
Reference count `crate_inherent_impls`s return value.

The repeated cloning of the result in `inherent_impls` queries has quite
an impact on crates with many inherent trait implementations.

For instance on https://github.com/jmesmon/stm32f429, `cargo check` went from 75 seconds to 38 seconds on my machine.
2018-11-13 19:20:53 +08:00
kennytm
a2774354ee
Rollup merge of #55879 - Xanewok:dont-panic-with-globs, r=nrc
save-analysis: Don't panic for macro-generated use globs

Follow-up to c2bb7cadf2 - as before, ignore the use globs in macro expansions.

Fixes https://github.com/rust-lang-nursery/rls/issues/1117.
Closes #55480.

r? @nrc
2018-11-13 19:20:51 +08:00
kennytm
5134d9cc18
Rollup merge of #55874 - denisvasilik:docs, r=alexcrichton
string: Add documentation for `From` impls

Hi this is part of #51430. I'm a first time contributor, so I started with a small task adding a bit of documentation for From impls.
2018-11-13 19:20:48 +08:00
kennytm
5ccc76fe5c
Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiser
Fix typos.
2018-11-13 19:20:44 +08:00
kennytm
910289c9da
Rollup merge of #55863 - dwijnand:patch-1, r=bluss
Fix a typo in std::panic
2018-11-13 19:20:40 +08:00
kennytm
828dd17a91
Rollup merge of #55858 - GuillaumeGomez:fixes-rustdoc-codeblocks, r=QuietMisdreavus
Small fixes on code blocks in rustdoc

It currently has a little margin issue with the `i` and there were js errors.

r? @QuietMisdreavus
2018-11-13 19:20:37 +08:00
kennytm
196db96d8b
Rollup merge of #55843 - Axary:master, r=sfackler
add FromIterator<A> to Box<[A]>
2018-11-13 19:20:35 +08:00
kennytm
5b572fb840
Rollup merge of #55840 - dlrobertson:fix_stage0_download, r=alexcrichton
Fix TLS errors when downloading stage0

While attempting to test #49878 on Windows I hit the following error when attempting to download stage0.

```
The request was aborted: Could not create SSL/TLS secure channel
```

Instead of using the shell, we can just use `urllib`, which seems to fix the issue.
2018-11-13 19:20:33 +08:00
kennytm
f73df10c39
Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, r=eddyb
Make PhantomData #[structural_match]

fixes https://github.com/rust-lang/rust/issues/55028

This makes `PhantomData<T>` structurally matchable, irrespective of whether `T` is, per the discussion on this week's language team meeting (the general consensus was that this was a bug-fix).

All types containing `PhantomData<T>` and which used `#[derive(PartialEq, Eq)]` and were previously not `#[structural_match]` only because of `PhantomData<T>` will now be `#[structural_match]`.

r? @nikomatsakis
2018-11-13 19:20:30 +08:00
kennytm
98bc7d63fb
Rollup merge of #55805 - nnethercote:mv-static_assert, r=Mark-Simulacrum
Move `static_assert!` into librustc_data_structures
2018-11-13 19:20:28 +08:00
kennytm
d811f844a5
Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelix
rustdoc: don't inline `pub use some_crate` unless directly asked to

cc https://github.com/rust-lang/rust/issues/52509 (fixes it? i'm not sure about my comment summoning the docs team)

When rustdoc encounters a `pub use` statement for an item from another crate, it will eagerly inline its contents into your crate. This somewhat clashes with the new paths behavior in Rust 2018, in which crates are implicitly linked and re-exported with `pub use` instead of `pub extern crate`. In rust 2015, `pub extern crate` would only create a single line for its re-export in the docs, so i'm making it do the same with `pub use some_crate;`.

The exact new behavior is like this: *If rustdoc sees a `pub use` statement, and the item being imported is the root of another crate, it will only inline it if `#[doc(inline)]` is provided.* I made it only avoid crate roots because otherwise it would stop inlining any module, which may or may not be what people want.
2018-11-13 19:20:25 +08:00
Meltinglava
8b750a77fc The example values are now easyer to differenciate 2018-11-13 12:20:23 +01:00
kennytm
a8bcf612d5
Rollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcrichton
Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err

r? @nikomatsakis
2018-11-13 19:20:18 +08:00
kennytm
e9bd1f21ec
Rollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrum
Format BtreeMap::range_mut example

Before:
![image](https://user-images.githubusercontent.com/16046705/48049184-36517780-e1e1-11e8-8da2-a3ae858d5a76.png)
After:
![image](https://user-images.githubusercontent.com/16046705/48049210-45382a00-e1e1-11e8-87b3-84ae60ef798e.png)
2018-11-13 19:20:13 +08:00
Olivier Goffart
562be7e1a1 Forward the ABI of the non-zero sized fields of an union if they have the same ABI
This is supposed to fix the performence regression of using MaybeUninit in
https://github.com/rust-lang/rust/pull/54668
2018-11-13 11:24:00 +01:00
ljedrz
0c08529934 A few tweaks to iterations/collecting 2018-11-13 08:42:48 +01:00
bors
485397e49a Auto merge of #55589 - oli-obk:min_length_💣, r=pnkfelix
Add `VariantIdx` type and use instead of `usize`
2018-11-13 07:04:14 +00:00
KWierso
533d26f875
Fix their/there grammar nit 2018-11-12 18:21:52 -08:00
bors
c4371c854f Auto merge of #55052 - newpavlov:patch-2, r=alexcrichton
Use read_unaligned instead of read in transmute_copy

Closes: #55044

This change could result in performance regression on non-x86 platforms. (but it also can fix some of UB which lurks in existing programs) An alternative would be to update `transmute_copy` documentation with alignment requirements.
2018-11-13 01:08:13 +00:00
Nicholas Nethercote
2bd4d5b1a0 Move two static_assert!s to better spots.
And make them x86_64-only so they can use `==` instead of `<=`.
2018-11-13 11:30:43 +11:00
Nicholas Nethercote
fb3dd9f64e Add a static assertion about the size of ast::Expr. 2018-11-13 06:37:16 +11:00
Nicholas Nethercote
49f482f537 Move a static_assert! to a better spot.
And make it x86_64-only so it can use `==` instead of `<=`.
2018-11-13 06:36:35 +11:00
Nicholas Nethercote
ab8a947fa0 Move static_assert! into librustc_data_structures.
This means it can be used by more crates.
2018-11-13 06:21:57 +11:00
bors
65204a97d4 Auto merge of #55278 - Centril:constification-1, r=alexcrichton
Minor standard library constification

This PR makes some bits of the standard library into `const fn`s.
I've tried to be as aggressive as I possibly could in the constification.
The list is rather small due to how restrictive `const fn` is at the moment.

r? @oli-obk cc @rust-lang/libs

Stable public APIs affected:
+ [x] `Cell::as_ptr`
+ [x] `UnsafeCell::get`
+ [x] `char::is_ascii`
+ [x] `iter::empty`
+ [x] `ManuallyDrop::{new, into_inner}`
+ [x] `RangeInclusive::{start, end}`
+ [x] `NonNull::as_ptr`
+ [x] `{[T], str}::as_ptr`
+ [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}`
+ [x] `CStr::as_ptr`
+ [x] `Ipv4Addr::is_unspecified`
+ [x] `Ipv6Addr::new`
+ [x] `Ipv6Addr::octets`

Unstable public APIs affected:
+ [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}`
+ [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}`
+ [x] `core::convert::identity`

--------------------------

## Removed from list in first pass:

Stable public APIs affected:
+ [ ] `BTree{Map, Set}::{len, is_empty}`
+ [ ] `VecDeque::is_empty`
+ [ ] `String::{is_empty, len}`
+ [ ] `FromUtf8Error::utf8_error`
+ [ ] `Vec<T>::{is_empty, len}`
+ [ ] `Layout::size`
+ [ ] `DecodeUtf16Error::unpaired_surrogate`
+ [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}`
+ [ ] `panic::Location::{file, line, column}`
+ [ ] `{ChunksExact, RChunksExact}::remainder`
+ [ ] `Utf8Error::valid_up_to`
+ [ ] `VacantEntry::key`
+ [ ] `NulError::nul_position`
+ [ ] `IntoStringError::utf8_error`
+ [ ] `IntoInnerError::error`
+ [ ] `io::Chain::get_ref`
+ [ ] `io::Take::{limit, get_ref}`
+ [ ] `SocketAddrV6::{flowinfo, scope_id}`
+ [ ] `PrefixComponent::{kind, as_os_str}`
+ [ ] `Path::{ancestors, display}`
+ [ ] `WaitTimeoutResult::timed_out`
+ [ ] `Receiver::{iter, try_iter}`
+ [ ] `thread::JoinHandle::thread`
+ [ ] `SystemTimeError::duration`

Unstable public APIs affected:
+ [ ] `core::fmt::Arguments::new_v1`
+ [ ] `core::fmt::Arguments::new_v1_formatted`
+ [ ] `Pin::{get_ref, into_ref}`
+ [ ] `Utf8Lossy::chunks`
+ [ ] `LocalWaker::as_waker`
+ [ ] `panic::PanicInfo::{internal_constructor, message, location}`
+ [ ] `panic::Location::{internal_constructor }`

## Removed from list in 2nd pass:

Stable public APIs affected:
+ [ ] `LinkedList::{new, iter, is_empty, len}`
+ [ ] `mem::forget`
+ [ ] `Cursor::{new, get_ref, position}`
+ [ ] `io::{empty, repeat, sink}`
+ [ ] `PoisonError::new`
+ [ ] `thread::Builder::new`
+ [ ] `process::Stdio::{piped, inherit, null}`

Unstable public APIs affected:
+ [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12 18:54:11 +00:00
Stjepan Glavina
56d3a824e4 Update docs 2018-11-12 18:36:49 +01:00
Stjepan Glavina
4d2934e803 Add forget_unsized only 2018-11-12 17:19:59 +01:00
Oliver Scherer
d46a2078b4 Deduplicate field and variant visitor methods 2018-11-12 14:24:45 +01:00
Oliver Scherer
b174b0b955 miri-engine value visitor update to VariantIdx 2018-11-12 14:24:45 +01:00