Commit Graph

93498 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
f9d65c000d
Rollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril
Test interaction of unions with non-zero/niche-filling optimization

Notably this nails down part of the behavior that MaybeUninit assumes, e.g. that a Option<MaybeUninit<&u8>> does not take advantage of non-zero optimization, and thus is a safe construct.

It also verifies the status quo: that even unions that could theoretically take advantage of niches don't. (relevant: https://github.com/rust-lang/rust/issues/36394)
2019-05-20 01:01:37 +02:00
bors
a5000c5098 Auto merge of #60272 - Jakst:patch-1, r=Manishearth
Explicitly set height on rust logo <img> element in docs

The layout of the left side menu in docs reflows when navigating between pages because of missing height on the <img> element of rust logo.

Setting height='100' tells the browser to reserve that vertical space, leading to a less janky experience.
2019-05-19 21:36:15 +00:00
Wesley Wiser
ec853ba026 [const-prop] Don't const-prop into terminators unless mir-opt-level >= 2 2019-05-19 16:47:03 -04:00
Wesley Wiser
2baab0eaaa [const-prop] Remove catch all match and add FIXME 2019-05-19 16:47:03 -04:00
Wesley Wiser
3f5c743b53 [const-prop] Support propagating into SwitchInt's discr Operand 2019-05-19 16:46:51 -04:00
Wesley Wiser
8e99c76089 [const-prop] Support propagating into Assert's cond Operand 2019-05-19 16:13:08 -04:00
bors
6afcb56285 Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27
rustdoc: set the default edition when pre-parsing a doctest

Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point)

When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block.

