]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd missing backtick
Takayuki Nakata [Wed, 5 Aug 2020 14:44:28 +0000 (23:44 +0900)]
Add missing backtick

3 years agoApply `extern "C"` calling convention
Aaron Hill [Fri, 7 Aug 2020 13:51:50 +0000 (09:51 -0400)]
Apply `extern "C"` calling convention

Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
3 years agoOnly test function-arguments-naked.rs on x86_64
Aaron Hill [Fri, 7 Aug 2020 13:46:47 +0000 (09:46 -0400)]
Only test function-arguments-naked.rs on x86_64

We need to use inline assembly, which is inherently platform-specific.

3 years agoAuto merge of #74627 - petrochenkov:docbeauty2, r=Aaron1011
bors [Fri, 7 Aug 2020 13:29:25 +0000 (13:29 +0000)]
Auto merge of #74627 - petrochenkov:docbeauty2, r=Aaron1011

rustc_ast: Stop using "string typing" for doc comment tokens

Explicitly store their kind and style retrieved during lexing in the `token::DocComment`.

Also don't "beautify" doc comments before converting them to `#[doc]` attributes when passing them to macros (both declarative and procedural).
The trimming of empty lines, lines containing only `*`s, etc is purely a rustdoc's job as a part of its presentation of doc strings to users, rustc must not do this and must pass tokens as precisely as possible internally.

3 years agoBTreeMap: better way to postpone root access in DrainFilter
Stein Somers [Wed, 5 Aug 2020 08:36:12 +0000 (10:36 +0200)]
BTreeMap: better way to postpone root access in DrainFilter

3 years agoChange the comment of BTreeMap::into_values
Nazım Can Altınova [Fri, 7 Aug 2020 12:10:12 +0000 (14:10 +0200)]
Change the comment of BTreeMap::into_values

3 years agoOnly print the fields that are relevant to iterators for Debug of IntoKeys and IntoValues
Nazım Can Altınova [Fri, 7 Aug 2020 11:47:04 +0000 (13:47 +0200)]
Only print the fields that are relevant to iterators for Debug of IntoKeys and IntoValues

3 years agoclean up const-hacks in int endianess conversion functions
Ralf Jung [Fri, 7 Aug 2020 11:44:02 +0000 (13:44 +0200)]
clean up const-hacks in int endianess conversion functions

3 years agoAuto merge of #73842 - euclio:doctest-expn, r=GuillaumeGomez
bors [Fri, 7 Aug 2020 11:38:17 +0000 (11:38 +0000)]
Auto merge of #73842 - euclio:doctest-expn, r=GuillaumeGomez

Use outermost invocation span for doctest names

Fixes #70090.

This PR also allows using aux-build files in rustdoc-ui tests.

3 years agoAdd unit tests for new `BTreeMap::into_{keys,values}` methods
Nazım Can Altınova [Tue, 4 Aug 2020 20:05:03 +0000 (22:05 +0200)]
Add unit tests for new `BTreeMap::into_{keys,values}` methods

3 years agoAdd unit tests for new `HashMap::into_{keys,values}` methods
Nazım Can Altınova [Tue, 4 Aug 2020 20:04:12 +0000 (22:04 +0200)]
Add unit tests for new `HashMap::into_{keys,values}` methods

3 years agoAdd `into_{keys,values}` methods for BTreeMap
Nazım Can Altınova [Tue, 4 Aug 2020 20:01:12 +0000 (22:01 +0200)]
Add `into_{keys,values}` methods for BTreeMap

3 years agoAdd `into_{keys,values}` methods for HashMap
Nazım Can Altınova [Tue, 4 Aug 2020 20:00:32 +0000 (22:00 +0200)]
Add `into_{keys,values}` methods for HashMap

3 years agofix feature gate and tracking issue
Ralf Jung [Fri, 7 Aug 2020 10:27:53 +0000 (12:27 +0200)]
fix feature gate and tracking issue

3 years agomake MaybeUninit::as_(mut_)ptr const
Ralf Jung [Fri, 7 Aug 2020 10:24:28 +0000 (12:24 +0200)]
make MaybeUninit::as_(mut_)ptr const

3 years agoAuto merge of #70052 - Amanieu:hashbrown7, r=Mark-Simulacrum
bors [Fri, 7 Aug 2020 08:36:15 +0000 (08:36 +0000)]
Auto merge of #70052 - Amanieu:hashbrown7, r=Mark-Simulacrum

Update hashbrown to 0.8.1

