Commit Graph

109731 Commits

Author SHA1 Message Date
Josh Stone
e8339e820b Use split_at in slice's ToOwned::clone_into
It appears to codegen slightly more efficiently with `split_at` taking
two slices at once, rather than slicing across different calls.
2020-04-06 15:50:59 -07:00
bors
6dee5f1126 Auto merge of #70573 - IgorPerikov:issue#70524_detailed_panic_messages, r=LukasKalbertodt
Detailed panic messages for Vec functions

pass indexes to insert, remove, drain, and split_off panic messages

closes #70524
2020-04-06 18:14:49 +00:00
IgorPerikov
9fc77c0e15 add detailed panic messages for Vec functions 2020-04-06 17:53:56 +03:00
bors
40158901d5 Auto merge of #70737 - Centril:cleanup-lower-item-id, r=estebank
cleanup `lower_item_id`

r? @oli-obk
2020-04-06 14:43:52 +00:00
bors
bd18bc9a4c Auto merge of #70771 - RalfJung:ctfe-loop, r=oli-obk
Miri terminator handling: only do progress sanity check for 'Call' terminator

This will still catch mistakes in bad intrinsic/foreign-item shims, which is the main source of errors here.

Fixes https://github.com/rust-lang/rust/issues/70723
r? @oli-obk
2020-04-06 11:32:33 +00:00
bors
733f104f13 Auto merge of #70833 - RalfJung:rustc-layout, r=Centril
tweak rustc_layout debug output

As suggested by r? @eddyb @Centril
2020-04-06 08:12:30 +00:00
Ralf Jung
83fb0b1e8c tweak rustc_layout debug output 2020-04-06 09:22:48 +02:00
bors
af89eb5e5b Auto merge of #70832 - Centril:rollup-ixc09ve, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #70519 (Tweak output of type params and constraints in the wrong order)
 - #70704 (Make panic unwind the default for aarch64-*-windows-msvc targets)
 - #70713 (Prefer sysroot from rustc in same directory as rust-gdb)
 - #70739 (def_collector, visit_fn: account for no body)
 - #70827 (Use smaller span for suggestion restricting lifetime)

Failed merges:

r? @ghost
2020-04-06 02:25:08 +00:00
Mazdak Farrokhzad
3faec69865
Rollup merge of #70827 - estebank:shorten-sugg-span-add-lt, r=ecstatic-morse
Use smaller span for suggestion restricting lifetime
2020-04-06 04:24:21 +02:00
Mazdak Farrokhzad
17fa3440d2
Rollup merge of #70739 - Centril:fix-70736, r=petrochenkov
def_collector, visit_fn: account for no body

Fixes #70736

r? @petrochenkov
2020-04-06 04:24:20 +02:00
Mazdak Farrokhzad
4911d168d8
Rollup merge of #70713 - jsgf:rust-gdb-rustc, r=Mark-Simulacrum
Prefer sysroot from rustc in same directory as rust-gdb

If there isn't a rustc in the same directory, then fall back to searching
the path.
2020-04-06 04:24:18 +02:00
Mazdak Farrokhzad
da87316970
Rollup merge of #70704 - danielframpton:aarch64-windows-panic-unwind-default, r=alexcrichton
Make panic unwind the default for aarch64-*-windows-msvc targets

With the llvm fixes from rust-lang/llvm-project#45 (included as a submodule change) we can enable unwinding by default for these targets.

Fixes #65313

There are still a small number of test failures for which we can open individual issues.

r? @alexcrichton
2020-04-06 04:24:16 +02:00
Mazdak Farrokhzad
eea91c308f
Rollup merge of #70519 - estebank:constraints-before-args-spans, r=Centril
Tweak output of type params and constraints in the wrong order