This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`)

I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.
2019-05-19 16:48:12 +00:00
VeryTastyTomato
a759565763
Fix data types indication
Fix the data types indication in basic examples of the Trait std::fmt::LowerExp and std::fmt::UpperExp.
Since there aren’t any type annotation on the let statement using the number 42.0, they are of type f64 according to The Book:
https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types
2019-05-19 13:51:46 +00:00
Taiki Endo
3e73ca6e33 Move run-pass/self/* to ui/self 2019-05-19 22:17:12 +09:00
Matthew Jasper
6bb3980e7a Stop using gensyms in HIR lowering
These names aren't ever handled by resolve, so there's no reason to
make them gensyms.
2019-05-19 13:00:28 +01:00
bors
e7591c1ae5 Auto merge of #60946 - Xanewok:update-rls, r=oli-obk
Update RLS

Includes a fix (https://github.com/rust-lang/rls/pull/1462) for breakage due to Cargo update PR (https://github.com/rust-lang/rust/pull/60874)

r? @Manishearth @oli-obk @ehuss
2019-05-19 11:51:34 +00:00
Vadim Petrochenkov
88fa5c6a45 Improve type size assertions
Now they
- Tell what the new size is, when it changes
- Do not require passing an identifier
2019-05-19 13:59:44 +03:00
bors
ce41e48362 Auto merge of #60937 - RalfJung:miri, r=oli-obk
update Miri

r? @oli-obk
2019-05-19 08:56:24 +00:00
bors
e0d2f7462b Auto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboy
Fix display of const generics in rustdoc

<img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png">

Part of #60737.

cc @varkor

r? @badboy
2019-05-19 06:06:12 +00:00
Taiki Endo
b53d839b23 Move arbitrary_self_types's tests into ui/self 2019-05-19 12:31:08 +09:00
David Tolnay
ea7aa76911
Document BinaryHeap time complexity
I went into some detail on the time complexity of `push` because it is
relevant for using BinaryHeap efficiently -- specifically that you
should avoid pushing many elements in ascending order when possible.
2019-05-18 20:25:24 -07:00
Peter Todd
a91ad60158
Make clear that status quo ≠ guarantee 2019-05-18 22:27:33 -04:00
bors
26ab32499c Auto merge of #60949 - Centril:rollup-f918e1v, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #60370 (Mark core::alloc::Layout::from_size_align_unchecked const)
 - #60678 (Stabilize vecdeque_rotate)
 - #60924 (Explain that ? converts the error type using From)
 - #60931 (Use iter() for iterating arrays by slice)
 - #60934 (Declare DefIndex with the newtype_index macro)
 - #60943 (fix copy-paste typo in docs for ptr::read_volatile)
 - #60945 (Simplify BufRead::fill_buf doc example using NLL)
 - #60947 (Fix typos in docs of GlobalAlloc)

Failed merges:

r? @ghost
2019-05-19 01:56:14 +00:00
Mazdak Farrokhzad
9389c69415
Rollup merge of #60947 - blkerby:global_alloc_typo, r=jonas-schievink
Fix typos in docs of GlobalAlloc
2019-05-19 02:31:46 +02:00
Mazdak Farrokhzad
f9d58c7188
Rollup merge of #60945 - blkerby:fill_buf_nll_doc_example, r=shepmaster
Simplify BufRead::fill_buf doc example using NLL

With non-lexical lifetimes, in this example it is no longer necessary to use a block to end the borrow early.
2019-05-19 02:31:44 +02:00
Mazdak Farrokhzad
94da30728f
Rollup merge of #60943 - blkerby:master, r=Mark-Simulacrum
fix copy-paste typo in docs for ptr::read_volatile
2019-05-19 02:31:43 +02:00
Mazdak Farrokhzad
7cbca5931e
Rollup merge of #60934 - fabric-and-ink:defindex_with_newtype_macro, r=petrochenkov
Declare DefIndex with the newtype_index macro

See #60666
2019-05-19 02:31:42 +02:00
Mazdak Farrokhzad
de39eb81ed
Rollup merge of #60931 - cuviper:array-iter, r=KodrAus
Use iter() for iterating arrays by slice

These `into_iter()` calls will change from iterating references to
values if we ever get `IntoIterator` for arrays, which may break the
code using that iterator. Calling `iter()` is future proof.
2019-05-19 02:31:40 +02:00
Mazdak Farrokhzad
80d372f7cd
Rollup merge of #60924 - estebank:try-msg, r=petrochenkov
Explain that ? converts the error type using From

Fix #60917.
2019-05-19 02:31:39 +02:00
Mazdak Farrokhzad
dc7cbb697b
Rollup merge of #60678 - DutchGhost:master, r=scottmcm
Stabilize vecdeque_rotate

This PR stabilizes the vecdeque_rotate feature.
r? @scottmcm

Closes https://github.com/rust-lang/rust/issues/56686
2019-05-19 02:31:35 +02:00
Mazdak Farrokhzad
7885dfc623
Rollup merge of #60370 - Richard-W:const-layout-construction, r=sfackler
Mark core::alloc::Layout::from_size_align_unchecked const

Makes it possible (pending stabilization of #57563 (`const_fn`)) to rewrite code like

```rust
const BUFFER_SIZE: usize = 0x2000;
const BUFFER_ALIGN: usize = 0x1000;

fn foo() {
  let layout = std::alloc::Layout::from_size_align(BUFFER_SIZE, BUFFER_ALIGN)
    .unwrap();
  let buffer = std::alloc::alloc(layout);
}
```
to
```rust
const BUFFER_LAYOUT: std::alloc::Layout = unsafe {
  std::alloc::Layout::from_size_align_unchecked(0x2000, 0x1000)
};