This update includes:
- https://github.com/rust-lang/hashbrown/pull/146, which improves the performance of `Clone` and implements `clone_from`.
- https://github.com/rust-lang/hashbrown/pull/159, which reduces the size of `HashMap` by 8 bytes.
- https://github.com/rust-lang/hashbrown/pull/162, which avoids creating small 1-element tables.

Fixes #28481

3 years agoAuto merge of #75244 - Manishearth:rollup-dzfyjva, r=Manishearth
bors [Fri, 7 Aug 2020 06:40:53 +0000 (06:40 +0000)]
Auto merge of #75244 - Manishearth:rollup-dzfyjva, r=Manishearth

Rollup of 4 pull requests

Successful merges:

 - #74774 (adds [*mut|*const] ptr::set_ptr_value)
 - #75079 (Disallow linking to items with a mismatched disambiguator)
 - #75203 (Make `IntoIterator` lifetime bounds of `&BTreeMap` match with `&HashMap` )
 - #75227 (Fix ICE when using asm! on an unsupported architecture)

Failed merges:

r? @ghost

3 years agoFix natvis tests
Amanieu d'Antras [Fri, 7 Aug 2020 06:19:13 +0000 (07:19 +0100)]
Fix natvis tests

3 years agoRollup merge of #75227 - Amanieu:fix_asm_arch, r=Mark-Simulacrum
Manish Goregaokar [Fri, 7 Aug 2020 06:04:07 +0000 (23:04 -0700)]
Rollup merge of #75227 - Amanieu:fix_asm_arch, r=Mark-Simulacrum

Fix ICE when using asm! on an unsupported architecture

Fixes #75220

3 years agoRollup merge of #75203 - canova:btreemap-into-iter, r=dtolnay
Manish Goregaokar [Fri, 7 Aug 2020 06:04:05 +0000 (23:04 -0700)]
Rollup merge of #75203 - canova:btreemap-into-iter, r=dtolnay

Make `IntoIterator` lifetime bounds of `&BTreeMap` match with `&HashMap`

This is a pretty small change on the lifetime bounds of `IntoIterator` implementations of both `&BTreeMap` and `&mut BTreeMap`. This is loosening the lifetime bounds, so more code should be accepted with this PR. This is lifetime bounds will still be implicit since we have `type Item = (&'a K, &'a V);` in the implementation. This change will make the HashMap and BTreeMap share the same signature, so we can share the same function/trait with both HashMap and BTreeMap in the code.

Fixes #74034.
r? @dtolnay hey, I was touching this file on my previous PR and wanted to fix this on the way. Would you mind taking a look at this, or redirecting it if you are busy?

3 years agoRollup merge of #75079 - jyn514:disambiguator, r=Manishearth
Manish Goregaokar [Fri, 7 Aug 2020 06:04:03 +0000 (23:04 -0700)]
Rollup merge of #75079 - jyn514:disambiguator, r=Manishearth

Disallow linking to items with a mismatched disambiguator

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

r? @Manishearth

3 years agoRollup merge of #74774 - oliver-giersch:set_data_ptr, r=dtolnay
Manish Goregaokar [Fri, 7 Aug 2020 06:04:02 +0000 (23:04 -0700)]
Rollup merge of #74774 - oliver-giersch:set_data_ptr, r=dtolnay

adds [*mut|*const] ptr::set_ptr_value