r? @Centril @varkor
2020-04-06 04:24:15 +02:00
Esteban Küber
17a95232b3 Reduce the visual clutter
Using a single label for constraints and generic arguments.
2020-04-05 17:03:20 -07:00
Esteban Küber
c9f55ea689 review comments: use partition_map 2020-04-05 17:03:15 -07:00
Esteban Küber
0664b81915 Use smaller span for suggestion restricting lifetime 2020-04-05 16:16:55 -07:00
bors
83f8c02eb9 Auto merge of #70826 - Centril:rollup-yn0hc1h, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #70553 (move OS constants to platform crate)
 - #70665 (Do not lose or reorder user-provided linker arguments)
 - #70750 (Match options directly in the Fuse implementation)
 - #70782 (Stop importing the float modules in documentation)
 - #70798 ("cannot resolve" → "cannot satisfy")
 - #70808 (Simplify dtor registration for HermitCore by using a list of destructors)
 - #70824 (Remove marker comments in libstd/lib.rs macro imports)

Failed merges:

r? @ghost
2020-04-05 23:08:44 +00:00
Mazdak Farrokhzad
23acf87fa0
Rollup merge of #70824 - yoshuawuyts:fix-labels-in-std-macro-imports, r=Mark-Simulacrum
Remove marker comments in libstd/lib.rs macro imports

These comments were probably moved around when rustfmt was introduced. They don't correctly denote what they were intended for, so I propose we remove them instead. Thanks!
2020-04-06 00:53:51 +02:00
Mazdak Farrokhzad
534f8dadb3
Rollup merge of #70808 - hermitcore:tls, r=dtolnay
Simplify dtor registration for HermitCore by using a list of destructors

The implementation is similar to the macOS version and doesn't depend on additional OS support
2020-04-06 00:53:50 +02:00
Mazdak Farrokhzad
e1b380a675
Rollup merge of #70798 - estebank:satisfy, r=Centril
"cannot resolve" → "cannot satisfy"

CC #66523

r? @Centril
2020-04-06 00:53:48 +02:00
Mazdak Farrokhzad
269eeea15d
Rollup merge of #70782 - faern:use-assoc-float-consts, r=dtolnay
Stop importing the float modules in documentation

Follow up to #69860. I realized I had not searched for and fixed this for the float values. So with this PR they also use the associated constants instead of the module level constants.

For the documentation where it also was using the `consts` submodule I opted to change it to import that directly. This becomes more in line with how other docs that use the `consts` submodule looks. And it also makes it so there are not two `f32` or `f64` things in the current namespace (both the module and the primitive type) and then hopefully confusing documentation readers less.

r? @dtolnay
2020-04-06 00:53:47 +02:00
Mazdak Farrokhzad
618ba73b31
Rollup merge of #70750 - cuviper:direct-fuse, r=scottmcm
Match options directly in the Fuse implementation

Rather than using `as_ref()`, `as_mut()`, and `?`, we can use `match` directly to save a lot of generated code. This was mentioned as a possibility in https://github.com/rust-lang/rust/pull/70366#issuecomment-603462546, and I found that it had a very large impact on #70332 using `Fuse` within `Chain`. Let's evaluate this change on its own first.
2020-04-06 00:53:45 +02:00
Mazdak Farrokhzad
aafbe07af3
Rollup merge of #70665 - petrochenkov:linkargs, r=nagisa
Do not lose or reorder user-provided linker arguments

Linker arguments are potentially order-dependent, so the order in which `-C link-arg` and `-C link-args` options are passed to `rustc` should be preserved when they are passed further to the linker.

Also, multiple `-C link-args` options are now appended to each other rather than overwrite each other.

In other words, `-C link-arg=a -C link-args="b c" -C link-args="d e" -C link-arg=f` is now passed as `"a" "b" "c" "d" "e" "f"` and not as `"d" "e" "a" "f"`.

Addresses https://github.com/rust-lang/rust/pull/70505#issuecomment-606780163.
2020-04-06 00:53:43 +02:00
Mazdak Farrokhzad
be93b1cdc5
Rollup merge of #70553 - hermitcore:abi, r=dtolnay
move OS constants to platform crate

