]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #56126 - Turbo87:bench-parse, r=alexcrichton
Guillaume Gomez [Thu, 22 Nov 2018 09:37:56 +0000 (10:37 +0100)]
Rollup merge of #56126 - Turbo87:bench-parse, r=alexcrichton

core/benches/num: Add `from_str/from_str_radix()` benchmarks

This was extracted from #55973

/cc @alexcrichton

5 years agoRollup merge of #56106 - bjorn3:patch-1, r=alexcrichton
Guillaume Gomez [Thu, 22 Nov 2018 09:37:55 +0000 (10:37 +0100)]
Rollup merge of #56106 - bjorn3:patch-1, r=alexcrichton

Remove some incorrect doc comments

5 years agoRollup merge of #56078 - ehuss:fix-panic-opt-msg, r=alexcrichton
Guillaume Gomez [Thu, 22 Nov 2018 09:37:54 +0000 (10:37 +0100)]
Rollup merge of #56078 - ehuss:fix-panic-opt-msg, r=alexcrichton

Fix error message for `-C panic=xxx`.

Fixes rust-lang/cargo#6334

5 years agoRollup merge of #56067 - jethrogb:jb/sgx-target-spec, r=alexcrichton
Guillaume Gomez [Thu, 22 Nov 2018 09:37:53 +0000 (10:37 +0100)]
Rollup merge of #56067 - jethrogb:jb/sgx-target-spec, r=alexcrichton

Add SGX target to rustc

This adds the `x86_64-fortanix-unknown-sgx` target specification to the Rust compiler. See #56066 for more details about this target.

5 years agoRollup merge of #56063 - 0xrgb:patch-1, r=joshtriplett
Guillaume Gomez [Thu, 22 Nov 2018 09:37:51 +0000 (10:37 +0100)]
Rollup merge of #56063 - 0xrgb:patch-1, r=joshtriplett

Update any.rs documentation using keyword dyn

This will fix #56062.

5 years agoRollup merge of #56002 - Axary:master, r=estebank
Guillaume Gomez [Thu, 22 Nov 2018 09:37:50 +0000 (10:37 +0100)]
Rollup merge of #56002 - Axary:master, r=estebank

fix #55972: Erroneous self arguments on bare functions emit subpar compilation error

#55972

r? @estebank

5 years agoRollup merge of #55980 - csmoe:issue-55891, r=estebank
Guillaume Gomez [Thu, 22 Nov 2018 09:37:49 +0000 (10:37 +0100)]
Rollup merge of #55980 - csmoe:issue-55891, r=estebank

Suggest on closure args count mismatching with pipe span

Closes #55891
r? @estebank

5 years agoRollup merge of #55961 - tromey:Bug-55944-vecdeque, r=nikomatsakis
Guillaume Gomez [Thu, 22 Nov 2018 09:37:48 +0000 (10:37 +0100)]
Rollup merge of #55961 - tromey:Bug-55944-vecdeque, r=nikomatsakis

Fix VecDeque pretty-printer

This fixes the VecDeque pretty-printer to handle cases where
head < tail.
Closes #55944

5 years agoRollup merge of #55784 - meltinglava:master, r=KodrAus
Guillaume Gomez [Thu, 22 Nov 2018 09:37:46 +0000 (10:37 +0100)]
Rollup merge of #55784 - meltinglava:master, r=KodrAus

Clarifying documentation for collections::hash_map::Entry::or_insert

Previous version does not show that or_insert does not insert the passed value, as the passed value was the same value as what was already in the map.

5 years agoRollup merge of #55485 - petertodd:2018-10-manuallydrop-deref, r=TimNN
Guillaume Gomez [Thu, 22 Nov 2018 09:37:45 +0000 (10:37 +0100)]
Rollup merge of #55485 - petertodd:2018-10-manuallydrop-deref, r=TimNN

Return &T / &mut T in ManuallyDrop Deref(Mut) impl

Without this change the generated documentation looks like this:

    fn deref(&self) -> &<ManuallyDrop<T> as Deref>::Target

Returning the actual type directly makes the generated docs more clear:

    fn deref(&self) -> &T

Basically, compare how the impl for `Box<T>` and `ManuallyDrop<T>` looks in this screenshot:

