]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUse assoc integer constants in libserialize
Linus Färnstrand [Mon, 6 Apr 2020 21:09:17 +0000 (23:09 +0200)]
Use assoc integer constants in libserialize

4 years agolinker: Factor out more parts of `linker_with_args` and add some docs
Vadim Petrochenkov [Sun, 5 Apr 2020 22:33:03 +0000 (01:33 +0300)]
linker: Factor out more parts of `linker_with_args` and add some docs

4 years agolinker: Add more markup and comments to code producing linker arguments
Vadim Petrochenkov [Sun, 5 Apr 2020 15:10:55 +0000 (18:10 +0300)]
linker: Add more markup and comments to code producing linker arguments

4 years agolinker: Factor out addition of pre-, post- and late link args
Vadim Petrochenkov [Sun, 5 Apr 2020 14:31:29 +0000 (17:31 +0300)]
linker: Factor out addition of pre-, post- and late link args

4 years agoRollup merge of #70859 - tmiasko:move-sanitize-inline-always, r=jonas-schievink
Dylan DPC [Mon, 6 Apr 2020 22:31:43 +0000 (00:31 +0200)]
Rollup merge of #70859 - tmiasko:move-sanitize-inline-always, r=jonas-schievink

Move sanitize-inline-always test to sanitize directory

4 years agoRollup merge of #70839 - GuillaumeGomez:cleanup-e0506, r=Dylan-DPC
Dylan DPC [Mon, 6 Apr 2020 22:31:41 +0000 (00:31 +0200)]
Rollup merge of #70839 - GuillaumeGomez:cleanup-e0506, r=Dylan-DPC

clean up E0506 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70821 - rkuhn:expose_suggestions_InferCtxtExt, r=eddyb
Dylan DPC [Mon, 6 Apr 2020 22:31:39 +0000 (00:31 +0200)]
Rollup merge of #70821 - rkuhn:expose_suggestions_InferCtxtExt, r=eddyb

expose suggestions::InferCtxtExt for clippy

This is very useful to do good async/await diagnostic reporting, for example for https://github.com/rust-lang/rust-clippy/pull/5423.

4 years agoRollup merge of #70690 - GuillaumeGomez:cleanup-e0501, r=Dylan-DPC
Dylan DPC [Mon, 6 Apr 2020 22:31:38 +0000 (00:31 +0200)]
Rollup merge of #70690 - GuillaumeGomez:cleanup-e0501, r=Dylan-DPC

Clean up E0501 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70612 - Thomasdezeeuw:issue_70436, r=LukasKalbertodt
Dylan DPC [Mon, 6 Apr 2020 22:31:36 +0000 (00:31 +0200)]
Rollup merge of #70612 - Thomasdezeeuw:issue_70436, r=LukasKalbertodt

Add io::Write::write_all_vectored

Similar to io::Write::write_all but uses io::Write::write_vectored
instead.

Updates #70436

/cc @cramertj @sfackler

4 years agolinker: Factor out linking of pre- and post-link objects
Vadim Petrochenkov [Sun, 5 Apr 2020 14:03:30 +0000 (17:03 +0300)]
linker: Factor out linking of pre- and post-link objects

4 years agolinker: Combine argument building into a single function
Vadim Petrochenkov [Sat, 4 Apr 2020 23:58:32 +0000 (02:58 +0300)]
linker: Combine argument building into a single function

4 years agolinker: Make argument building interface in `trait Linker` richer
Vadim Petrochenkov [Sat, 4 Apr 2020 23:11:29 +0000 (02:11 +0300)]
linker: Make argument building interface in `trait Linker` richer

by redirecting everything to `Command`

4 years agoPut reference to write_vectored in quotes in doc
Thomas de Zeeuw [Mon, 6 Apr 2020 22:00:07 +0000 (00:00 +0200)]
Put reference to write_vectored in quotes in doc

4 years agoDon't import integer module in libstd
Linus Färnstrand [Mon, 6 Apr 2020 21:08:46 +0000 (23:08 +0200)]
Don't import integer module in libstd

4 years agoUse integer assoc consts in libcore
Linus Färnstrand [Mon, 6 Apr 2020 21:08:12 +0000 (23:08 +0200)]
Use integer assoc consts in libcore

4 years agoUse usize::MAX as assoc const in liballoc
Linus Färnstrand [Mon, 6 Apr 2020 21:07:38 +0000 (23:07 +0200)]
Use usize::MAX as assoc const in liballoc

4 years agoStop importing float module in libtest
Linus Färnstrand [Mon, 6 Apr 2020 20:45:44 +0000 (22:45 +0200)]
Stop importing float module in libtest