to reduce platform specific constants move O_RDONLY etc. and the definition of thread priorities to hermit-abi
2020-04-06 00:53:42 +02:00
Yoshua Wuyts
004ce25ec0 Remove labels in libstd/lib.rs macro imports
These labels were probably moved around when rustfmt was introduced.
2020-04-05 22:30:25 +02:00
bors
b543afca9b Auto merge of #70816 - Dylan-DPC:rollup-kzcs8px, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #67797 (Query-ify Instance::resolve)
 - #70777 (Don't import integer and float modules, use assoc consts)
 - #70795 (Keep track of position when deleting from a BTreeMap)
 - #70812 (Do not use "nil" to refer to `()`)
 - #70815 (Enable layout debugging for `impl Trait` type aliases)

Failed merges:

r? @ghost
2020-04-05 19:31:14 +00:00
Ralf Jung
e92bde373a make set_span public, as all the fields it touches are public already 2020-04-05 19:28:28 +02:00
Ralf Jung
43cdfbb3fe set span more accurately during const_prop 2020-04-05 19:28:28 +02:00
Ralf Jung
fb9b693acc Miri engine: use span_bug in a few places 2020-04-05 19:27:01 +02:00
Ralf Jung
0ad3b1c9bf add test 2020-04-05 19:23:35 +02:00
Ralf Jung
a524a9af91 Miri terminator handling: only do progress sanity check for 'Call' terminator 2020-04-05 19:23:35 +02:00
Esteban Küber
0cd4c89366 "cannot resolve" → "cannot satisfy" 2020-04-05 10:14:04 -07:00
Dylan DPC
8c081f69fb
Rollup merge of #70815 - RalfJung:layout-debug, r=jonas-schievink
Enable layout debugging for `impl Trait` type aliases

I also made it print the actual type name that the alias picks under the hood.
2020-04-05 18:47:50 +02:00
Dylan DPC
4827aa6034
Rollup merge of #70812 - rossmacarthur:fix/unit-called-nil, r=LukasKalbertodt
Do not use "nil" to refer to `()`

