]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoImprove Layout::extend docs
CAD97 [Mon, 20 Apr 2020 16:30:35 +0000 (12:30 -0400)]
Improve Layout::extend docs

4 years agoUpdate src/libcore/alloc/layout.rs
Christopher Durham [Mon, 20 Apr 2020 16:28:30 +0000 (12:28 -0400)]
Update src/libcore/alloc/layout.rs

Co-Authored-By: Amanieu d'Antras <amanieu@gmail.com>
4 years agoClarify layout information in Layout::extend
CAD97 [Fri, 17 Apr 2020 22:59:36 +0000 (18:59 -0400)]
Clarify layout information in Layout::extend

4 years agoApply suggestions from code review
Christopher Durham [Thu, 16 Apr 2020 20:44:30 +0000 (16:44 -0400)]
Apply suggestions from code review

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoAdd note about Layout::pad_to_align to Layout::extend
CAD97 [Wed, 15 Apr 2020 23:54:55 +0000 (19:54 -0400)]
Add note about Layout::pad_to_align to Layout::extend

4 years agoemphasize *no trailing padding*
Christopher Durham [Wed, 15 Apr 2020 19:50:31 +0000 (15:50 -0400)]
emphasize *no trailing padding*

4 years agoStabilize some of alloc_layout_extras
CAD97 [Fri, 21 Feb 2020 20:38:29 +0000 (15:38 -0500)]
Stabilize some of alloc_layout_extras

4 years agoAuto merge of #70884 - Dylan-DPC:rollup-r3raqdf, r=jonas-schievink
bors [Tue, 7 Apr 2020 13:43:30 +0000 (13:43 +0000)]
Auto merge of #70884 - Dylan-DPC:rollup-r3raqdf, r=jonas-schievink

Rollup of 5 pull requests

Successful merges:

 - #70201 (Small tweaks in ToOwned::clone_into)
 - #70762 (Miri leak check: memory reachable through globals is not leaked)
 - #70846 (Keep codegen units unmerged when building compiler builtins)
 - #70854 (Use assoc int submodules)
 - #70857 (Don't import integer and float modules, use assoc consts 2)

Failed merges:

r? @ghost

4 years agoRollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:59 +0000 (14:46 +0200)]
Rollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnay

Don't import integer and float modules, use assoc consts 2

Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :)

r? @dtolnay

4 years agoRollup merge of #70854 - faern:use-assoc-int-submodules, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:58 +0000 (14:46 +0200)]
Rollup merge of #70854 - faern:use-assoc-int-submodules, r=dtolnay

Use assoc int submodules

Bumping some submodules to the commits their masters currently point at. The main point of this is to get the associated integer/float constant documentation updates that were recently merged to them:

* https://github.com/rust-lang/nomicon/pull/207
* https://github.com/rust-lang/rust-by-example/pull/1327
* https://github.com/rust-lang/stdarch/pull/848

But for some, a few more changes slipped by that happened to be in the master branch of these submodules.

r? @dtolnay

4 years agoRollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichton
Dylan DPC [Tue, 7 Apr 2020 12:46:56 +0000 (14:46 +0200)]
Rollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichton

Keep codegen units unmerged when building compiler builtins

Make it possible to control how mono items are partitioned into code generation
units, when compiling the compiler builtins, by retaining the original partitioning.

Helps with #48625, #61063, #67960, #70489.

r? @alexcrichton

4 years agoRollup merge of #70762 - RalfJung:miri-leak-check, r=oli-obk
Dylan DPC [Tue, 7 Apr 2020 12:46:55 +0000 (14:46 +0200)]
Rollup merge of #70762 - RalfJung:miri-leak-check, r=oli-obk

Miri leak check: memory reachable through globals is not leaked

Also make Miri memory dump prettier by sharing more code with MIR dumping, and fix a bug where the Miri memory dump would print some allocations twice.

r? @oli-obk

Miri PR: https://github.com/rust-lang/miri/pull/1301

4 years agoRollup merge of #70201 - cuviper:clone_into, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:53 +0000 (14:46 +0200)]
Rollup merge of #70201 - cuviper:clone_into, r=dtolnay

Small tweaks in ToOwned::clone_into

- `<[T]>::clone_into` is slightly more optimized.
- `CStr::clone_into` is new, letting it reuse its allocation.
- `OsStr::clone_into` now forwards to the underlying slice/`Vec`.

4 years agoAuto merge of #70837 - nnethercote:speed-up-find_library_crate, r=petrochenkov
bors [Tue, 7 Apr 2020 07:12:51 +0000 (07:12 +0000)]
Auto merge of #70837 - nnethercote:speed-up-find_library_crate, r=petrochenkov

Speed up path searching with `find_library_crate`.

By doing prefix and suffix checking on a `String` copy of each relevant
`PathBuf`, rather than the `PathBuf` itself.

4 years agoAuto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakis
bors [Tue, 7 Apr 2020 04:01:26 +0000 (04:01 +0000)]
Auto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakis

ty/walk: iterate `GenericArg`s instead of `Ty`s.

Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it.

By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`.

I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.

4 years agoForward OsStr::clone_into to the inner Vec
Josh Stone [Fri, 20 Mar 2020 22:46:40 +0000 (15:46 -0700)]
Forward OsStr::clone_into to the inner Vec

Despite OS differences, they're all just `Vec<u8>` inside, so we can
just forward `clone_into` calls to that optimized implementation.

4 years agoImplement ToOwned::clone_into for CStr
Josh Stone [Fri, 20 Mar 2020 22:42:56 +0000 (15:42 -0700)]
Implement ToOwned::clone_into for CStr

It can try to keep its allocation by converting the inner `Box` to
`Vec`, using `clone_into` on the bytes, then convert back to `Box`.

4 years agoAuto merge of #70865 - Dylan-DPC:rollup-jje2cuv, r=Dylan-DPC
bors [Tue, 7 Apr 2020 00:56:00 +0000 (00:56 +0000)]
Auto merge of #70865 - Dylan-DPC:rollup-jje2cuv, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70612 (Add io::Write::write_all_vectored)
 - #70690 (Clean up E0501 explanation)
 - #70821 (expose suggestions::InferCtxtExt for clippy)
 - #70839 (clean up E0506 explanation)
 - #70859 (Move sanitize-inline-always test to sanitize directory)

Failed merges:

r? @ghost

4 years agoSpeed up path searching with `find_library_crate`.
Nicholas Nethercote [Mon, 6 Apr 2020 07:44:30 +0000 (17:44 +1000)]
Speed up path searching with `find_library_crate`.

By doing prefix and suffix checking on a `String` copy of each relevant
`PathBuf`, rather than the `PathBuf` itself.

4 years agoUse split_at in slice's ToOwned::clone_into
Josh Stone [Fri, 20 Mar 2020 22:28:26 +0000 (15:28 -0700)]
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.

4 years agoUse assoc integer constants in librustc_*
Linus Färnstrand [Mon, 6 Apr 2020 21:09:56 +0000 (23:09 +0200)]
Use assoc integer constants in librustc_*

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 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 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 agoClean up E0501 explanation
Guillaume Gomez [Thu, 2 Apr 2020 11:30:19 +0000 (13:30 +0200)]
Clean up E0501 explanation

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 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 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 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 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.