![rust docs for ManuallyDrop as Deref](https://user-images.githubusercontent.com/7042/47673083-fc9dc280-db89-11e8-89b0-c6bde663feef.png)

5 years agoRollup merge of #55367 - GuillaumeGomez:private-item-doc-test-lint, r=QuietMisdreavus
Guillaume Gomez [Thu, 22 Nov 2018 09:37:43 +0000 (10:37 +0100)]
Rollup merge of #55367 - GuillaumeGomez:private-item-doc-test-lint, r=QuietMisdreavus

lint if a private item has doctests

Fixes #55333.

r? @QuietMisdreavus

5 years agoPass additional linker flags when targeting Fuchsia
Petr Hosek [Thu, 22 Nov 2018 08:59:37 +0000 (00:59 -0800)]
Pass additional linker flags when targeting Fuchsia

This is a follow up to 8aa9267 which changed the driver to use lld
directly rather than invoking it through Clang. This change ensures
we pass all the necessary flags to lld.

5 years agoAuto merge of #53918 - Havvy:doc-sort-by, r=GuillaumeGomez
bors [Thu, 22 Nov 2018 06:50:18 +0000 (06:50 +0000)]
Auto merge of #53918 - Havvy:doc-sort-by, r=GuillaumeGomez

Doc total order requirement of sort(_unstable)_by

I took the definition of what a total order is from the Ord trait
docs. I specifically put "elements of the slice" because if you
have a slice of f64s, but know none are NaN, then sorting by
partial ord is total in this case. I'm not sure if I should give
such an example in the docs or not.

r? @GuillaumeGomez

5 years agorustc_target: avoid using AbiAndPrefAlign where possible.
Eduard-Mihai Burtescu [Sat, 8 Sep 2018 22:16:45 +0000 (01:16 +0300)]
rustc_target: avoid using AbiAndPrefAlign where possible.

5 years agoAuto merge of #56147 - petrochenkov:impice, r=nikomatsakis
bors [Thu, 22 Nov 2018 02:40:44 +0000 (02:40 +0000)]
Auto merge of #56147 - petrochenkov:impice, r=nikomatsakis

resolve: Fix some asserts in import validation

The asserts are not actually correct in presence of ambiguity errors.

Fixes https://github.com/rust-lang/rust/issues/56125

5 years agorustc_target: separate out an individual Align from AbiAndPrefAlign.
Eduard-Mihai Burtescu [Sat, 8 Sep 2018 21:22:22 +0000 (00:22 +0300)]
rustc_target: separate out an individual Align from AbiAndPrefAlign.

5 years agorustc_target: rename abi::Align to AbiAndPrefAlign.
Eduard-Mihai Burtescu [Sat, 8 Sep 2018 19:14:55 +0000 (22:14 +0300)]
rustc_target: rename abi::Align to AbiAndPrefAlign.

5 years agoadd compile-pass annotation
Niko Matsakis [Wed, 21 Nov 2018 23:50:10 +0000 (18:50 -0500)]
add compile-pass annotation

5 years agoAuto merge of #56065 - oli-obk:min_const_fn_loop_ice, r=davidtwco
bors [Wed, 21 Nov 2018 23:24:15 +0000 (23:24 +0000)]
Auto merge of #56065 - oli-obk:min_const_fn_loop_ice, r=davidtwco

Replace the ICEing on const fn loops with an error

fixes #56035

5 years agoresolve: Fix some asserts in import validation
Vadim Petrochenkov [Wed, 21 Nov 2018 22:13:09 +0000 (01:13 +0300)]
resolve: Fix some asserts in import validation

5 years agohack: ignore list-stems for pub lint
Niko Matsakis [Wed, 21 Nov 2018 21:09:17 +0000 (16:09 -0500)]
hack: ignore list-stems for pub lint

5 years agopass vis by shared reference
Niko Matsakis [Wed, 21 Nov 2018 19:24:36 +0000 (14:24 -0500)]
pass vis by shared reference

We are not mutating it now.

5 years agoadd regression test
Niko Matsakis [Wed, 21 Nov 2018 19:20:03 +0000 (14:20 -0500)]
add regression test

5 years agopreserve the original visibility for the "list stem" node
Niko Matsakis [Wed, 21 Nov 2018 20:34:11 +0000 (15:34 -0500)]
preserve the original visibility for the "list stem" node

Without this, the `vis` does not wind up in the tree anywhere, and
then we get ICEs because the node-ids it refers to are not present.
The motivation seemed to be documentation, but `ListStem` HIR nodes
are ignored in rustdoc, from what I can tell.

5 years agoAuto merge of #56134 - oli-obk:clippy_documentation, r=nrc
bors [Wed, 21 Nov 2018 20:26:15 +0000 (20:26 +0000)]
Auto merge of #56134 - oli-obk:clippy_documentation, r=nrc

Forward rust version number to tools

Clippy uses it to identify the correct documentation to point to

cc @Manishearth @nrc

sibling PR in clippy: https://github.com/rust-lang-nursery/rust-clippy/pull/3442

5 years agorenumber segment ids for visibilities whenever we clone them
Niko Matsakis [Wed, 21 Nov 2018 18:36:11 +0000 (13:36 -0500)]
renumber segment ids for visibilities whenever we clone them

5 years agoadd some `debug!` into lowering
Niko Matsakis [Wed, 21 Nov 2018 18:35:54 +0000 (13:35 -0500)]
add some `debug!` into lowering

5 years agotrack the span for each id so that we can give a nice ICE
Niko Matsakis [Wed, 21 Nov 2018 18:35:14 +0000 (13:35 -0500)]
track the span for each id so that we can give a nice ICE

5 years agoAuto merge of #56118 - steveklabnik:update-books, r=alexcrichton
bors [Wed, 21 Nov 2018 15:56:32 +0000 (15:56 +0000)]
Auto merge of #56118 - steveklabnik:update-books, r=alexcrichton

Update books for Rust 2018

This PR:

1. updates all of the books
    * I don't know if @Gankro has further plans for the nomicon or not
2. updates the build process because TRPL is only distributing one edition now
3. fixes up the stdlib links

I think that this passes but it's 3:20 am and so I'm sending it in and will fix up anything i missed in the morning.

/cc @alexcrichton for the big beta backport

5 years agoForward rust version number to tools
Oliver Scherer [Wed, 21 Nov 2018 13:27:30 +0000 (14:27 +0100)]
Forward rust version number to tools

Clippy uses it to identify the correct documentation to point to

5 years agoAuto merge of #56117 - petrochenkov:iempty, r=eddyb
bors [Wed, 21 Nov 2018 12:54:10 +0000 (12:54 +0000)]
Auto merge of #56117 - petrochenkov:iempty, r=eddyb

resolve: Make "empty import canaries" invisible from other crates

Empty imports `use prefix::{};` are desugared into `use prefix::{self as _};` to make sure the prefix is checked for privacy/stability/etc.
This caused issues in cross-crate scenarios because gensyms are lost in crate metadata (the `_` is a gensym).

Fixes https://github.com/rust-lang/rust/issues/55811

5 years agoupdate various stdlib docs
Steve Klabnik [Wed, 21 Nov 2018 00:49:47 +0000 (19:49 -0500)]
update various stdlib docs

5 years agocore/benches/num: Add `from_str/from_str_radix()` benchmarks
Tobias Bieniek [Tue, 13 Nov 2018 12:54:51 +0000 (13:54 +0100)]
core/benches/num: Add `from_str/from_str_radix()` benchmarks

5 years agoAdd x86_64-fortanix-unknown-sgx target to the compiler
Jethro Beekman [Mon, 19 Nov 2018 09:35:28 +0000 (15:05 +0530)]
Add x86_64-fortanix-unknown-sgx target to the compiler

5 years agoAuto merge of #52591 - eddyb:functional-snakes, r=oli-obk
bors [Wed, 21 Nov 2018 08:08:13 +0000 (08:08 +0000)]
Auto merge of #52591 - eddyb:functional-snakes, r=oli-obk

rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.

These are cruft left over from a time when `Foo::default()` didn't "just work".

5 years agorustc: implement and use Default on more types.
Eduard-Mihai Burtescu [Wed, 25 Jul 2018 12:44:06 +0000 (15:44 +0300)]
rustc: implement and use Default on more types.

5 years agorustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.
Eduard-Mihai Burtescu [Sat, 21 Jul 2018 19:15:11 +0000 (22:15 +0300)]
rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.

5 years agoAdd unstable Literal::subspan().
Sergio Benitez [Wed, 21 Nov 2018 05:12:30 +0000 (21:12 -0800)]
Add unstable Literal::subspan().

5 years agoAuto merge of #56032 - petrochenkov:stabecip, r=nikomatsakis
bors [Wed, 21 Nov 2018 02:30:35 +0000 (02:30 +0000)]
Auto merge of #56032 - petrochenkov:stabecip, r=nikomatsakis

Stabilize `extern_crate_item_prelude`

Closes https://github.com/rust-lang/rust/issues/55599

5 years agofix more links
Steve Klabnik [Tue, 20 Nov 2018 23:42:49 +0000 (18:42 -0500)]
fix more links

5 years agofix rustbuild to build all the books
Steve Klabnik [Tue, 20 Nov 2018 19:57:56 +0000 (14:57 -0500)]
fix rustbuild to build all the books

5 years agoupdate books
Steve Klabnik [Tue, 20 Nov 2018 12:40:31 +0000 (07:40 -0500)]
update books

5 years agoresolve: Make "empty import canaries" invisible from other crates
Vadim Petrochenkov [Wed, 21 Nov 2018 00:39:41 +0000 (03:39 +0300)]
resolve: Make "empty import canaries" invisible from other crates

5 years agoci: Download clang/lldb from tarballs
Alex Crichton [Tue, 20 Nov 2018 23:56:19 +0000 (15:56 -0800)]
ci: Download clang/lldb from tarballs

Hopefully will speed up CI slightly!

5 years agoAdd a couple more tests
Vadim Petrochenkov [Tue, 20 Nov 2018 22:28:07 +0000 (01:28 +0300)]
Add a couple more tests

5 years agoStabilize `extern_crate_item_prelude`
Vadim Petrochenkov [Sat, 17 Nov 2018 18:08:00 +0000 (21:08 +0300)]
Stabilize `extern_crate_item_prelude`

5 years agoAuto merge of #56111 - nrc:update, r=kennytm
bors [Tue, 20 Nov 2018 21:06:55 +0000 (21:06 +0000)]
Auto merge of #56111 - nrc:update, r=kennytm

Update RLS and Rustfmt

Re-opening https://github.com/rust-lang/rust/pull/56061

@bors: r=kennytm p=2

5 years agoUpdate RLS and Rustfmt
Nick Cameron [Mon, 19 Nov 2018 04:21:10 +0000 (17:21 +1300)]
Update RLS and Rustfmt

5 years agoAuto merge of #55720 - RalfJung:const-eval-raw, r=oli-obk
bors [Tue, 20 Nov 2018 18:08:12 +0000 (18:08 +0000)]
Auto merge of #55720 - RalfJung:const-eval-raw, r=oli-obk

Make const_eval_raw query return just an AllocId

r? @oli-obk

5 years agoCapitalize
Simon Sapin [Tue, 20 Nov 2018 17:22:26 +0000 (18:22 +0100)]
Capitalize

5 years agoAdd tracking issue for unfold and successors
Simon Sapin [Thu, 15 Nov 2018 13:33:47 +0000 (14:33 +0100)]
Add tracking issue for unfold and successors

5 years agoAdd std::iter::successors
Simon Sapin [Thu, 15 Nov 2018 13:23:20 +0000 (14:23 +0100)]
Add std::iter::successors

5 years ago`Copy` is best avoided on iterators
Simon Sapin [Thu, 15 Nov 2018 13:22:21 +0000 (14:22 +0100)]
`Copy` is best avoided on iterators

5 years agoUnfold<St, F>: Debug without F: Debug
Simon Sapin [Thu, 15 Nov 2018 12:21:25 +0000 (13:21 +0100)]
Unfold<St, F>: Debug without F: Debug

5 years agoAdd std::iter::unfold
Simon Sapin [Sun, 11 Nov 2018 11:13:59 +0000 (12:13 +0100)]
Add std::iter::unfold

5 years agoRemove incorrect doc comment in rustc_mir::monomorphize::item
bjorn3 [Tue, 20 Nov 2018 16:32:46 +0000 (17:32 +0100)]
Remove incorrect doc comment in rustc_mir::monomorphize::item

5 years agoRemove incorrect doc comment
bjorn3 [Tue, 20 Nov 2018 16:30:29 +0000 (17:30 +0100)]
Remove incorrect doc comment

5 years agoAuto merge of #55663 - varkor:must_use-traits, r=estebank
bors [Tue, 20 Nov 2018 15:15:53 +0000 (15:15 +0000)]
Auto merge of #55663 - varkor:must_use-traits, r=estebank

Allow #[must_use] on traits

Addresses https://github.com/rust-lang/rust/issues/55506, but we'll probably want to add it to some library traits like `Iterator` before the issue is considered fixed. Fixes https://github.com/rust-lang/rust/issues/51560.

`#[must_use]` is already permitted on traits, with no effect, so this seems like a bug fix, but I might be overlooking something. This currently warns for `impl Trait` or `dyn Trait` when the `Trait` is `#[must_use]` (although I don't think the latter is currently possible, so it's simply future-proofed).

5 years agoimprove error note
Axary [Tue, 20 Nov 2018 13:43:16 +0000 (14:43 +0100)]
improve error note

5 years agoAdd comments and rename a local variable
Olivier Goffart [Tue, 20 Nov 2018 12:24:41 +0000 (13:24 +0100)]
Add comments and rename a local variable

5 years agoAuto merge of #55678 - Aaronepower:master, r=Mark-Simulacrum
bors [Tue, 20 Nov 2018 12:09:36 +0000 (12:09 +0000)]
Auto merge of #55678 - Aaronepower:master, r=Mark-Simulacrum

Updated RELEASES.md for 1.31.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum

cc @rust-lang/release

5 years agoFix invalid bitcast taking bool out of a union represented as a scalar
Olivier Goffart [Tue, 20 Nov 2018 11:14:53 +0000 (12:14 +0100)]
Fix invalid bitcast taking bool out of a union represented as a scalar

As reported in https://github.com/rust-lang/rust/pull/54668#issuecomment-440186476

5 years agoUpdate releases to add rename dependencies feature
Aaron Power [Tue, 20 Nov 2018 09:47:28 +0000 (10:47 +0100)]
Update releases to add rename dependencies feature

5 years agoAuto merge of #56081 - alexcrichton:update-manifest, r=nrc
bors [Tue, 20 Nov 2018 09:08:24 +0000 (09:08 +0000)]
Auto merge of #56081 - alexcrichton:update-manifest, r=nrc

Add temporary renames to manifests for rustfmt/clippy

This will be part of our strategy for shipping renamed versions of these
components for the Rust 2018 edition.

Closes #55967

5 years agoFix json output in the self-profiler
Wesley Wiser [Tue, 20 Nov 2018 04:26:00 +0000 (23:26 -0500)]
Fix json output in the self-profiler

Fix missing ',' array element separators and convert NaN's to 0.

5 years agoAuto merge of #55983 - oli-obk:static_, r=Mark-Simulacrum
bors [Tue, 20 Nov 2018 03:05:11 +0000 (03:05 +0000)]
Auto merge of #55983 - oli-obk:static_, r=Mark-Simulacrum

Fix stability hole with `static _`

The `underscore_const_names` only gated const items with `_` as the name.

`static _: () = ();` works on beta without feature gates right now, this PR fixes that.

5 years agoAuto merge of #56049 - newpavlov:revert_51601, r=sfackler
bors [Tue, 20 Nov 2018 00:02:33 +0000 (00:02 +0000)]
Auto merge of #56049 - newpavlov:revert_51601, r=sfackler

Revert #51601

Closes: #55985
Specialization of `StepBy<Range(Inclusive)>` results in an incorrectly behaving code when `step_by` is combined with `skip` or `nth`.

If this will get merged we probably should reopen issues previously closed by #51601 (if there was any).

5 years agoAdd temporary renames to manifests for rustfmt/clippy
Alex Crichton [Mon, 19 Nov 2018 22:22:41 +0000 (14:22 -0800)]
Add temporary renames to manifests for rustfmt/clippy

This will be part of our strategy for shipping renamed versions of these
components for the Rust 2018 edition.

Closes #55967

5 years agoexplain why we can use raw
Ralf Jung [Sat, 17 Nov 2018 14:45:09 +0000 (15:45 +0100)]
explain why we can use raw

5 years agowe now do proper validation on scalars
Ralf Jung [Wed, 7 Nov 2018 12:51:29 +0000 (13:51 +0100)]
we now do proper validation on scalars

5 years agouse RawConst in miri
Ralf Jung [Tue, 6 Nov 2018 15:16:27 +0000 (16:16 +0100)]
use RawConst in miri

5 years agoMake const_eval_raw query return just an AllocId
Ralf Jung [Tue, 6 Nov 2018 13:17:40 +0000 (14:17 +0100)]
Make const_eval_raw query return just an AllocId

5 years agoFix error message for `-C panic=xxx`.
Eric Huss [Mon, 19 Nov 2018 21:29:35 +0000 (13:29 -0800)]
Fix error message for `-C panic=xxx`.

5 years agoAuto merge of #55971 - SergioBenitez:skip-non-semantic, r=alexcrichton
bors [Mon, 19 Nov 2018 19:57:02 +0000 (19:57 +0000)]
Auto merge of #55971 - SergioBenitez:skip-non-semantic, r=alexcrichton

Ignore non-semantic tokens for 'probably_eq' streams.

Improves the situation in #43081 by skipping typically non-semantic tokens when checking for 'probably_eq'.

r? @alexcrichton

5 years agoFix change to predicates
varkor [Mon, 19 Nov 2018 18:54:52 +0000 (18:54 +0000)]
Fix change to predicates

5 years agoAdd `override_export_symbols` option to Rust target specification
Jethro Beekman [Mon, 19 Nov 2018 09:34:28 +0000 (15:04 +0530)]
Add `override_export_symbols` option to Rust target specification

5 years agoFix typo in #[must_use] message
varkor [Sat, 3 Nov 2018 21:27:35 +0000 (21:27 +0000)]
Fix typo in #[must_use] message

5 years agoHandle trait objects
varkor [Sat, 3 Nov 2018 20:24:24 +0000 (20:24 +0000)]
Handle trait objects

5 years agoTest for #[must_use] on traits
varkor [Sat, 3 Nov 2018 20:08:38 +0000 (20:08 +0000)]
Test for #[must_use] on traits

5 years agoRecognise #[must_use] on traits, affecting impl Trait
varkor [Sat, 3 Nov 2018 20:08:30 +0000 (20:08 +0000)]
Recognise #[must_use] on traits, affecting impl Trait

5 years agoUse general uninhabitedness checking
varkor [Sat, 3 Nov 2018 19:23:05 +0000 (19:23 +0000)]
Use general uninhabitedness checking

5 years agoAuto merge of #56060 - nrc:save-path-fallback, r=zackmdavis
bors [Mon, 19 Nov 2018 16:59:12 +0000 (16:59 +0000)]
Auto merge of #56060 - nrc:save-path-fallback, r=zackmdavis

save-analysis: fallback to using path id

r? @eddyb

5 years agoDisable some pretty-printers when gdb is rust-enabled
Tom Tromey [Wed, 7 Nov 2018 19:04:40 +0000 (12:04 -0700)]
Disable some pretty-printers when gdb is rust-enabled

A rust-enabled gdb already knows how to display string slices,
structs, tuples, and enums (and after #54004, the pretty-printers
can't handle enums at all).  This patch disables these pretty-printers
when gdb is rust-enabled.

The "gdb-pretty-struct-and-enums-pre-gdb-7-7.rs" test is renamed,
because it does not seem to depend on any behavior of that version of
gdb, and because gdb 7.7 is 4 years old now.

5 years agoAuto merge of #56051 - pietroalbini:rollup, r=pietroalbini
bors [Mon, 19 Nov 2018 14:07:45 +0000 (14:07 +0000)]
Auto merge of #56051 - pietroalbini:rollup, r=pietroalbini

Rollup of 25 pull requests

Successful merges:

 - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets)
 - #55564 (test/linkage-visibility: Ignore on musl targets)
 - #55827 (A few tweaks to iterations/collecting)
 - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI)
 - #55857 (remove unused dependency)
 - #55862 (in which the E0618 "expected function" diagnostic gets a makeover)
 - #55867 (do not panic just because cargo failed)
 - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef)
 - #55916 (Make miri value visitor useful for mutation)
 - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code)
 - #55923 (reword #[test] attribute error on fn items)
 - #55949 (ty: return impl Iterator from Predicate::walk_tys)
 - #55952 (Update to Clang 7 on CI.)
 - #55953 (#53488 Refactoring UpvarId)
 - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors)
 - #55963 (Stress test for MPSC)
 - #55968 (Clean up some non-mod-rs stuff.)
 - #55970 (Miri backtrace improvements)
 - #56007 (CTFE: dynamically make sure we do not call non-const-fn)
 - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.)
 - #56012 (avoid shared ref in UnsafeCell::get)
 - #56016 (Add VecDeque::resize_with)
 - #56027 (docs: Add missing backtick in object_safety.rs docs)
 - #56043 (remove "approx env bounds" if we already know from trait)
 - #56059 (Increase `Duration` approximate equal threshold to 1us)

