Commit Graph

109703 Commits

Author SHA1 Message Date
Nicholas Nethercote
a90661a780 Use a SmallVec for Cache::predecessors.
This is a very small win.
2020-04-07 15:12:50 +10: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
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
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
Linus Färnstrand
28c9231a91 Make libcore float constant examples similar to libstd 2020-04-05 12:20:27 +02:00
Linus Färnstrand
daf8afdc85 Remove more std::f32 imports in libstd 2020-04-05 12:20:27 +02:00
Ralf Jung
e52a451913 fix comment 2020-04-05 12:11:33 +02:00
Ralf Jung
6cbe1726a7 clarify safety in RawVec::into_box 2020-04-05 12:09:03 +02:00
Ralf Jung
315a3b96a4 add test 2020-04-05 11:56:02 +02:00
Ralf Jung
05a5895f0d miri assignment check: compare types after normalizing all late-bound regions away 2020-04-05 11:55:52 +02:00
bors
607b858236 Auto merge of #70803 - arlosi:hash-regression, r=eddyb
Fix performance regression in debuginfo file_metadata.

Fixes performance regression caused by #69718.

Finding the `SourceFile` associated with a `FileName` called `get_source_file` on the `SourceMap`, which does a linear search through all files in the `SourceMap`.

This resolves the issue by passing the `SourceFile` in from the caller (which already had it available) instead of the `FileName`

Fixes #70785.
2020-04-05 09:50:30 +00:00
Linus Färnstrand
d06b26fb6c Stop importing the float modules. Use assoc consts 2020-04-05 11:30:25 +02:00
Linus Färnstrand
101085ad9f Stop importing integer modules in libstd 2020-04-05 11:22:01 +02:00
Linus Färnstrand
d0fc5d9e6b Stop importing int module in float parse test 2020-04-05 11:22:01 +02:00
Linus Färnstrand
d7f8928efd Stop importing int modules in librustdoc 2020-04-05 11:22:01 +02:00
Linus Färnstrand
bc8d6c1b33 Stop importing int/float modules in libserialize 2020-04-05 11:22:01 +02:00
Linus Färnstrand
fcf45999f7 Stop importing int/float modules in librustc_* 2020-04-05 11:22:01 +02:00
Linus Färnstrand
a88b36b93b Stop importing int/float modules in libcore 2020-04-05 11:22:01 +02:00
Linus Färnstrand
fff4f08398 Stop importing integer modules in liballoc 2020-04-05 11:22:01 +02:00
Arlo Siemsen
4cdceda5a3 Fix performance regression in debuginfo file_metadata.
Finding the `SourceFile` associated with a `FileName` called `get_source_file` on
the `SourceMap`, which does a linear search through all files in the `SourceMap`.

This resolves the issue by passing the SourceFile in from the caller (which already
had it available).
2020-04-05 01:43:44 -07:00
Ralf Jung
7e81c11aa8 tweak swap_remove 2020-04-05 08:40:40 +02:00
bors
7b657d340d Auto merge of #70800 - Dylan-DPC:rollup-9jjoptp, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #70635 (rustc_target: Some cleanup to `no_default_libraries`)
 - #70748 (Do not disable field reordering on enums with big discriminant)
 - #70752 (Add slice::fill)
 - #70766 (use ManuallyDrop instead of forget inside collections)
 - #70768 (macro_rules: `NtLifetime` cannot start with an identifier)
 - #70783 (comment refers to removed type)

Failed merges:

r? @ghost
2020-04-05 06:22:35 +00:00
Aaron Hill
63d6ef65af
Query-ify Instance::resolve 2020-04-05 01:21:36 -04:00