Commit Graph

109764 Commits

Author SHA1 Message Date
Dylan DPC
f2c59bd603
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
2020-04-07 14:46:55 +02:00
Dylan DPC
795bc2ccff
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`.
2020-04-07 14:46:53 +02:00
bors
39b62533c7 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.
2020-04-07 07:12:51 +00:00
bors
209b2be09f 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.
2020-04-07 04:01:26 +00:00
Josh Stone
f854070bb8 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.
2020-04-06 18:26:37 -07:00
Josh Stone
b80fa76ee0 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`.
2020-04-06 18:26:37 -07:00
bors
bf1f2eedda 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
2020-04-07 00:56:00 +00:00
Nicholas Nethercote
a932616cf1 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.
2020-04-07 09:21:15 +10:00
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
Dylan DPC
b9fe46d45b
Rollup merge of #70859 - tmiasko:move-sanitize-inline-always, r=jonas-schievink
Move sanitize-inline-always test to sanitize directory
2020-04-07 00:31:43 +02:00
Dylan DPC
6e412786de
Rollup merge of #70839 - GuillaumeGomez:cleanup-e0506, r=Dylan-DPC
clean up E0506 explanation

r? @Dylan-DPC
2020-04-07 00:31:41 +02:00
Dylan DPC
728136c73d
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.
2020-04-07 00:31:39 +02:00
Dylan DPC
7500bcfbb2
Rollup merge of #70690 - GuillaumeGomez:cleanup-e0501, r=Dylan-DPC
Clean up E0501 explanation

r? @Dylan-DPC
2020-04-07 00:31:38 +02:00
Dylan DPC
5768385615
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
2020-04-07 00:31:36 +02:00
Thomas de Zeeuw
5d09f9f051 Put reference to write_vectored in quotes in doc 2020-04-07 00:00:07 +02:00
Eduard-Mihai Burtescu
626abc7977 ty: remove {Existential,}Trait{Ref,Predicate}::input_types. 2020-04-06 21:55:51 +03:00
Eduard-Mihai Burtescu
b7fdc7b619 ty: remove unnecessary Predicate::walk_tys and collect_regions. 2020-04-06 21:55:50 +03:00
Eduard-Mihai Burtescu
3410aeddbe ty: switch Ty::walk from Ty to GenericArg. 2020-04-06 21:55:50 +03:00
Eduard-Mihai Burtescu
26199f0cbc ty/walk: switch walk_shallow from Ty to GenericArg. 2020-04-06 21:55:50 +03:00
Eduard-Mihai Burtescu
0d4705b009 traits/coherence: stop using Ty::walk_shallow. 2020-04-06 21:55:43 +03:00
Eduard-Mihai Burtescu
e53c42c0b3 ty/walk: keep track of GenericArgs on the stack, instead of Tys. 2020-04-06 21:50:11 +03: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
Guillaume Gomez
84c97ee9a0 Clean up E0501 explanation 2020-04-06 18:12:42 +02:00
Roland Kuhn
57a6b7bd22
Update src/librustc_trait_selection/traits/error_reporting/suggestions.rs
Co-Authored-By: varkor <github@varkor.com>
2020-04-06 17:04:21 +02: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
Guillaume Gomez
3a10bdcfb6 clean up E0506 explanation 2020-04-06 14:20:01 +02: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
Thomas de Zeeuw
63118d1fd7 Improve io::Write::write_all_vectored docs
Also adds some more tests with different length IoSlices.
2020-04-06 11:21:15 +02: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
Tomasz Miąsko
d2b75586fc Move sanitize-inline-always test to sanitize directory 2020-04-06 00:00:00 +00: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