5 years agoRollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
kennytm [Mon, 19 Nov 2018 08:20:13 +0000 (16:20 +0800)]
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler

Increase `Duration` approximate equal threshold to 1us

Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034

5 years agoRollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb
Pietro Albini [Sun, 18 Nov 2018 22:25:00 +0000 (23:25 +0100)]
Rollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb

remove "approx env bounds" if we already know from trait

Alternative to https://github.com/rust-lang/rust/pull/55988 that fixes #55756 -- smaller fix that I cannot see having (correctness) repercussions beyond the test at hand, and hence better for backporting. (Famous last words, I know.)

r? @eddyb

5 years agoRollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus
Pietro Albini [Sun, 18 Nov 2018 22:24:59 +0000 (23:24 +0100)]
Rollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus

docs: Add missing backtick in object_safety.rs docs

Closes #56019.

r? @bjorn3

5 years agoRollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett
Pietro Albini [Sun, 18 Nov 2018 22:24:58 +0000 (23:24 +0100)]
Rollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett

Add VecDeque::resize_with

This already exists on `Vec`; I'm just adding it to `VecDeque`.

I wanted to resize a `VecDeque<Vec<T>>` when I didn't know `T: Clone`, so I couldn't use `.resize(n, Vec::new())`.  With this I could do `.resize_with(n, Vec::new)` instead, which doesn't need `T: Clone`.