I propose the addition of these two functions to `*mut T` and `*const T`, respectively. The motivation for this is primarily byte-wise pointer arithmetic on (potentially) fat pointers, i.e. for types with a `T: ?Sized` bound. A concrete use-case has been discussed in [this](https://internals.rust-lang.org/t/byte-wise-fat-pointer-arithmetic/12739) thread.
TL;DR: Currently, byte-wise pointer arithmetic with potentially fat pointers in not possible in either stable or nightly Rust without making assumptions about the layout of fat pointers, which is currently still an implementation detail and not formally stabilized. This PR adds one function to `*mut T` and `*const T` each, allowing to circumvent this restriction without exposing any internal implementation details.
One possible alternative would be to add specific byte-wise pointer arithmetic functions to the two pointer types in addition to the already existing count-wise functions. However, I feel this fairly niche use case does not warrant adding a whole set of new functions like `add_bytes`, `offset_bytes`, `wrapping_offset_bytes`, etc. (times two, one for each pointer type) to `libcore`.

3 years agoHandle new HashMap layout in CDB, MSVC, WinDbg, etc.
MaulingMonkey [Sun, 12 Jul 2020 15:13:36 +0000 (08:13 -0700)]
Handle new HashMap layout in CDB, MSVC, WinDbg, etc.

3 years agoHandle new HashMap layout in GDB and LLDB
Amanieu d'Antras [Mon, 22 Jun 2020 11:13:34 +0000 (12:13 +0100)]
Handle new HashMap layout in GDB and LLDB

3 years agoUpdate hashbrown to 0.8.1
Amanieu d'Antras [Mon, 16 Mar 2020 18:37:15 +0000 (18:37 +0000)]
Update hashbrown to 0.8.1

3 years agotest min_const_generics using revisions
Bastian Kauschke [Thu, 6 Aug 2020 20:57:09 +0000 (22:57 +0200)]
test min_const_generics using revisions

3 years agoAuto merge of #75121 - tmiasko:str-slicing, r=Mark-Simulacrum
bors [Fri, 7 Aug 2020 04:51:04 +0000 (04:51 +0000)]
Auto merge of #75121 - tmiasko:str-slicing, r=Mark-Simulacrum

Avoid `unwrap_or_else` in str indexing

This provides a small reduction of generated LLVM IR, and leads to a
simpler assembly code.

Closes #68874.

3 years agoAdd doc-comment for `kind_side_channel`
Joshua Nelson [Fri, 7 Aug 2020 03:17:15 +0000 (23:17 -0400)]
Add doc-comment for `kind_side_channel`

3 years agoAuto merge of #75233 - RalfJung:miri, r=RalfJung
bors [Fri, 7 Aug 2020 03:04:38 +0000 (03:04 +0000)]
Auto merge of #75233 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/74999
Cc @rust-lang/miri r? @ghost

3 years agoAuto merge of #75238 - JohnTitor:rollup-llbk0sq, r=JohnTitor
bors [Fri, 7 Aug 2020 01:16:47 +0000 (01:16 +0000)]
Auto merge of #75238 - JohnTitor:rollup-llbk0sq, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #74888 (compiletest: ignore-endian-big, fixes #74829, fixes #74885)
 - #75175 (Make doctests of Ipv4Addr::from(u32) easier to read)
 - #75179 (Remove unused FromInner impl for Ipv4Addr)
 - #75181 (Fix typo in  `librustc_feature/active.rs`)
 - #75183 (Label rustfmt toolstate issues with A-rustfmt)
 - #75188 (Handle fieldless tuple structs in diagnostic code)
 - #75190 (Clean up E0746 explanation)
 - #75210 (Change the type of `AssertModuleSource::available_cgus`.)
 - #75211 (Note about endianness of returned value of {integer}::from_be_bytes and friends)
 - #75217 (Clean up E0747 explanation)
 - #75232 (Fix typo "TraitObligatiom" -> "TraitObligation")
 - #75236 (Fix typo "biset" -> "bitset")

Failed merges:

r? @ghost

3 years agoRollup merge of #75236 - syntacticsugarglider:patch-1, r=jonas-schievink
Yuki Okushi [Fri, 7 Aug 2020 00:35:31 +0000 (09:35 +0900)]
Rollup merge of #75236 - syntacticsugarglider:patch-1, r=jonas-schievink

Fix typo "biset" -> "bitset"

3 years agoRollup merge of #75232 - leijurv:patch-1, r=jonas-schievink
Yuki Okushi [Fri, 7 Aug 2020 00:35:29 +0000 (09:35 +0900)]
Rollup merge of #75232 - leijurv:patch-1, r=jonas-schievink

Fix typo "TraitObligatiom" -> "TraitObligation"

3 years agoRollup merge of #75217 - GuillaumeGomez:cleanup-e0747, r=Dylan-DPC
Yuki Okushi [Fri, 7 Aug 2020 00:35:28 +0000 (09:35 +0900)]
Rollup merge of #75217 - GuillaumeGomez:cleanup-e0747, r=Dylan-DPC

Clean up E0747 explanation

r? @Dylan-DPC

3 years agoRollup merge of #75211 - lzutao:native-endian-notes, r=lcnr
Yuki Okushi [Fri, 7 Aug 2020 00:35:26 +0000 (09:35 +0900)]
Rollup merge of #75211 - lzutao:native-endian-notes, r=lcnr

Note about endianness of returned value of {integer}::from_be_bytes and friends

[`u32::from_be`](https://doc.rust-lang.org/nightly/src/core/num/mod.rs.html#2883-2892) documents about endianness of returned value.

I was confused by endianness of `from_be_bytes` in #75086 .

3 years agoRollup merge of #75210 - nnethercote:change-type-of-available_cgus, r=ecstatic-morse
Yuki Okushi [Fri, 7 Aug 2020 00:35:24 +0000 (09:35 +0900)]
Rollup merge of #75210 - nnethercote:change-type-of-available_cgus, r=ecstatic-morse

Change the type of `AssertModuleSource::available_cgus`.

It's currently a `BTreeSet<Symbol>`, which is a strange type. The
`BTreeSet` suggests that element order is important, but `Symbol` is a
type whose ordering isn't useful to humans. The ordering of the
collection only manifests in an obscure error message ("no module named
`...`") that doesn't appear in any tests.

This commit changes the `Symbol` to a `String`, which is more
typical.

3 years agoRollup merge of #75190 - GuillaumeGomez:cleanup-e0746, r=Dylan-DPC
Yuki Okushi [Fri, 7 Aug 2020 00:35:23 +0000 (09:35 +0900)]
Rollup merge of #75190 - GuillaumeGomez:cleanup-e0746, r=Dylan-DPC

Clean up E0746 explanation

r? @Dylan-DPC

3 years agoRollup merge of #75188 - Aaron1011:fix/fieldless-tuple-error, r=varkor
Yuki Okushi [Fri, 7 Aug 2020 00:35:21 +0000 (09:35 +0900)]
Rollup merge of #75188 - Aaron1011:fix/fieldless-tuple-error, r=varkor

Handle fieldless tuple structs in diagnostic code

Fixes #75062

3 years agoRollup merge of #75183 - Aaron1011:toolstate/a-rustfmt, r=nikomatsakis
Yuki Okushi [Fri, 7 Aug 2020 00:35:19 +0000 (09:35 +0900)]
Rollup merge of #75183 - Aaron1011:toolstate/a-rustfmt, r=nikomatsakis

Label rustfmt toolstate issues with A-rustfmt

This makes it easier to filter toolstate issues by the tool involved.

3 years agoRollup merge of #75181 - WaffleLapkin:patch-2, r=ecstaticmorse
Yuki Okushi [Fri, 7 Aug 2020 00:35:18 +0000 (09:35 +0900)]
Rollup merge of #75181 - WaffleLapkin:patch-2, r=ecstaticmorse

Fix typo in  `librustc_feature/active.rs`

3 years agoRollup merge of #75179 - lzutao:unsed-ipv4-frominner, r=alexcrichton
Yuki Okushi [Fri, 7 Aug 2020 00:35:16 +0000 (09:35 +0900)]
Rollup merge of #75179 - lzutao:unsed-ipv4-frominner, r=alexcrichton

Remove unused FromInner impl for Ipv4Addr

The removed is a unused unstable implementation.

3 years agoRollup merge of #75175 - lzutao:doctest-ipv4-fromu32, r=cuviper
Yuki Okushi [Fri, 7 Aug 2020 00:35:14 +0000 (09:35 +0900)]
Rollup merge of #75175 - lzutao:doctest-ipv4-fromu32, r=cuviper

Make doctests of Ipv4Addr::from(u32) easier to read

There are many zeroes in `0x0d0c0b0au32` which makes it hard to read.

3 years agoRollup merge of #74888 - infinity0:ignore-endian-big, r=nikomatsakis
Yuki Okushi [Fri, 7 Aug 2020 00:35:13 +0000 (09:35 +0900)]
Rollup merge of #74888 - infinity0:ignore-endian-big, r=nikomatsakis

compiletest: ignore-endian-big, fixes #74829, fixes #74885

See discussion on #74829

I tested it on a Debian s390x machine, works well.

3 years agoFix typo "biset" -> "bitset"
Izzy Swart [Thu, 6 Aug 2020 23:13:29 +0000 (16:13 -0700)]
Fix typo "biset" -> "bitset"

3 years agoRemove dead code
Joshua Nelson [Thu, 6 Aug 2020 22:57:56 +0000 (18:57 -0400)]
Remove dead code

3 years agoFix outdated code
Joshua Nelson [Thu, 6 Aug 2020 22:50:23 +0000 (18:50 -0400)]
Fix outdated code

3 years agoImprove tests
Joshua Nelson [Thu, 6 Aug 2020 22:33:29 +0000 (18:33 -0400)]
Improve tests

3 years agoUse the proper kind for associated items
Joshua Nelson [Thu, 6 Aug 2020 22:11:47 +0000 (18:11 -0400)]
Use the proper kind for associated items

See comments in the diff; this is such a hack.

The reason this can't be done properly in `register_res` is because
there's no way to get back the parent type: calling
`tcx.parent(assoc_item)` gets you the _impl_, not the type.
You can call `tcx.impl_trait_ref(impl_).self_ty()`, but there's no way
to go from that to a DefId without unwrapping.

3 years agoupdate Miri
Ralf Jung [Thu, 6 Aug 2020 21:55:30 +0000 (23:55 +0200)]
update Miri

3 years agoFix typo "TraitObligatiom" -> "TraitObligation"
Leijurv [Thu, 6 Aug 2020 21:37:32 +0000 (14:37 -0700)]
Fix typo "TraitObligatiom" -> "TraitObligation"

3 years agoStill print help even if there's no span
Joshua Nelson [Thu, 6 Aug 2020 21:10:52 +0000 (17:10 -0400)]
Still print help even if there's no span

3 years agoChange the type of `AssertModuleSource::available_cgus`.
Nicholas Nethercote [Thu, 6 Aug 2020 05:58:23 +0000 (15:58 +1000)]
Change the type of `AssertModuleSource::available_cgus`.

It's currently a `BTreeSet<Symbol>`, which is a strange type. The
`BTreeSet` suggests that element order is important, but `Symbol` is a
type whose ordering isn't useful to humans. The ordering of the
collection only manifests in an obscure error message ("no module named
`...`") that doesn't appear in any tests.

This commit changes the `Symbol` to a `String`, which is more
typical.

3 years agoallow complex expressions in assoc consts
Bastian Kauschke [Wed, 5 Aug 2020 16:59:53 +0000 (18:59 +0200)]
allow complex expressions in assoc consts

3 years agoAuto merge of #75228 - tmiasko:keep-stdout-open, r=ecstatic-morse
bors [Thu, 6 Aug 2020 20:22:20 +0000 (20:22 +0000)]
Auto merge of #75228 - tmiasko:keep-stdout-open, r=ecstatic-morse

Keep stdout open in limit_vector_count test

3 years agoAdd some comments for magic numbers + Add tests
Vadim Petrochenkov [Tue, 4 Aug 2020 21:26:23 +0000 (00:26 +0300)]
Add some comments for magic numbers + Add tests

3 years agoFix clippy
Vadim Petrochenkov [Wed, 22 Jul 2020 14:59:17 +0000 (17:59 +0300)]
Fix clippy

3 years agorustc_expand: Don not beautify doc comments before passing them to macros
Vadim Petrochenkov [Wed, 22 Jul 2020 09:28:17 +0000 (12:28 +0300)]
rustc_expand: Don not beautify doc comments before passing them to macros

Beautify all doc strings in rustdoc instead, including those in `#[doc]` attributes

3 years agorustc_ast/comments: Modernize some enum reexports
Vadim Petrochenkov [Wed, 22 Jul 2020 08:42:36 +0000 (11:42 +0300)]
rustc_ast/comments: Modernize some enum reexports

3 years agorustc_ast: Stop using "string typing" for doc comment tokens
Vadim Petrochenkov [Tue, 21 Jul 2020 19:16:19 +0000 (22:16 +0300)]
rustc_ast: Stop using "string typing" for doc comment tokens

Explicitly store their kind and style retrieved during lexing in the token

3 years agoFix ICE when using asm! on an unsupported architecture
Amanieu d'Antras [Thu, 6 Aug 2020 18:52:15 +0000 (19:52 +0100)]
Fix ICE when using asm! on an unsupported architecture

Fixes #75220

3 years agoAuto merge of #75218 - Aaron1011:feature/prof-metadata-query, r=Mark-Simulacrum
bors [Thu, 6 Aug 2020 18:26:50 +0000 (18:26 +0000)]
Auto merge of #75218 - Aaron1011:feature/prof-metadata-query, r=Mark-Simulacrum

Record query name when profiling "metadata_decode_entry"

3 years agoDon't call a function in function-arguments-naked.rs
Aaron Hill [Thu, 6 Aug 2020 16:11:49 +0000 (12:11 -0400)]
Don't call a function in function-arguments-naked.rs

Fixes #75096

It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the `#break` directive works fine without
anything in the function body.

3 years agoAuto merge of #75086 - lzutao:u32const, r=oli-obk
bors [Thu, 6 Aug 2020 14:21:48 +0000 (14:21 +0000)]
Auto merge of #75086 - lzutao:u32const, r=oli-obk

Use u32::from_ne_bytes to fix a FIXME and add comment about that

`u32::from_ne_bytes` has been const stable since 1.44.

3 years agoRecord query name when profiling "metadata_decode_entry"
Aaron Hill [Thu, 6 Aug 2020 11:46:31 +0000 (07:46 -0400)]
Record query name when profiling "metadata_decode_entry"

3 years agoAuto merge of #74889 - JohnTitor:hrtb-tests, r=nikomatsakis
bors [Thu, 6 Aug 2020 12:12:59 +0000 (12:12 +0000)]
Auto merge of #74889 - JohnTitor:hrtb-tests, r=nikomatsakis

Add HRTB-related regression test

Closes #59311 and cc #71546
This closes the former but the test is taken from https://github.com/rust-lang/rust/issues/71546#issuecomment-620638437 since it seems they have the same cause and it's simplified.

3 years agoClean up E0747 explanation
Guillaume Gomez [Thu, 6 Aug 2020 11:33:54 +0000 (13:33 +0200)]
Clean up E0747 explanation

3 years agoAdd `as_mut_ptr` to `NonNull<[T]>`
Tim Diekmann [Thu, 6 Aug 2020 09:45:54 +0000 (11:45 +0200)]
Add `as_mut_ptr` to `NonNull<[T]>`

3 years agoNote about endianness of returned value
Lzu Tao [Thu, 6 Aug 2020 07:33:07 +0000 (07:33 +0000)]
Note about endianness of returned value

in {integer}::from_be_bytes and friends.

3 years agoAuto merge of #75008 - eddyb:rmeta-indexed-trait-impls, r=nikomatsakis
bors [Thu, 6 Aug 2020 03:23:57 +0000 (03:23 +0000)]
Auto merge of #75008 - eddyb:rmeta-indexed-trait-impls, r=nikomatsakis

rustc_metadata: track the simplified Self type for every trait impl.

For the `traits_impls_of` query, we index the impls by `fast_reject::SimplifiedType` (a "shallow type"), which allows some simple cases like `impl Trait<..> for Foo<..>` to be efficiently iterated over, by e.g. `for_each_relevant_impl`.

This PR encodes the `fast_reject::SimplifiedType` cross-crate to avoid needing to deserialize the `Self` type of every `impl` in order to simplify it - the simplification itself should be cheap, but the deserialization is less so.

We could go further from here and make loading the list of impls lazy, for a given simplified `Self` type, but that would have more complicated implications for performance, and this PR doesn't do anything in that regard.

r? @nikomatsakis cc @Mark-Simulacrum

3 years agoSuggest f() for functions and add a test case
Joshua Nelson [Thu, 6 Aug 2020 00:46:02 +0000 (20:46 -0400)]
Suggest f() for functions and add a test case

3 years agoKeep stdout open in limit_vector_count test
Tomasz Miąsko [Thu, 6 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Keep stdout open in limit_vector_count test

3 years agoAdd a test for BTreeMap lifetime bound to see if it compiles
Nazım Can Altınova [Wed, 5 Aug 2020 21:07:10 +0000 (23:07 +0200)]
Add a test for BTreeMap lifetime bound to see if it compiles

3 years agoMake IntoIterator lifetime bounds of &BTreeMap match with &HashMap
Nazım Can Altınova [Wed, 5 Aug 2020 15:29:39 +0000 (17:29 +0200)]
Make IntoIterator lifetime bounds of &BTreeMap match with &HashMap

3 years agoAdd a FIXME comment
Yuki Okushi [Wed, 5 Aug 2020 20:21:03 +0000 (05:21 +0900)]
Add a FIXME comment

3 years agoAuto merge of #75166 - JulianKnodt:i64494, r=lcnr
bors [Wed, 5 Aug 2020 20:20:56 +0000 (20:20 +0000)]
Auto merge of #75166 - JulianKnodt:i64494, r=lcnr

Add regression test for #64494

Add regression test to indicate if this compilation ever succeeds.
Fixes #64494

r? @lcnr

3 years agoAuto merge of #75005 - adamreichold:limit-vector-count, r=Amanieu
bors [Wed, 5 Aug 2020 17:58:55 +0000 (17:58 +0000)]
Auto merge of #75005 - adamreichold:limit-vector-count, r=Amanieu

Limit I/O vector count on Unix

Unix systems enforce limits on the vector count when performing vectored I/O via the readv and writev system calls and return EINVAL when these limits are exceeded. This changes the standard library to handle those limits as short reads and writes to avoid forcing its users to query these limits using platform specific mechanisms.

Fixes #68042

3 years agoimpl review
Bastian Kauschke [Wed, 5 Aug 2020 16:27:12 +0000 (18:27 +0200)]
impl review

3 years agoadd tracking issue
Bastian Kauschke [Tue, 28 Jul 2020 14:49:58 +0000 (16:49 +0200)]
add tracking issue

3 years agoforbid complex types for generic parameters
Bastian Kauschke [Tue, 28 Jul 2020 14:18:11 +0000 (16:18 +0200)]
forbid complex types for generic parameters

3 years agoforbid generic params in complex consts
Bastian Kauschke [Tue, 28 Jul 2020 13:55:42 +0000 (15:55 +0200)]
forbid generic params in complex consts

3 years agoadd min_const_generics feature gate
Bastian Kauschke [Wed, 5 Aug 2020 16:27:54 +0000 (18:27 +0200)]
add min_const_generics feature gate

3 years agoAuto merge of #75194 - Aaron1011:feature/macro-backtrace-numbers, r=eddyb
bors [Wed, 5 Aug 2020 16:08:53 +0000 (16:08 +0000)]
Auto merge of #75194 - Aaron1011:feature/macro-backtrace-numbers, r=eddyb

Show backtrace numbers in backtrace whenever more than one is involved

Previously, we only displayed 'frame' numbers in a macro backtrace when more
than two frames were involved. This commit should help make backtrace
more readable, since these kinds of messages can quickly get confusing.

3 years agoAdd fallback for cfg(unix) targets that do not define libc::_SC_IOV_MAX.
Adam Reichold [Wed, 5 Aug 2020 14:56:51 +0000 (16:56 +0200)]
Add fallback for cfg(unix) targets that do not define libc::_SC_IOV_MAX.

3 years agoShow backtrace numbers in backtrace whenever more than one is involved
Aaron Hill [Wed, 5 Aug 2020 15:02:25 +0000 (11:02 -0400)]
Show backtrace numbers in backtrace whenever more than one is involved

Previously, we only displayed 'frame' numbers in a macro backtrace when more
than two frames were involved. This commit should help make backtrace
more readable, since these kinds of messages can quickly get confusing.

3 years agoRely only on POSIX semantics for I/O vector count
Adam Reichold [Sat, 1 Aug 2020 14:06:00 +0000 (16:06 +0200)]
Rely only on POSIX semantics for I/O vector count

All #[cfg(unix)] platforms follow the POSIX standard and define _SC_IOV_MAX so
that we rely purely on POSIX semantics to determine the limits on I/O vector
count.

3 years agoReduce synchronization overhead of I/O vector count memoization
Adam Reichold [Sat, 1 Aug 2020 13:38:08 +0000 (15:38 +0200)]
Reduce synchronization overhead of I/O vector count memoization

3 years agoMemoize the I/O vector count limit
Adam Reichold [Sat, 1 Aug 2020 12:29:42 +0000 (14:29 +0200)]
Memoize the I/O vector count limit

Keep the I/O vector count limit in a `SyncOnceCell` to avoid the overhead of
repeatedly calling `sysconf` as these limits are guaranteed to not change during
the lifetime of a process by POSIX.

3 years agoQuery maximum vector count on Linux and macOS
Adam Reichold [Sat, 1 Aug 2020 12:18:11 +0000 (14:18 +0200)]
Query maximum vector count on Linux and macOS

Both Linux and MacOS enforce limits on the vector count when performing vectored
I/O via the readv and writev system calls and return EINVAL when these limits
are exceeded. This changes the standard library to handle those limits as short
reads and writes to avoid forcing its users to query these limits using
platform specific mechanisms.

3 years agoAuto merge of #75165 - JulianKnodt:i72787, r=lcnr
bors [Wed, 5 Aug 2020 14:00:00 +0000 (14:00 +0000)]
Auto merge of #75165 - JulianKnodt:i72787, r=lcnr

Add regression test for #72787

Add regression test for Issue #72787
Fixes #72787

~~Still waiting on running tests locally to bless the error output~~

r? @lcnr

3 years agoClean up E0746 explanation
Guillaume Gomez [Wed, 5 Aug 2020 12:14:21 +0000 (14:14 +0200)]
Clean up E0746 explanation

3 years agoHandle fieldless tuple structs in diagnostic code
Aaron Hill [Wed, 5 Aug 2020 11:59:26 +0000 (07:59 -0400)]
Handle fieldless tuple structs in diagnostic code

Fixes #75062

3 years agoAuto merge of #75169 - ehuss:update-cargo, r=ehuss
bors [Wed, 5 Aug 2020 11:17:36 +0000 (11:17 +0000)]
Auto merge of #75169 - ehuss:update-cargo, r=ehuss

Update cargo

8 commits in 2d5c2381e4e50484bf281fc1bfe19743aa9eb37a..1653f354644834073d6d2541e27fae94588e685e
2020-07-31 21:56:08 +0000 to 2020-08-04 23:14:37 +0000
- Fix close_output test. (rust-lang/cargo#8587)
- clippy fixes, use matches! macro in more places (rust-lang/cargo#8575)
- Display embedded man pages for built-in commands. (rust-lang/cargo#8456)
- Add mdman for generating man pages. (rust-lang/cargo#8577)
- Fix typo 'more then' -&gt; 'more than' in error and comments (rust-lang/cargo#8581)
- cargo login: make login message less ambiguous (rust-lang/cargo#8579)
- Fix broken link in Build Cache chapter. (rust-lang/cargo#8578)
- Fix intra-doc tests for renamed lint. (rust-lang/cargo#8576)

3 years agoAuto merge of #75124 - nnethercote:clean-up-rustdoc-main, r=oli-obk
bors [Wed, 5 Aug 2020 09:09:17 +0000 (09:09 +0000)]
Auto merge of #75124 - nnethercote:clean-up-rustdoc-main, r=oli-obk

Clean up rustdoc's `main()`

It can be simplified and made more similar to rustc's `main()`.

r? @oli-obk

3 years agoLabel rustfmt toolstate issues with A-rustfmt
Aaron Hill [Wed, 5 Aug 2020 09:03:08 +0000 (05:03 -0400)]
Label rustfmt toolstate issues with A-rustfmt

This makes it easier to filter toolstate issues by the tool involved.

3 years agoFix typo in `librustc_feature/active.rs`
Waffle Lapkin [Wed, 5 Aug 2020 08:02:47 +0000 (11:02 +0300)]
Fix typo in  `librustc_feature/active.rs`

3 years agoAuto merge of #75155 - davidtwco:polymorphization-incr-comp-optimisations, r=lcnr
bors [Wed, 5 Aug 2020 06:55:42 +0000 (06:55 +0000)]
Auto merge of #75155 - davidtwco:polymorphization-incr-comp-optimisations, r=lcnr

polymorphization: various improvements

This PR includes a handful of polymorphisation-related changes:

- @Mark-Simulacrum's suggestions [from this comment](https://github.com/rust-lang/rust/pull/74633#issuecomment-668684433):
    - Use a `FiniteBitSet<u32>` over a `FiniteBitSet<u64>` as most functions won't have 64 generic parameters.
    - Don't encode polymorphisation results in metadata when every parameter is used (in this case, just invoking polymorphisation will probably be quicker).
- @lcnr's suggestion [from this comment](https://github.com/rust-lang/rust/pull/74717#discussion_r463690015).
    - Add an debug assertion in `ensure_monomorphic_enough` to make sure that polymorphisation did what we expect.

r? @lcnr

3 years agoRemove unused FromInner impl for Ipv4Addr
Lzu Tao [Wed, 5 Aug 2020 05:53:07 +0000 (05:53 +0000)]
Remove unused FromInner impl for Ipv4Addr

3 years agoMake doctests of Ipv4Addr::from(u32) easier to read
Lzu Tao [Wed, 5 Aug 2020 05:31:17 +0000 (05:31 +0000)]
Make doctests of Ipv4Addr::from(u32) easier to read

3 years agoAuto merge of #75037 - richkadel:llvm-coverage-map-gen-5.2, r=wesleywiser
bors [Wed, 5 Aug 2020 05:08:19 +0000 (05:08 +0000)]
Auto merge of #75037 - richkadel:llvm-coverage-map-gen-5.2, r=wesleywiser

Completes support for coverage in external crates

Follow-up to #74959 :

The prior PR corrected for errors encountered when trying to generate
the coverage map on source code inlined from external crates (including
macros and generics) by avoiding adding external DefIds to the coverage
map.

This made it possible to generate a coverage report including external
crates, but the external crate coverage was incomplete (did not include
coverage for the DefIds that were eliminated.

The root issue was that the coverage map was converting Span locations
to source file and locations, using the SourceMap for the current crate,
and this would not work for spans from external crates (compliled with a
different SourceMap).

The solution was to convert the Spans to filename and location during
MIR generation instead, so precompiled external crates would already
have the correct source code locations embedded in their MIR, when
imported into another crate.

@wesleywiser FYI
r? @tmandry

3 years agoUnresolved link -> incompatible link kind
Joshua Nelson [Wed, 5 Aug 2020 03:39:18 +0000 (23:39 -0400)]
Unresolved link -> incompatible link kind

Clearly it has been resolved, because we say on the next line what it
resolved to.

3 years agoGive a much better error message if the struct failed to resolve
Joshua Nelson [Wed, 5 Aug 2020 03:31:36 +0000 (23:31 -0400)]
Give a much better error message if the struct failed to resolve