4 years agoStop importing float module in libserialize
Linus Färnstrand [Mon, 6 Apr 2020 20:45:29 +0000 (22:45 +0200)]
Stop importing float module in libserialize

4 years agoUse assoc float consts in libcore
Linus Färnstrand [Mon, 6 Apr 2020 20:44:51 +0000 (22:44 +0200)]
Use assoc float consts in libcore

4 years agoUse assoc const f32::NAN in liballoc
Linus Färnstrand [Mon, 6 Apr 2020 20:44:04 +0000 (22:44 +0200)]
Use assoc const f32::NAN in liballoc

4 years agoBump stdarch submodule
Linus Färnstrand [Mon, 6 Apr 2020 20:16:09 +0000 (22:16 +0200)]
Bump stdarch submodule

4 years agoBump rust-by-example submodule
Linus Färnstrand [Mon, 6 Apr 2020 20:14:35 +0000 (22:14 +0200)]
Bump rust-by-example submodule

4 years agoBump nomicon submodule
Linus Färnstrand [Mon, 6 Apr 2020 20:13:31 +0000 (22:13 +0200)]
Bump nomicon submodule

4 years agoty: remove `{Existential,}Trait{Ref,Predicate}::input_types`.
Eduard-Mihai Burtescu [Mon, 23 Mar 2020 04:04:03 +0000 (06:04 +0200)]
ty: remove `{Existential,}Trait{Ref,Predicate}::input_types`.

4 years agoty: remove unnecessary `Predicate::walk_tys` and `collect_regions`.
Eduard-Mihai Burtescu [Mon, 23 Mar 2020 02:07:31 +0000 (04:07 +0200)]
ty: remove unnecessary `Predicate::walk_tys` and `collect_regions`.

4 years agoty: switch `Ty::walk` from `Ty` to `GenericArg`.
Eduard-Mihai Burtescu [Mon, 23 Mar 2020 01:57:04 +0000 (03:57 +0200)]
ty: switch `Ty::walk` from `Ty` to `GenericArg`.

4 years agoty/walk: switch `walk_shallow` from `Ty` to `GenericArg`.
Eduard-Mihai Burtescu [Fri, 20 Mar 2020 05:42:14 +0000 (07:42 +0200)]
ty/walk: switch `walk_shallow` from `Ty` to `GenericArg`.

4 years agotraits/coherence: stop using `Ty::walk_shallow`.
Eduard-Mihai Burtescu [Fri, 20 Mar 2020 03:28:17 +0000 (05:28 +0200)]
traits/coherence: stop using `Ty::walk_shallow`.

4 years agoty/walk: keep track of `GenericArg`s on the stack, instead of `Ty`s.
Eduard-Mihai Burtescu [Thu, 19 Mar 2020 19:15:59 +0000 (21:15 +0200)]
ty/walk: keep track of `GenericArg`s on the stack, instead of `Ty`s.

4 years agoAuto merge of #70573 - IgorPerikov:issue#70524_detailed_panic_messages, r=LukasKalbertodt
bors [Mon, 6 Apr 2020 18:14:49 +0000 (18:14 +0000)]
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

4 years agoBTreeMap first/last: add pop methods
Stein Somers [Sun, 5 Apr 2020 16:56:07 +0000 (18:56 +0200)]
BTreeMap first/last: add pop methods

4 years agoBTreeMap first/last: make examples more to the point
Stein Somers [Mon, 6 Apr 2020 17:03:18 +0000 (19:03 +0200)]
BTreeMap first/last: make examples more to the point

4 years agoBTreeMap first/last: simplify implementations
Stein Somers [Sat, 4 Apr 2020 18:32:07 +0000 (20:32 +0200)]
BTreeMap first/last: simplify implementations

4 years agoClean up E0501 explanation
Guillaume Gomez [Thu, 2 Apr 2020 11:30:19 +0000 (13:30 +0200)]
Clean up E0501 explanation

4 years agoci: move /var/lib/docker to /mnt on GHA
Pietro Albini [Mon, 6 Apr 2020 16:09:08 +0000 (18:09 +0200)]
ci: move /var/lib/docker to /mnt on GHA

There are some builders that are running out of disk space while
building the Docker images, such as arm-android. This moves and symlinks
/var/lib/docker to the /mnt partition on Linux GHA.

4 years agoUpdate src/librustc_trait_selection/traits/error_reporting/suggestions.rs
Roland Kuhn [Mon, 6 Apr 2020 15:04:21 +0000 (17:04 +0200)]
Update src/librustc_trait_selection/traits/error_reporting/suggestions.rs