fn foo() {
  let buffer = std::alloc::alloc(BUFFER_LAYOUT);
}
```

which (although `unsafe` is used) looks somewhat cleaner and is easier to read.
2019-05-19 02:31:32 +02:00
Brent Kerby
86cda2d48e Fix typos in docs of GlobalAlloc 2019-05-18 16:22:59 -06:00
Igor Matuszewski
8d419588f1 Reverse RLS toolstate check override
As per https://github.com/rust-lang/rust/pull/60946#issuecomment-493707005
2019-05-19 00:00:12 +02:00
Igor Matuszewski
1c939a3e55 Update RLS 2019-05-18 22:54:33 +02:00
bors
963184bbb6 Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
Fix attrs pos

Fixes #60042.

Screenshot:

<img width="438" alt="Screenshot 2019-05-12 at 15 02 25" src="https://user-images.githubusercontent.com/3050060/57582606-1455ec00-74c7-11e9-9d4e-5ec4da4de7dd.png">

r? @rust-lang/rustdoc
2019-05-18 20:49:22 +00:00
Brent Kerby
01cf36ebde Simplify BufRead doc example using NLL 2019-05-18 13:30:44 -06:00
bors
0f40ad9990 Auto merge of #60940 - Manishearth:clippyup, r=Manishearth
Update clippy

Contains https://github.com/rust-lang/rust-clippy/pull/4110

Should fix RLS

r? @ghost
2019-05-18 17:57:55 +00:00
Brent Kerby
13a00963a6
fix copy-paste typo in docs for ptr::read_volatile 2019-05-18 10:03:12 -06:00
bjorn3
cb0039e3b7 Misc changes to rustc_metadata 2019-05-18 17:51:12 +02:00
Manish Goregaokar
0789091a68 Update clippy 2019-05-18 08:32:50 -07:00
bors
9a9df55f07 Auto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrum
Don't suggest changing extern crate w/ alias to use.

Fixes #57672.
2019-05-18 15:07:38 +00:00
Guillaume Gomez
2caeaf54a1 Fix display of const generics in rustdoc 2019-05-18 15:44:19 +02:00
Ralf Jung
5f5e30fd54 update miri 2019-05-18 14:40:53 +02:00
Ralf Jung
a226b53b58 expand comment in StorageLive 2019-05-18 14:40:53 +02:00
Fabian Drinck
b18de52080 Declare DefIndex with the newtype_index macro 2019-05-18 13:19:33 +02:00
Guillaume Gomez
606377740b Fix tests not running locally 2019-05-18 12:45:29 +02:00
Guillaume Gomez
c78af2bc60 Update rustdoc-ui tests 2019-05-18 12:45:29 +02:00
Guillaume Gomez
b5d4bd2a07 Fix lints handling in rustdoc 2019-05-18 12:45:29 +02:00
bors
b8aa422a78 Auto merge of #60386 - Goirad:sgx-ignore-tests, r=nikomatsakis
Added ignore-sgx for appropriate tests in src/test

These are all the tests that make sense to ignore when targeting fortanix-unknonw-sgx, at least in test/runpass. Other suites not yet covered.
2019-05-18 09:04:14 +00:00
chandde
759921e2a0 fix line length 2019-05-18 00:49:54 -07:00
chandde
70f78b3f8c optimize the arm64 OR arm32 check 2019-05-17 20:45:25 -07:00
Josh Stone
90dd35918d Use iter() for iterating arrays by slice
These `into_iter()` calls will change from iterating references to
values if we ever get `IntoIterator` for arrays, which may break the
code using that iterator. Calling `iter()` is future proof.
2019-05-17 19:56:35 -07:00
bors
548add7f61 Auto merge of #60910 - nnethercote:avoid-some-unnecessary-interning, r=petrochenkov
Avoid some unnecessary interning

r? @petrochenkov
2019-05-18 02:10:21 +00:00
bors
a614cee22e Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, r=nikomatsakis
lint: convert incoherent_fundamental_impls into hard error

*Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version:
- gtk-rs: upgrade to at least 0.4
- rusqlite: upgrade to at least 0.14
- nalgebra: upgrade to at least 0.15, or the last patch version of 0.14
- spade: upgrade or refresh the Cargo.lock file to use version 1.7
- imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra)

implement #46205

r? @nikomatsakis
2019-05-17 23:06:51 +00:00
bors
73a3a90d25 Auto merge of #60920 - Manishearth:rollup-p4xp4gk, r=Manishearth
Rollup of 4 pull requests

Successful merges:

 - #60791 (Update books)
 - #60891 (Allow claiming issues with triagebot)
 - #60901 (Handle more string addition cases with appropriate suggestions)
 - #60902 (Prevent Error::type_id overrides)

Failed merges:

r? @ghost
2019-05-17 20:02:13 +00:00