"nil" is not used in the [book](https://doc.rust-lang.org/book) or in the [standard library](https://doc.rust-lang.org/std) anywhere else. Because "nil" is often used in programming languages to refer to "None" or "null" I think it could be a little confusing for newcomers to see this type referred to as "nil".
2020-04-05 18:47:48 +02:00
Dylan DPC
2ec0e148f1
Rollup merge of #70795 - Amanieu:btree_remove_tracking, r=Mark-Simulacrum
Keep track of position when deleting from a BTreeMap

This improves the performance of drain_filter and is needed for future Cursor support for BTreeMap.

cc @ssomers
r? @Mark-Simulacrum
2020-04-05 18:47:47 +02:00
Dylan DPC
c2595539e7
Rollup merge of #70777 - faern:use-assoc-int-consts2, r=dtolnay
Don't import integer and float modules, use assoc consts

Stop importing the standard library integer and float modules to reach the `MIN`, `MAX` and other constants. They are available directly on the primitive types now.

This PR is a follow up of #69860 which made sure we use the new constants in documentation.

This type of change touches a lot of files, and previously all my assoc int consts PRs had collisions and were accepted only after a long delay. So I'd prefer to do it in smaller steps now. Just removing these imports seem like a good next step.

r? @dtolnay
2020-04-05 18:47:45 +02:00
Dylan DPC
829154f980
Rollup merge of #67797 - Aaron1011:feature/instance-query, r=nikomatsakis
Query-ify Instance::resolve

Split off from #65989

Instance::resolve is now a wrapper for a new `resolve_instance` query.
This greatly improves performance on several benchmarks
2020-04-05 18:47:44 +02:00
bors
6387b09153 Auto merge of #70809 - matthiaskrgr:submodule_upd, r=Mark-Simulacrum
submodules: update clippy from 326b2204 to 7907abea

Changes:
````
Rustup to rust-lang/rust#70634
Update clippy_lints/src/types.rs
Update types.rs
Update types.rs
Improve docs for option_option
useless Rc<Rc<T>>, Rc<Box<T>>, Rc<&T>, Box<&T>
Allow let_underscore
Update option_option ui test
Test for ignoring let_underscore_must_use
Downgrade option_option to pedantic
````

Fixes #70709
2020-04-05 16:13:44 +00:00
Ralf Jung
8f6c109371 also print type type 2020-04-05 17:13:30 +02:00
Ralf Jung
4a75883a78 also print rustc_layout on impl trait type aliases 2020-04-05 17:07:06 +02:00
Amanieu d'Antras
51357cf1cd Apply review feedback 2020-04-05 14:29:00 +01:00
bors
e6cef04457 Auto merge of #70807 - Dylan-DPC:rollup-qd1kgl2, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #70558 (Fix some aliasing issues in Vec)
 - #70760 (docs: make the description of Result::map_or more clear)
 - #70769 (Miri: remove an outdated FIXME)
 - #70776 (clarify comment in RawVec::into_box)
 - #70806 (fix Miri assignment sanity check)

Failed merges:

r? @ghost
2020-04-05 13:00:36 +00:00
Ross MacArthur
bc26f58521
Do not use "nil" to refer to () 2020-04-05 14:30:13 +02:00
Matthias Krüger
04a38e7e1b submodules: update clippy from 326b2204 to 7907abea
Changes:
````
Rustup to rust-lang/rust#70634
Update clippy_lints/src/types.rs
Update types.rs
Update types.rs
Improve docs for option_option
useless Rc<Rc<T>>, Rc<Box<T>>, Rc<&T>, Box<&T>
Allow let_underscore
Update option_option ui test
Test for ignoring let_underscore_must_use
Downgrade option_option to pedantic
````

Fixes #70709
2020-04-05 13:50:21 +02:00
Stefan Lankes
935683bd9c Simplify dtor registration for HermitCore by using a list of destructors
The implementation is similiar to macOS solution doesn't
depend on additional OS support
2020-04-05 13:41:17 +02:00
Amanieu d'Antras
7365748c0c Keep track of position when deleting from a BTreeMap
This improves the performance of drain_filter and is needed for
future Cursor support for BTreeMap.
2020-04-05 12:18:46 +01:00
Dylan DPC
31b8d65803
Rollup merge of #70806 - RalfJung:miri-assignment-check, r=eddyb
fix Miri assignment sanity check

Thanks @eddyb for pointing me to the right APIs!

r? @eddyb
Fixes https://github.com/rust-lang/rust/issues/70804
2020-04-05 13:13:14 +02:00
Dylan DPC
c185c4fe47
Rollup merge of #70776 - RalfJung:raw-vec, r=Dylan-DPC,TimDiekmann
clarify comment in RawVec::into_box

On first reading I almost thought "len <= cap" would be all that there is to check here. Expand the comment to clarify that that is not the case.
2020-04-05 13:13:13 +02:00
Dylan DPC
2448a23554
Rollup merge of #70769 - RalfJung:fixed, r=Dylan-DPC
Miri: remove an outdated FIXME

We even [have a test ](49dc2f9f09/src/test/ui/consts/miri_unleashed/drop.rs) making sure that we detect dropping with a non-const implementation.

r? @oli-obk
2020-04-05 13:13:11 +02:00
Dylan DPC
6f595e8713
Rollup merge of #70760 - PonasKovas:docs, r=Dylan-DPC
docs: make the description of Result::map_or more clear

The documentation of [`Result::map_or`](https://doc.rust-lang.org/std/result/enum.Result.html#method.map_or) is very unclear and confusing, probably because it was copied straight from [`Option::map_or`](https://doc.rust-lang.org/std/option/enum.Option.html#method.map_or) and someone forgot to adapt it for Result.
2020-04-05 13:13:10 +02:00