Co-Authored-By: varkor <github@varkor.com>
4 years agoadd detailed panic messages for Vec functions
IgorPerikov [Mon, 6 Apr 2020 14:53:56 +0000 (17:53 +0300)]
add detailed panic messages for Vec functions

4 years agoadd nested regression test
Niko Matsakis [Mon, 6 Apr 2020 14:51:00 +0000 (14:51 +0000)]
add nested regression test

4 years agoAuto merge of #70737 - Centril:cleanup-lower-item-id, r=estebank
bors [Mon, 6 Apr 2020 14:43:52 +0000 (14:43 +0000)]
Auto merge of #70737 - Centril:cleanup-lower-item-id, r=estebank

cleanup `lower_item_id`

r? @oli-obk

4 years agoclean up E0506 explanation
Guillaume Gomez [Mon, 6 Apr 2020 12:20:01 +0000 (14:20 +0200)]
clean up E0506 explanation

4 years agoAuto merge of #70771 - RalfJung:ctfe-loop, r=oli-obk
bors [Mon, 6 Apr 2020 11:32:33 +0000 (11:32 +0000)]
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

4 years agoImprove io::Write::write_all_vectored docs
Thomas de Zeeuw [Mon, 6 Apr 2020 09:21:15 +0000 (11:21 +0200)]
Improve io::Write::write_all_vectored docs

Also adds some more tests with different length IoSlices.

4 years agoAuto merge of #70833 - RalfJung:rustc-layout, r=Centril
bors [Mon, 6 Apr 2020 08:12:30 +0000 (08:12 +0000)]
Auto merge of #70833 - RalfJung:rustc-layout, r=Centril

tweak rustc_layout debug output

As suggested by r? @eddyb @Centril

4 years agotweak rustc_layout debug output
Ralf Jung [Mon, 6 Apr 2020 07:22:48 +0000 (09:22 +0200)]
tweak rustc_layout debug output

4 years agoAuto merge of #70832 - Centril:rollup-ixc09ve, r=Centril
bors [Mon, 6 Apr 2020 02:25:08 +0000 (02:25 +0000)]
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

4 years agoRollup merge of #70827 - estebank:shorten-sugg-span-add-lt, r=ecstatic-morse
Mazdak Farrokhzad [Mon, 6 Apr 2020 02:24:21 +0000 (04:24 +0200)]
Rollup merge of #70827 - estebank:shorten-sugg-span-add-lt, r=ecstatic-morse

Use smaller span for suggestion restricting lifetime

4 years agoRollup merge of #70739 - Centril:fix-70736, r=petrochenkov
Mazdak Farrokhzad [Mon, 6 Apr 2020 02:24:20 +0000 (04:24 +0200)]
Rollup merge of #70739 - Centril:fix-70736, r=petrochenkov

def_collector, visit_fn: account for no body

Fixes #70736

r? @petrochenkov

4 years agoRollup merge of #70713 - jsgf:rust-gdb-rustc, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 6 Apr 2020 02:24:18 +0000 (04:24 +0200)]
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.

4 years agoRollup merge of #70704 - danielframpton:aarch64-windows-panic-unwind-default, r=alexc...
Mazdak Farrokhzad [Mon, 6 Apr 2020 02:24:16 +0000 (04:24 +0200)]
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

4 years agoRollup merge of #70519 - estebank:constraints-before-args-spans, r=Centril
Mazdak Farrokhzad [Mon, 6 Apr 2020 02:24:15 +0000 (04:24 +0200)]
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

4 years agoReduce the visual clutter
Esteban Küber [Mon, 6 Apr 2020 00:02:44 +0000 (17:02 -0700)]
Reduce the visual clutter

Using a single label for constraints and generic arguments.

4 years agoreview comments: use `partition_map`
Esteban Küber [Sun, 5 Apr 2020 23:34:16 +0000 (16:34 -0700)]
review comments: use `partition_map`

4 years agoKeep codegen units unmerged when building compiler builtins
Tomasz Miąsko [Mon, 6 Apr 2020 00:00:00 +0000 (00:00 +0000)]
Keep codegen units unmerged when building compiler builtins

4 years agoMove sanitize-inline-always test to sanitize directory
Tomasz Miąsko [Mon, 6 Apr 2020 00:00:00 +0000 (00:00 +0000)]
Move sanitize-inline-always test to sanitize directory

4 years agoAdd some comments and rename variable
Jonas Schievink [Sun, 5 Apr 2020 23:52:51 +0000 (01:52 +0200)]
Add some comments and rename variable