Tracking issue: https://github.com/rust-lang/rust/issues/41758

5 years agoRollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis
Pietro Albini [Sun, 18 Nov 2018 22:24:57 +0000 (23:24 +0100)]
Rollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis

avoid shared ref in UnsafeCell::get

Avoid taking a shared reference in `UnsafeCell::get`. This *should* be taking a raw reference (see https://github.com/rust-lang/rfcs/pull/2582), but that operation is not currently available, so I propose we exploit `repr(transparent)` instead and cast the pointer around.

This is required to make `UnsafeCell::get` pass the [stacked borrows implementation](https://www.ralfj.de/blog/2018/11/16/stacked-borrows-implementation.html) in miri (currently, `UnsafeCell::get` is on a whitelist, but that is of course not very satisfying). It shouldn't affect normal execution/codegen. Would be great if we could get this landed and shrink miri's whitelist!

Cc @nikomatsakis

5 years agoRollup merge of #56011 - CBenoit:master, r=QuietMisdreavus
Pietro Albini [Sun, 18 Nov 2018 22:24:56 +0000 (23:24 +0100)]
Rollup merge of #56011 - CBenoit:master, r=QuietMisdreavus

Replace data.clone() by Arc::clone(&data) in mutex doc.

Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
Since this clone is visible in the official documentation, I thought it could be better to use the more idiomatic version.

5 years agoRollup merge of #56007 - RalfJung:non-const-call, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:54 +0000 (23:24 +0100)]
Rollup merge of #56007 - RalfJung:non-const-call, r=oli-obk

CTFE: dynamically make sure we do not call non-const-fn

I'd love to have a test case for this, but I don't know how.

I am also really surprised by this test case that changed behavior: Why did it even start execution if it already determined that it shouldn't?!?

r? @oli-obk

5 years agoRollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:53 +0000 (23:24 +0100)]
Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk

Miri backtrace improvements

Nicer pretty-printing of the `RUST_CTFE_BACKTRACE`-backtraces:
```
  0: backtrace::backtrace::libunwind::trace::hc410fcb66fe85b11
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/libunwind.rs:53
     backtrace::backtrace::trace::h2106294a22648407
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/mod.rs:42
  1: backtrace::capture::Backtrace::new_unresolved::h5d8d98b993d092ba
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/capture.rs:88
  2: <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx, u64>>>::from::h6355269b2a661412
           at librustc/mir/interpret/error.rs:236
  3: <T as core::convert::Into<U>>::into::h70fcb917509539bd
           at /home/r/src/rust/rustc.2/src/libcore/convert.rs:455
  4: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::emulate_foreign_item::h9cde0e3ce7455a4a
           at src/fn_call.rs:292
  5: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::find_fn::h83f89524b9d1a49a
           at src/fn_call.rs:74
  6: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'a, 'mir, 'tcx>>::find_fn::hf9980473c4775f0c
           at src/lib.rs:345
     rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call::h401dec4a687f96e9
           at /home/r/src/rust/rustc.2/src/librustc_mir/interpret/terminator.rs:285
```
Indentation is now consistent with `RUST_BACKTRACE`, and the frame number is not repeated when there are multiple symbols for a frame.

Also preserve the `ty::Instance` for the internal backtrace (showing which frames in the user code where on the interpreter stack when the error happened), used by miri to avoid printing spans for libstd internals:
```
error[E0080]: constant evaluation error: the evaluated program panicked
   --> /home/r/src/rust/rustc.2/src/libstd/panicking.rs:525:9
    |
525 |         __rust_start_panic(obj as usize)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked
    |
    = note: inside call to `std::panicking::rust_panic` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:496:5
    = note: inside call to `std::panicking::rust_panic_with_hook` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:390:5
    = note: inside call to `std::panicking::continue_panic_fmt` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:345:5
note: inside call to `std::rt::begin_panic_fmt` at <::std::macros::panic macros>:8:1
   --> tests/compile-fail/panic.rs:4:5
    |
4   |     assert_eq!(5, 6);
    |     ^^^^^^^^^^^^^^^^^
    = note: inside call to `main` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:34
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:75
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/sys_common/backtrace.rs:136:5
    = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1913 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:13
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:310:40
    = note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:306:5
    = note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/src/rust/rustc.2/src/libstd/panic.rs:398:9
    = note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:58:25
    = note: inside call to `std::rt::lang_start_internal` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:5
    = note: inside call to `std::rt::lang_start::<()>`
```
Also notice that we show filenames and line numbers here now.

r? @oli-obk

5 years agoRollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov
Pietro Albini [Sun, 18 Nov 2018 22:24:52 +0000 (23:24 +0100)]
Rollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov

Clean up some non-mod-rs stuff.

This includes the following:
- Remove unused `non_modrs_mods` from `ParseSess` which as only used for feature gate diagnostics.
- Remove the vestiges of the feature gate tests in `test/ui`, they were only partially removed during stabilization.
- Fix the run-pass test, it was accidentally removed during stabilization.
- Add a ui test to verify error behavior for missing inline-nested mods.
- Add some tests for `#[path]` for inline-nested mods (both mod and non-mod-rs).
- Enable the diagnostic tests on windows, they should be fixed by #49478.

cc @cramertj

5 years agoRollup merge of #55963 - stepancheg:mpsc-take-2, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:51 +0000 (23:24 +0100)]
Rollup merge of #55963 - stepancheg:mpsc-take-2, r=alexcrichton

Stress test for MPSC

`concurrent_recv_timeout_and_upgrade` reproduces a problem 100%
times on my MacBook with command:

```
./x.py test --stage 0 ./src/test/run-pass/mpsc_stress.rs
```

Thus it is commented out.

Other tests cases were useful for catching another test cases
which may arise during the fix.

This diff is a part of my previous rewrite attempt: #42883

CC #39364

5 years agoRollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez
Pietro Albini [Sun, 18 Nov 2018 22:24:49 +0000 (23:24 +0100)]
Rollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez

rustdoc: properly calculate spans for intra-doc link resolution errors

Fixes https://github.com/rust-lang/rust/issues/55723

When rustdoc is reporting a resolution error for intra-doc links, it needs to convert a span from one relative to the *markdown* (as the links are only found on the final markdown text) to one relative to the *source code* (as the error reporting is meant to show where the line is in the source, so the user can fix it). However, a calculation for how much "offset" to apply had a subtle error: it trimmed the whole line when attempting to account for leading indentation. This caused it to add in *trailing* whitespace into this calculation, which created an incorrect span.

In a lot of situations, this isn't a problem - the span will be shifted in the code slightly, but the warning will still be displayed and mostly legible. However, there is one important situation where this can cause an ICE: multi-byte codepoints. If a shifted span now has a starting point in the middle of a multi-byte codepoint, libsyntax will panic when trying to track what source item it corresponds to. This flew under our radar because trailing whitespace and multi-byte codepoints are both situations that we don't run into in the compiler repo.

(There is one more situation where this can error, that will be much harder to fix: block-style doc comments. Lines in a block-style doc comment have a zero-or-more (usually one) character offset per line, causing this calculation to be way off. I'm punting that to another issue, though...)

5 years agoRollup merge of #55953 - blitzerr:master, r=nikomatsakis
Pietro Albini [Sun, 18 Nov 2018 22:24:48 +0000 (23:24 +0100)]
Rollup merge of #55953 - blitzerr:master, r=nikomatsakis

#53488 Refactoring UpvarId

5 years agoRollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:47 +0000 (23:24 +0100)]
Rollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton

Update to Clang 7 on CI.

Handles Linux and macOS. Windows seems to already have been updated.

r? @Mark-Simulacrum
cc @rust-lang/infra

5 years agoRollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_walk_tys, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:46 +0000 (23:24 +0100)]
Rollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_walk_tys, r=oli-obk

ty: return impl Iterator from Predicate::walk_tys

Fixes the lazyboye `FIXME` by returning a custom `Iterator` as intended by the original author of the function.

It is indeed a bit convoluted, so I'm ok with not changing this if perf results are not favourable enough. Also happy to adjust any names if need be.

5 years agoReplace the ICEing on const fn loops with an error
Oliver Scherer [Mon, 19 Nov 2018 09:40:09 +0000 (10:40 +0100)]
Replace the ICEing on const fn loops with an error

5 years agoUpdate any.rs documentation using keyword dyn
0xrgb [Mon, 19 Nov 2018 06:59:21 +0000 (15:59 +0900)]
Update any.rs documentation using keyword dyn