Commit Graph

110046 Commits

Author SHA1 Message Date
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
Tomasz Miąsko
c8b83babf3 Keep codegen units unmerged when building compiler builtins 2020-04-06 00:00:00 +00:00
Tomasz Miąsko
d2b75586fc Move sanitize-inline-always test to sanitize directory 2020-04-06 00:00:00 +00:00
Jonas Schievink
dec90784ac Add some comments and rename variable 2020-04-06 01:52:51 +02: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
Jonas Schievink
60e9927125 Merge redundant match arms 2020-04-06 01:07:33 +02: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
Jonas Schievink
9dd18a31e2 Move closure check upwards 2020-04-06 00:53:16 +02:00
Jonas Schievink
87d859af24 Don't lint for self-recursion when the function can diverge 2020-04-06 00:53:16 +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
Roland Kuhn
2275b875c2 expose suggestions::InferCtxtExt for clippy 2020-04-05 19:25:32 +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
Camille GILLOT
802c0be3a2 Fix test. 2020-04-05 15:26:09 +02:00
Camille GILLOT
587b9abd4e Retire rustc::ty::Attributes enum. 2020-04-05 15:26:09 +02:00
Camille GILLOT
81f0e90c62 Remove unneeded Lrc in query results. 2020-04-05 15:26:09 +02:00
Camille GILLOT
5e1ad0d1e4 Remove Arcs in queries. 2020-04-05 15:21:08 +02:00
Camille GILLOT
3c0edc895f Allocate query Vecs on the arena. 2020-04-05 15:02:00 +02: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
Dylan DPC
7e4ed72d64
Rollup merge of #70558 - RalfJung:vec-extend-aliasing, r=Amanieu
Fix some aliasing issues in Vec

`Vec::extend` and `Vec::truncate` invalidated references into the vector even without reallocation, because they (implicitly) created a mutable reference covering the *entire* initialized part of the vector.

Fixes https://github.com/rust-lang/rust/issues/70301
I verified the fix by adding some new tests here that I ran in Miri.
2020-04-05 13:13:08 +02:00