4 years agoUse smaller span for suggestion restricting lifetime
Esteban Küber [Sun, 5 Apr 2020 23:16:55 +0000 (16:16 -0700)]
Use smaller span for suggestion restricting lifetime

4 years agoAuto merge of #70826 - Centril:rollup-yn0hc1h, r=Centril
bors [Sun, 5 Apr 2020 23:08:44 +0000 (23:08 +0000)]
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

4 years agoMerge redundant match arms
Jonas Schievink [Sun, 5 Apr 2020 23:07:33 +0000 (01:07 +0200)]
Merge redundant match arms

4 years agoRollup merge of #70824 - yoshuawuyts:fix-labels-in-std-macro-imports, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:51 +0000 (00:53 +0200)]
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!

4 years agoRollup merge of #70808 - hermitcore:tls, r=dtolnay
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:50 +0000 (00:53 +0200)]
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

4 years agoRollup merge of #70798 - estebank:satisfy, r=Centril
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:48 +0000 (00:53 +0200)]
Rollup merge of #70798 - estebank:satisfy, r=Centril

"cannot resolve" → "cannot satisfy"

CC #66523

r? @Centril

4 years agoRollup merge of #70782 - faern:use-assoc-float-consts, r=dtolnay
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:47 +0000 (00:53 +0200)]
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

4 years agoRollup merge of #70750 - cuviper:direct-fuse, r=scottmcm
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:45 +0000 (00:53 +0200)]
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.

4 years agoRollup merge of #70665 - petrochenkov:linkargs, r=nagisa
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:43 +0000 (00:53 +0200)]
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.

4 years agoRollup merge of #70553 - hermitcore:abi, r=dtolnay
Mazdak Farrokhzad [Sun, 5 Apr 2020 22:53:42 +0000 (00:53 +0200)]
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

4 years agoMove closure check upwards
Jonas Schievink [Sun, 5 Apr 2020 19:01:38 +0000 (21:01 +0200)]
Move closure check upwards

4 years agoDon't lint for self-recursion when the function can diverge
Jonas Schievink [Sun, 5 Apr 2020 19:04:31 +0000 (21:04 +0200)]
Don't lint for self-recursion when the function can diverge

4 years agoRemove labels in libstd/lib.rs macro imports
Yoshua Wuyts [Sun, 5 Apr 2020 18:59:10 +0000 (20:59 +0200)]
Remove labels in libstd/lib.rs macro imports

These labels were probably moved around when rustfmt was introduced.

4 years agoAuto merge of #70816 - Dylan-DPC:rollup-kzcs8px, r=Dylan-DPC
bors [Sun, 5 Apr 2020 19:31:14 +0000 (19:31 +0000)]
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

4 years agomake set_span public, as all the fields it touches are public already
Ralf Jung [Sun, 5 Apr 2020 15:37:35 +0000 (17:37 +0200)]
make set_span public, as all the fields it touches are public already

4 years agoset span more accurately during const_prop
Ralf Jung [Sun, 5 Apr 2020 07:27:14 +0000 (09:27 +0200)]
set span more accurately during const_prop

4 years agoMiri engine: use span_bug in a few places
Ralf Jung [Sun, 5 Apr 2020 06:35:31 +0000 (08:35 +0200)]
Miri engine: use span_bug in a few places

4 years agoexpose suggestions::InferCtxtExt for clippy
Roland Kuhn [Sun, 5 Apr 2020 17:25:32 +0000 (19:25 +0200)]
expose suggestions::InferCtxtExt for clippy

4 years agoadd test
Ralf Jung [Sat, 4 Apr 2020 14:57:54 +0000 (16:57 +0200)]
add test

4 years agoMiri terminator handling: only do progress sanity check for 'Call' terminator
Ralf Jung [Sat, 4 Apr 2020 13:53:47 +0000 (15:53 +0200)]
Miri terminator handling: only do progress sanity check for 'Call' terminator

4 years ago"cannot resolve" → "cannot satisfy"
Esteban Küber [Sun, 5 Apr 2020 02:47:50 +0000 (19:47 -0700)]
"cannot resolve" → "cannot satisfy"

4 years agoRollup merge of #70815 - RalfJung:layout-debug, r=jonas-schievink
Dylan DPC [Sun, 5 Apr 2020 16:47:50 +0000 (18:47 +0200)]
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.

4 years agoRollup merge of #70812 - rossmacarthur:fix/unit-called-nil, r=LukasKalbertodt
Dylan DPC [Sun, 5 Apr 2020 16:47:48 +0000 (18:47 +0200)]
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".

4 years agoRollup merge of #70795 - Amanieu:btree_remove_tracking, r=Mark-Simulacrum
Dylan DPC [Sun, 5 Apr 2020 16:47:47 +0000 (18:47 +0200)]
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

4 years agoRollup merge of #70777 - faern:use-assoc-int-consts2, r=dtolnay
Dylan DPC [Sun, 5 Apr 2020 16:47:45 +0000 (18:47 +0200)]
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

4 years agoRollup merge of #67797 - Aaron1011:feature/instance-query, r=nikomatsakis
Dylan DPC [Sun, 5 Apr 2020 16:47:44 +0000 (18:47 +0200)]
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

4 years agoAuto merge of #70809 - matthiaskrgr:submodule_upd, r=Mark-Simulacrum
bors [Sun, 5 Apr 2020 16:13:44 +0000 (16:13 +0000)]
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

4 years agoalso print type type
Ralf Jung [Sun, 5 Apr 2020 15:13:30 +0000 (17:13 +0200)]
also print type type

4 years agoalso print rustc_layout on impl trait type aliases
Ralf Jung [Sun, 5 Apr 2020 15:07:06 +0000 (17:07 +0200)]
also print rustc_layout on impl trait type aliases

4 years agoApply review feedback
Amanieu d'Antras [Sun, 5 Apr 2020 13:27:18 +0000 (14:27 +0100)]
Apply review feedback

4 years agoAuto merge of #70807 - Dylan-DPC:rollup-qd1kgl2, r=Dylan-DPC
bors [Sun, 5 Apr 2020 13:00:36 +0000 (13:00 +0000)]
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

4 years agoDo not use "nil" to refer to `()`
Ross MacArthur [Sun, 5 Apr 2020 12:30:13 +0000 (14:30 +0200)]
Do not use "nil" to refer to `()`

4 years agosubmodules: update clippy from 326b2204 to 7907abea
Matthias Krüger [Sun, 5 Apr 2020 11:46:28 +0000 (13:46 +0200)]
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

4 years agoSimplify dtor registration for HermitCore by using a list of destructors
Stefan Lankes [Sun, 5 Apr 2020 11:37:04 +0000 (13:37 +0200)]
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

4 years agoKeep track of position when deleting from a BTreeMap
Amanieu d'Antras [Sun, 5 Apr 2020 00:58:25 +0000 (01:58 +0100)]
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.

4 years agoRollup merge of #70806 - RalfJung:miri-assignment-check, r=eddyb
Dylan DPC [Sun, 5 Apr 2020 11:13:14 +0000 (13:13 +0200)]
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

4 years agoRollup merge of #70776 - RalfJung:raw-vec, r=Dylan-DPC,TimDiekmann
Dylan DPC [Sun, 5 Apr 2020 11:13:13 +0000 (13:13 +0200)]
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.

4 years agoRollup merge of #70769 - RalfJung:fixed, r=Dylan-DPC
Dylan DPC [Sun, 5 Apr 2020 11:13:11 +0000 (13:13 +0200)]
Rollup merge of #70769 - RalfJung:fixed, r=Dylan-DPC

Miri: remove an outdated FIXME

We even [have a test ](https://github.com/rust-lang/rust/blob/49dc2f9f091748beb1a8a9d5b3eb3bbe7362c3bd/src/test/ui/consts/miri_unleashed/drop.rs) making sure that we detect dropping with a non-const implementation.

r? @oli-obk

4 years agoRollup merge of #70760 - PonasKovas:docs, r=Dylan-DPC
Dylan DPC [Sun, 5 Apr 2020 11:13:10 +0000 (13:13 +0200)]
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.

4 years agoRollup merge of #70558 - RalfJung:vec-extend-aliasing, r=Amanieu
Dylan DPC [Sun, 5 Apr 2020 11:13:08 +0000 (13:13 +0200)]
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.

4 years agoMake libcore float constant examples similar to libstd
Linus Färnstrand [Sun, 5 Apr 2020 09:44:25 +0000 (11:44 +0200)]
Make libcore float constant examples similar to libstd

4 years agoRemove more std::f32 imports in libstd
Linus Färnstrand [Sun, 5 Apr 2020 09:36:44 +0000 (11:36 +0200)]
Remove more std::f32 imports in libstd

4 years agofix comment
Ralf Jung [Sun, 5 Apr 2020 10:11:33 +0000 (12:11 +0200)]
fix comment

4 years agoclarify safety in RawVec::into_box
Ralf Jung [Sat, 4 Apr 2020 17:32:21 +0000 (19:32 +0200)]
clarify safety in RawVec::into_box

4 years agoadd test
Ralf Jung [Sun, 5 Apr 2020 09:56:02 +0000 (11:56 +0200)]
add test