]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge branch 'master' into feature/incorporate-tracing
pawanbisht62 [Mon, 10 Aug 2020 07:49:24 +0000 (13:19 +0530)]
Merge branch 'master' into feature/incorporate-tracing

3 years agoAuto merge of #74410 - mati865:mingw-no-self-contained-when-cross-compiling, r=petroc...
bors [Mon, 10 Aug 2020 02:08:35 +0000 (02:08 +0000)]
Auto merge of #74410 - mati865:mingw-no-self-contained-when-cross-compiling, r=petrochenkov

MinGW: disable self-contained mode when cross compiling

When cross compiling users have to provide own linker and libraries anyway.
Using rust provided MinGW crt objects is harmful here and has no benefits.

cc https://github.com/rust-lang/rust/issues/68887

3 years agoAuto merge of #75351 - JohnTitor:rollup-q9udsyx, r=JohnTitor
bors [Mon, 10 Aug 2020 00:09:45 +0000 (00:09 +0000)]
Auto merge of #75351 - JohnTitor:rollup-q9udsyx, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #74200 (Std panicking unsafe block in unsafe fn)
 - #75286 (Add additional case for Path starts with)
 - #75318 (Resolve `char` as a primitive even if there is a module in scope)
 - #75320 (Detect likely `for foo of bar` JS syntax)
 - #75328 (Cleanup E0749)
 - #75344 (Rename "Important traits" to "Notable traits")
 - #75348 (Move to intra-doc links in library/core/src/time.rs)
 - #75350 (Do not ICE when lowering invalid extern fn with bodies)

Failed merges:

r? @ghost

3 years agoRollup merge of #75350 - estebank:foreign-fn-with-body-ice, r=davidtwco
Yuki Okushi [Mon, 10 Aug 2020 00:08:03 +0000 (09:08 +0900)]
Rollup merge of #75350 - estebank:foreign-fn-with-body-ice, r=davidtwco

Do not ICE when lowering invalid extern fn with bodies

Fix #75283.

3 years agoRollup merge of #75348 - denisvasilik:intra-doc-links-core-time, r=jyn514
Yuki Okushi [Mon, 10 Aug 2020 00:08:01 +0000 (09:08 +0900)]
Rollup merge of #75348 - denisvasilik:intra-doc-links-core-time, r=jyn514

Move to intra-doc links in library/core/src/time.rs

Helps with #75080.

3 years agoRollup merge of #75344 - camelid:rename-important-to-notable-traits, r=Manishearth
Yuki Okushi [Mon, 10 Aug 2020 00:07:59 +0000 (09:07 +0900)]
Rollup merge of #75344 - camelid:rename-important-to-notable-traits, r=Manishearth

Rename "Important traits" to "Notable traits"

Fixes #75245.

---

* Rename it in the UI
* Rename the CSS classes

3 years agoRollup merge of #75328 - GuillaumeGomez:cleanup-e0749, r=Dylan-DPC
Yuki Okushi [Mon, 10 Aug 2020 00:07:57 +0000 (09:07 +0900)]
Rollup merge of #75328 - GuillaumeGomez:cleanup-e0749, r=Dylan-DPC

Cleanup E0749

r? @pickfire

3 years agoRollup merge of #75320 - estebank:js-for-i-of-x, r=davidtwco
Yuki Okushi [Mon, 10 Aug 2020 00:07:56 +0000 (09:07 +0900)]
Rollup merge of #75320 - estebank:js-for-i-of-x, r=davidtwco

Detect likely `for foo of bar` JS syntax

Fix #75311.

3 years agoRollup merge of #75318 - jyn514:primitive, r=manishearth
Yuki Okushi [Mon, 10 Aug 2020 00:07:54 +0000 (09:07 +0900)]
Rollup merge of #75318 - jyn514:primitive, r=manishearth

Resolve `char` as a primitive even if there is a module in scope

Closes https://github.com/rust-lang/rust/issues/58699.
r? @Manishearth

3 years agoRollup merge of #75286 - pickfire:patch-9, r=jyn514
Yuki Okushi [Mon, 10 Aug 2020 00:07:52 +0000 (09:07 +0900)]
Rollup merge of #75286 - pickfire:patch-9, r=jyn514

Add additional case for Path starts with

Show what happens if there is an extra extension

3 years agoRollup merge of #74200 - poliorcetics:std-panicking-unsafe-block-in-unsafe-fn, r...
Yuki Okushi [Mon, 10 Aug 2020 00:07:46 +0000 (09:07 +0900)]
Rollup merge of #74200 - poliorcetics:std-panicking-unsafe-block-in-unsafe-fn, r=Mark-Simulacrum

Std panicking unsafe block in unsafe fn

Partial fix of #73904.

This encloses `unsafe` operations in `unsafe fn` in `libstd/ffi/panicking.rs`.

I also made a two lines change to `libstd/thread/local.rs` to add the necessary `unsafe` block without breaking everything else.

@rustbot modify labels: F-unsafe-block-in-unsafe-fn

3 years agoDo not ICE when lowering invalid extern fn with bodies
Esteban Küber [Sun, 9 Aug 2020 22:12:59 +0000 (15:12 -0700)]
Do not ICE when lowering invalid extern fn with bodies

Fix #75283.

3 years agoAuto merge of #75345 - Aaron1011:fix/no-std-hygiene, r=petrochenkov
bors [Sun, 9 Aug 2020 22:08:02 +0000 (22:08 +0000)]
Auto merge of #75345 - Aaron1011:fix/no-std-hygiene, r=petrochenkov

Remove normalization of `Span` debug output in proc-macro tests

Fixes #74800

The definition of `is_x86_feature_detected!` (and similar macros)
depends on the platform - it is produced by a `cfg_if!` invocation on
x86, and a plain `#[cfg]` on other platforms. Since it is part of the
prelude, we will end up importing different hygiene information
depending on the platform. This previously required us to avoid printing raw
`SyntaxContext` ids in any tests that uses the standard library, since
the captured output will be platform-dependent.

Previously, we replaced all `SyntaxContext` ids with "#CTXT", and the
raw `Span` lo/hi bytes with "LO..HI".

This commit adds `#![no_std]` and `extern crate std` to all proc-macro
tests that print spans. This suppresses the prelude import, while
still using lang items from `std` (which gives us a buildable binary).
With this apporach, we will only load hygiene information for things
which we explicitly import. This lets us re-add
`-Z unpretty=expanded,hygiene`, since its output can now be made stable
across all platforms.

Additionally, we use `-Z span-debug` in more places, which lets us avoid
the "LO..HI" normalization hack.

3 years agoAdd link for Duration
Denis Vasilik [Sun, 9 Aug 2020 21:26:42 +0000 (23:26 +0200)]
Add link for Duration

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRemove liNone as it is in the prelude
Denis Vasilik [Sun, 9 Aug 2020 21:12:30 +0000 (23:12 +0200)]
Remove liNone as it is in the prelude

3 years agoAuto merge of #75278 - cuviper:indexmap, r=Mark-Simulacrum
bors [Sun, 9 Aug 2020 20:08:50 +0000 (20:08 +0000)]
Auto merge of #75278 - cuviper:indexmap, r=Mark-Simulacrum

Upgrade indexmap and use it more

First this upgrades `indexmap` to 1.5.1, which is now based on `hashbrown::raw::RawTable`. This means it shares a lot of the same performance characteristics for insert, lookup, etc., while keeping items in insertion order.

Then across various rustc crates, this replaces a lot of `Vec`+`HashMap` pairs with a single `IndexMap` or `IndexSet`.

Closes #60608.
r? @eddyb

3 years agorustc_span: note the perf loss seen from IndexSet in symbol::Interner
Josh Stone [Sun, 9 Aug 2020 19:41:09 +0000 (12:41 -0700)]
rustc_span: note the perf loss seen from IndexSet in symbol::Interner

3 years agorustc_typeck: use IndexSet in InteriorVisitor
Josh Stone [Sat, 8 Aug 2020 03:55:01 +0000 (20:55 -0700)]
rustc_typeck: use IndexSet in InteriorVisitor

3 years agorustc_typeck: use IndexSet in UniquePredicates
Josh Stone [Sat, 8 Aug 2020 03:54:09 +0000 (20:54 -0700)]
rustc_typeck: use IndexSet in UniquePredicates

3 years agorustc_span: use IndexSet in SpanInterner
Josh Stone [Sat, 8 Aug 2020 03:50:53 +0000 (20:50 -0700)]
rustc_span: use IndexSet in SpanInterner

3 years agorustc_mir_build: use IndexMap in TestKind::SwitchInt
Josh Stone [Sat, 8 Aug 2020 03:49:51 +0000 (20:49 -0700)]
rustc_mir_build: use IndexMap in TestKind::SwitchInt

3 years agorustc_mir: use IndexSet in PlaceholderIndices
Josh Stone [Sat, 8 Aug 2020 03:48:00 +0000 (20:48 -0700)]
rustc_mir: use IndexSet in PlaceholderIndices

3 years agorustc_mir: use IndexMap in BorrowSet
Josh Stone [Sat, 8 Aug 2020 03:47:33 +0000 (20:47 -0700)]
rustc_mir: use IndexMap in BorrowSet

3 years agorustc_middle: use IndexSet in OnDiskCache
Josh Stone [Sat, 8 Aug 2020 03:44:47 +0000 (20:44 -0700)]
rustc_middle: use IndexSet in OnDiskCache

3 years agorustc_metadata: use IndexSet in EncodeContext
Josh Stone [Sat, 8 Aug 2020 03:44:12 +0000 (20:44 -0700)]
rustc_metadata: use IndexSet in EncodeContext

3 years agorustc_data_structures: use IndexSet in TransitiveRelation
Josh Stone [Sat, 8 Aug 2020 03:43:18 +0000 (20:43 -0700)]
rustc_data_structures: use IndexSet in TransitiveRelation

3 years agorustc_codegen_llvm: use IndexSet in CoverageMapGenerator
Josh Stone [Sat, 8 Aug 2020 03:42:29 +0000 (20:42 -0700)]
rustc_codegen_llvm: use IndexSet in CoverageMapGenerator

3 years agoUpgrade indexmap to 1.5.1, now using hashbrown!
Josh Stone [Sat, 8 Aug 2020 00:03:47 +0000 (17:03 -0700)]
Upgrade indexmap to 1.5.1, now using hashbrown!

3 years agoUse intra-doc links
Denis Vasilik [Sun, 9 Aug 2020 19:20:57 +0000 (21:20 +0200)]
Use intra-doc links

3 years agoRename "Important traits" to "Notable traits"
Camelid [Sun, 9 Aug 2020 19:09:05 +0000 (12:09 -0700)]
Rename "Important traits" to "Notable traits"

* Rename it in the UI
* Rename the CSS classes

3 years agoRemove normalization of `Span` debug output in proc-macro tests
Aaron Hill [Sun, 9 Aug 2020 17:36:31 +0000 (13:36 -0400)]
Remove normalization of `Span` debug output in proc-macro tests

Fixes #74800

The definition of `is_x86_feature_detected!` (and similar macros)
depends on the platform - it is produced by a `cfg_if!` invocation on
x86, and a plain `#[cfg]` on other platforms. Since it is part of the
prelude, we will end up importing different hygiene information
depending on the platform. This previously required us to avoid printing raw
`SyntaxContext` ids in any tests that uses the standard library, since
the captured output will be platform-dependent.

Previously, we replaced all `SyntaxContext` ids with "#CTXT", and the
raw `Span` lo/hi bytes with "LO..HI".

This commit adds `#![no_std]` and `extern crate std` to all proc-macro
tests that print spans. This suppresses the prelude import, while
still using lang items from `std` (which gives us a buildable binary).
With this apporach, we will only load hygiene information for things
which we explicitly import. This lets us re-add
`-Z unpretty=expanded,hygiene`, since its output can now be made stable
across all platforms.

Additionally, we use `-Z span-debug` in more places, which lets us avoid
the "LO..HI" normalization hack.

3 years agoAuto merge of #75137 - Aaron1011:fix/hygiene-skip-expndata, r=petrochenkov
bors [Sun, 9 Aug 2020 18:19:34 +0000 (18:19 +0000)]
Auto merge of #75137 - Aaron1011:fix/hygiene-skip-expndata, r=petrochenkov

Don't serialize ExpnData for foreign crates

When we encode an ExpnId into the crate metadata, we write out the
CrateNum of the crate that 'owns' the corresponding `ExpnData`, which
is later used to decode the `ExpnData` from its owning crate.

However, we current serialize the `ExpnData` for all `ExpnIds` that we
serialize, even if the `ExpnData` was already serialized into a foreign
crate. This commit skips encoding this kind of `ExpnData`, which should
hopefully speed up metadata encoding and reduce the total metadata size.

3 years agoshow multiple slashes starts_with Path example
Ivan Tham [Sun, 9 Aug 2020 16:43:45 +0000 (00:43 +0800)]
show multiple slashes starts_with Path example

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoAuto merge of #75134 - Aaron1011:feature/expn-data-parent-hash, r=petrochenkov
bors [Sun, 9 Aug 2020 14:29:42 +0000 (14:29 +0000)]
Auto merge of #75134 - Aaron1011:feature/expn-data-parent-hash, r=petrochenkov

Hash parent ExpnData

cc https://github.com/rust-lang/rust/pull/72121#discussion_r460528326

3 years agoAdd comment about the lack of `ExpnData` serialization for proc-macro crates
Aaron Hill [Sun, 9 Aug 2020 12:42:41 +0000 (08:42 -0400)]
Add comment about the lack of `ExpnData` serialization for proc-macro crates

3 years agoGive precedence to primitives over modules
Joshua Nelson [Sun, 9 Aug 2020 04:02:08 +0000 (00:02 -0400)]
Give precedence to primitives over modules

This has less surprising behavior when there is a module with the same
name as a primitive in scope.

3 years agoAuto merge of #75293 - poliorcetics:intra-doc-links-std-path, r=jyn514
bors [Sun, 9 Aug 2020 12:31:03 +0000 (12:31 +0000)]
Auto merge of #75293 - poliorcetics:intra-doc-links-std-path, r=jyn514

Move to intra-doc links in library/std/src/path.rs

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

Known issue: The following links are broken (they are inside trait impls, undocumented in this file, inheriting from the original doc):

- [`Hasher`]
- [`Self`] (referencing `../primitive.slice.html`)
- [`Ordering`]

3 years agoRemove E0749 from untested error codes
Guillaume Gomez [Sun, 9 Aug 2020 11:15:33 +0000 (13:15 +0200)]
Remove E0749 from untested error codes

3 years agoClean up E0749 explanation
Guillaume Gomez [Sun, 9 Aug 2020 11:13:56 +0000 (13:13 +0200)]
Clean up E0749 explanation

3 years agoAuto merge of #75310 - petrochenkov:needwasm, r=Mark-Simulacrum
bors [Sun, 9 Aug 2020 08:52:53 +0000 (08:52 +0000)]
Auto merge of #75310 - petrochenkov:needwasm, r=Mark-Simulacrum

tests: Mark `ui/asm/bad-arch.rs` as requiring wasm llvm backend

So it doesn't fail when not all LLVM backends are built.

3 years agotests: Mark `ui/asm/bad-arch.rs` as requiring wasm llvm backend
Vadim Petrochenkov [Sat, 8 Aug 2020 22:09:23 +0000 (01:09 +0300)]
tests: Mark `ui/asm/bad-arch.rs` as requiring wasm llvm backend

3 years agoDetect likely `for foo of bar` JS syntax
Esteban Küber [Sun, 9 Aug 2020 03:53:40 +0000 (20:53 -0700)]
Detect likely `for foo of bar` JS syntax

Fix #75311.

3 years agoAuto merge of #75280 - overdrivenpotato:psp-unwind, r=dtolnay
bors [Sun, 9 Aug 2020 03:07:00 +0000 (03:07 +0000)]
Auto merge of #75280 - overdrivenpotato:psp-unwind, r=dtolnay

Add back unwinding support for Sony PSP

This PR adds back unwinding support for the Sony PSP. The `mipsel-sony-psp` target works well with unwinding. In [rust-psp], we use the `panic_unwind` crate along with LLVM's libunwind to catch panics, run destructors, and print them to the debug screen without aborting all threads.

[rust-psp]: https://github.com/overdrivenpotato/rust-psp

3 years agoAuto merge of #75306 - Amanieu:hashbrown8, r=Mark-Simulacrum
bors [Sun, 9 Aug 2020 01:05:56 +0000 (01:05 +0000)]
Auto merge of #75306 - Amanieu:hashbrown8, r=Mark-Simulacrum

Update hashbrown to 0.8.2

Includes:
- Avoid closures to improve compile times (https://github.com/rust-lang/hashbrown/pull/183)
- Do not iterate to drop if empty (https://github.com/rust-lang/hashbrown/pull/182)

r? @Mark-Simulacrum

3 years agoAuto merge of #75308 - JohnTitor:rollup-vnnny43, r=JohnTitor
bors [Sat, 8 Aug 2020 23:05:49 +0000 (23:05 +0000)]
Auto merge of #75308 - JohnTitor:rollup-vnnny43, r=JohnTitor

Rollup of 15 pull requests

Successful merges:

 - #74712 (Update E0271 explanation)
 - #74842 (adjust remaining targets)
 - #75151 (Consistent variable name alloc for raw_vec)
 - #75162 (Fix the documentation for move about Fn traits implementations)
 - #75248 (Add `as_mut_ptr` to `NonNull<[T]>`)
 - #75262 (Show multi extension example for Path in doctests)
 - #75266 (Add safety section to `NonNull::as_*` method docs)
 - #75284 (Show relative example for Path ancestors)
 - #75285 (Separate example for Path strip_prefix)
 - #75287 (Show Path extension example change multi extension)
 - #75288 (Use assert! for Path exists example to check bool)
 - #75289 (Remove ambiguity from PathBuf pop example)
 - #75290 (fix `min_const_generics` version)
 - #75291 (Clean up E0750)
 - #75292 (Clean up E0502)

Failed merges:

r? @ghost

3 years agoRollup merge of #75292 - slanterns:cleanup-E0502, r=GuillaumeGomez
Yuki Okushi [Sat, 8 Aug 2020 21:41:39 +0000 (06:41 +0900)]
Rollup merge of #75292 - slanterns:cleanup-E0502, r=GuillaumeGomez

Clean up E0502

`ref` on an entire `let` pattern is discouraged, take a reference with `&` instead.

3 years agoRollup merge of #75291 - GuillaumeGomez:cleanup-e0750, r=pickfire
Yuki Okushi [Sat, 8 Aug 2020 21:41:37 +0000 (06:41 +0900)]
Rollup merge of #75291 - GuillaumeGomez:cleanup-e0750, r=pickfire

Clean up E0750

r? @Dylan-DPC

3 years agoRollup merge of #75290 - rust-lang:min_const_generics-version, r=jonas-schievink
Yuki Okushi [Sat, 8 Aug 2020 21:41:35 +0000 (06:41 +0900)]
Rollup merge of #75290 - rust-lang:min_const_generics-version, r=jonas-schievink

fix `min_const_generics` version

https://github.com/rust-lang/rust/pull/74877#discussion_r467451813

> This should be 1.47.0

3 years agoRollup merge of #75289 - pickfire:patch-12, r=jonas-schievink
Yuki Okushi [Sat, 8 Aug 2020 21:41:33 +0000 (06:41 +0900)]
Rollup merge of #75289 - pickfire:patch-12, r=jonas-schievink

Remove ambiguity from PathBuf pop example

3 years agoRollup merge of #75288 - pickfire:patch-11, r=jonas-schievink
Yuki Okushi [Sat, 8 Aug 2020 21:41:32 +0000 (06:41 +0900)]
Rollup merge of #75288 - pickfire:patch-11, r=jonas-schievink

Use assert! for Path exists example to check bool

3 years agoRollup merge of #75287 - pickfire:patch-10, r=jonas-schievink
Yuki Okushi [Sat, 8 Aug 2020 21:41:30 +0000 (06:41 +0900)]
Rollup merge of #75287 - pickfire:patch-10, r=jonas-schievink

Show Path extension example change multi extension

3 years agoRollup merge of #75285 - pickfire:patch-8, r=jonas-schievink
Yuki Okushi [Sat, 8 Aug 2020 21:41:28 +0000 (06:41 +0900)]
Rollup merge of #75285 - pickfire:patch-8, r=jonas-schievink

Separate example for Path strip_prefix

3 years agoRollup merge of #75284 - pickfire:patch-7, r=LukasKalbertodt
Yuki Okushi [Sat, 8 Aug 2020 21:41:27 +0000 (06:41 +0900)]
Rollup merge of #75284 - pickfire:patch-7, r=LukasKalbertodt

Show relative example for Path ancestors

3 years agoRollup merge of #75266 - aticu:master, r=RalfJung
Yuki Okushi [Sat, 8 Aug 2020 21:41:25 +0000 (06:41 +0900)]
Rollup merge of #75266 - aticu:master, r=RalfJung

Add safety section to `NonNull::as_*` method docs

This basically adds the safety section of `*mut T::as_{ref,mut}` to the
same methods on `NonNull` with minor modifications to fit the
differences.

Part of #48929.

3 years agoRollup merge of #75262 - pickfire:patch-6, r=jyn514
Yuki Okushi [Sat, 8 Aug 2020 21:41:23 +0000 (06:41 +0900)]
Rollup merge of #75262 - pickfire:patch-6, r=jyn514

Show multi extension example for Path in doctests

3 years agoRollup merge of #75248 - TimDiekmann:NonNull-as_mut_ptr, r=RalfJung
Yuki Okushi [Sat, 8 Aug 2020 21:41:22 +0000 (06:41 +0900)]
Rollup merge of #75248 - TimDiekmann:NonNull-as_mut_ptr, r=RalfJung

Add `as_mut_ptr` to `NonNull<[T]>`

Adds `as_mut_ptr` to shortcut converting a `NonNull<[T]>` to `*mut T` as proposed in https://github.com/rust-lang/rust/issues/74265#issuecomment-669702969.

r? @RalfJung

3 years agoRollup merge of #75162 - poliorcetics:move-documentation-fix, r=jyn514
Yuki Okushi [Sat, 8 Aug 2020 21:41:20 +0000 (06:41 +0900)]
Rollup merge of #75162 - poliorcetics:move-documentation-fix, r=jyn514

Fix the documentation for move about Fn traits implementations

Fixes #74997.

This uses the note from the [reference](https://doc.rust-lang.org/reference/types/closure.html#call-traits-and-coercions) but I can also just put a link to it or do both.

@rusbot modify labels: C-bug T-doc T-libs

3 years agoRollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodt
Yuki Okushi [Sat, 8 Aug 2020 21:41:18 +0000 (06:41 +0900)]
Rollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodt

Consistent variable name alloc for raw_vec

3 years agoRollup merge of #74842 - hermitcore:thread_local, r=Mark-Simulacrum
Yuki Okushi [Sat, 8 Aug 2020 21:41:16 +0000 (06:41 +0900)]
Rollup merge of #74842 - hermitcore:thread_local, r=Mark-Simulacrum

adjust remaining targets

- fix commit 7dc3886
- previous commit doesn't adjust all targets

3 years agoRollup merge of #74712 - strom-und-spiele:E0271-cleanup, r=Mark-Simulacrum
Yuki Okushi [Sat, 8 Aug 2020 21:41:14 +0000 (06:41 +0900)]
Rollup merge of #74712 - strom-und-spiele:E0271-cleanup, r=Mark-Simulacrum

Update E0271 explanation

When reading the explanation, I got confused by it. I hope the wording is clearer now.

3 years agoAuto merge of #75271 - cuviper:array-iter, r=LukasKalbertodt
bors [Sat, 8 Aug 2020 20:43:21 +0000 (20:43 +0000)]
Auto merge of #75271 - cuviper:array-iter, r=LukasKalbertodt

Simplify array::IntoIter

- Initialization can use `transmute_copy` to do the bitwise copy.
- `as_slice` can use `get_unchecked` and `MaybeUninit::slice_get_ref`,
  and `as_mut_slice` can do similar.
- `next` and `next_back` can use the corresponding `Range` methods.
- `Clone` doesn't need any unsafety, and we can dynamically update the
  new range to get partial drops if `T::clone` panics.

r? @LukasKalbertodt

3 years agoRemove E0750 from unchecked error codes
Guillaume Gomez [Sat, 8 Aug 2020 12:00:36 +0000 (14:00 +0200)]
Remove E0750 from unchecked error codes

3 years agoClean up E0750 explanation
Guillaume Gomez [Sat, 8 Aug 2020 11:59:54 +0000 (13:59 +0200)]
Clean up E0750 explanation

3 years agoAuto merge of #75163 - canova:map_into_keys_values, r=dtolnay
bors [Sat, 8 Aug 2020 18:15:50 +0000 (18:15 +0000)]
Auto merge of #75163 - canova:map_into_keys_values, r=dtolnay

Implement `into_keys` and `into_values` for associative maps

This PR implements `into_keys` and `into_values` for HashMap and BTreeMap types. They are implemented as unstable, under `map_into_keys_values` feature.
Fixes #55214.
r? @dtolnay

3 years agoAuto merge of #75260 - davidtwco:polymorphization-promoted-substs, r=lcnr
bors [Sat, 8 Aug 2020 15:57:12 +0000 (15:57 +0000)]
Auto merge of #75260 - davidtwco:polymorphization-promoted-substs, r=lcnr

polymorphize: unevaluated constants

This PR makes polymorphization visit the promoted MIR of unevaluated constants with available promoted MIR instead of visiting the substitutions of that constant - which will mark all of the generic parameters as used; in addition polymorphization will now visit non-promoted unevaluated constants rather than visit their substs.

r? @lcnr

3 years agoUpdate the tracking issue number of map_into_keys_values
Nazım Can Altınova [Sat, 8 Aug 2020 14:34:42 +0000 (16:34 +0200)]
Update the tracking issue number of map_into_keys_values

3 years agoUpdate hashbrown to 0.8.2
Amanieu d'Antras [Sat, 8 Aug 2020 14:03:47 +0000 (15:03 +0100)]
Update hashbrown to 0.8.2

3 years agoAdd an example about the behaviour of move and Fn* traits
Alexis Bourget [Sat, 8 Aug 2020 13:57:17 +0000 (15:57 +0200)]
Add an example about the behaviour of move and Fn* traits

3 years agoRemove min/max values from IntoValues Iterator implementation
Nazım Can Altınova [Sat, 8 Aug 2020 13:39:26 +0000 (15:39 +0200)]
Remove min/max values from IntoValues Iterator implementation

3 years agoAuto merge of #74533 - nikic:issue-74425, r=eddyb
bors [Sat, 8 Aug 2020 13:33:53 +0000 (13:33 +0000)]
Auto merge of #74533 - nikic:issue-74425, r=eddyb

Emit == null instead of <= null for niche check

When the niche maximum is zero, emit a "== zero" check instead of a "<= zero" check. In particular, this avoids the awkward case of "<= null". While LLVM does canonicalize this to "== null", this apparently doesn't happen for constant expressions, leading to the issue in #74425. While that can be addressed on the LLVM side, it still seems prudent to emit sensible IR here, because this will allow null checks to be optimized earlier in the pipeline.

Fixes #74425.

3 years agoUse `&` instead of `let ref` in E0502
Slanterns [Sat, 8 Aug 2020 12:26:56 +0000 (20:26 +0800)]
Use `&` instead of `let ref` in E0502

`ref` on an entire `let` pattern is discouraged, take a reference with `&` instead.

3 years agoMove to intra-doc links in library/std/src/path.rs
Alexis Bourget [Sat, 8 Aug 2020 12:21:27 +0000 (14:21 +0200)]
Move to intra-doc links in library/std/src/path.rs

3 years agoAdd safety section to `NonNull::as_*` method docs
aticu [Fri, 7 Aug 2020 18:58:34 +0000 (20:58 +0200)]
Add safety section to `NonNull::as_*` method docs

This basically adds the safety section of `*mut T::as_{ref,mut}` to the
same methods on `NonNull` with minor modifications to fit the
differences.

Part of #48929.

3 years agofix `min_const_generics` version
Bastian Kauschke [Sat, 8 Aug 2020 11:35:42 +0000 (13:35 +0200)]
fix `min_const_generics` version

3 years agoAuto merge of #74289 - lzutao:unroll, r=LukasKalbertodt
bors [Sat, 8 Aug 2020 11:34:18 +0000 (11:34 +0000)]
Auto merge of #74289 - lzutao:unroll, r=LukasKalbertodt

Remove some redundant parts from `unrolled_find_u16s`

See each commit message for details.

r? @wesleywiser from old PR #67705 .

3 years agoRemove abmiguity from PathBuf pop example
Ivan Tham [Sat, 8 Aug 2020 10:28:55 +0000 (18:28 +0800)]
Remove abmiguity from PathBuf pop example

3 years agoUse assert! for Path exists example to check bool
Ivan Tham [Sat, 8 Aug 2020 10:23:18 +0000 (18:23 +0800)]
Use assert! for Path exists example to check bool

3 years agoShow Path extension example change multi extension
Ivan Tham [Sat, 8 Aug 2020 10:14:29 +0000 (18:14 +0800)]
Show Path extension example change multi extension

3 years agoAdd additonal case for Path starts with
Ivan Tham [Sat, 8 Aug 2020 10:06:04 +0000 (18:06 +0800)]
Add additonal case for Path starts with

Show what happens if there is an extra extension

3 years agoSeparate example for Path strip_prefix
Ivan Tham [Sat, 8 Aug 2020 10:01:34 +0000 (18:01 +0800)]
Separate example for Path strip_prefix

3 years agoShow relative example for Path ancestors
Ivan Tham [Sat, 8 Aug 2020 09:53:16 +0000 (17:53 +0800)]
Show relative example for Path ancestors

3 years agoAuto merge of #75282 - RalfJung:miri-black-box, r=oli-obk
bors [Sat, 8 Aug 2020 09:46:16 +0000 (09:46 +0000)]
Auto merge of #75282 - RalfJung:miri-black-box, r=oli-obk

do not call black_box on Miri

Helps with https://github.com/rust-lang/rust/issues/75274 (but https://github.com/rust-lang/rust/pull/74932 introduced unrelated breakage that will need a separate fix)
Cc @eggyal r? @Mark-Simulacrum

3 years agoUpdate E0271.md
strom-und-spiele [Fri, 24 Jul 2020 12:15:21 +0000 (14:15 +0200)]
Update E0271.md

remove references to non existing code,
expand solution suggestions
remove unneeded code in solution

3 years agomake black_box a NOP in Miri
Ralf Jung [Sat, 8 Aug 2020 08:36:16 +0000 (10:36 +0200)]
make black_box a NOP in Miri

3 years agoEmit == null instead of <= null
Nikita Popov [Sun, 19 Jul 2020 18:57:49 +0000 (20:57 +0200)]
Emit == null instead of <= null

When the niche maximum is zero, emit a "== zero" check instead of
a "<= zero" check. In particular, this avoid the awkward case of
"<= null". While LLVM does canonicalize this to "!= null", this
appently doesn't happen for constant expressions, leading to the
issue in #74425. While that can be addressed on the LLVM side, it
still seems prudent to emit sensible IR here, because this will
allow null checks to be optimized earlier in the pipeline.

Fixes #74425.

3 years agoAuto merge of #75257 - ssomers:btree_74762_again, r=Mark-Simulacrum
bors [Sat, 8 Aug 2020 07:46:04 +0000 (07:46 +0000)]
Auto merge of #75257 - ssomers:btree_74762_again, r=Mark-Simulacrum

BTreeMap: better way to postpone root access in DrainFilter

A slightly more elegant (in my opinion) adaptation of #74762. Benchmarks seem irrationally pleased to:
```
benchcmp old new --threshold 5
 name                                           old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 btree::map::clone_fat_100_and_remove_all       215,182      185,052           -30,130  -14.00%   x 1.16
 btree::map::clone_fat_100_and_remove_half      139,667      127,945           -11,722   -8.39%   x 1.09
 btree::map::clone_fat_val_100_and_remove_all   96,755       81,279            -15,476  -16.00%   x 1.19
 btree::map::clone_fat_val_100_and_remove_half  64,678       56,911             -7,767  -12.01%   x 1.14
 btree::map::find_rand_100                      18           17                     -1   -5.56%   x 1.06
 btree::map::first_and_last_0                   33           35                      2    6.06%   x 0.94
 btree::map::first_and_last_100                 40           54                     14   35.00%   x 0.74
 btree::map::insert_rand_100                    45           42                     -3   -6.67%   x 1.07
 btree::map::insert_rand_10_000                 45           41                     -4   -8.89%   x 1.10
 btree::map::iter_0                             2,010        1,759                -251  -12.49%   x 1.14
 btree::map::iter_100                           3,514        2,764                -750  -21.34%   x 1.27
 btree::map::iter_10k                           4,018        3,768                -250   -6.22%   x 1.07
 btree::map::range_unbounded_unbounded          37,269       28,929             -8,340  -22.38%   x 1.29
 btree::map::range_unbounded_vs_iter            31,518       28,814             -2,704   -8.58%   x 1.09
```

r? @Mark-Simulacrum

3 years agoAdd back unwinding support for Sony PSP
Marko Mijalkovic [Sat, 8 Aug 2020 06:14:40 +0000 (02:14 -0400)]
Add back unwinding support for Sony PSP

3 years agoAuto merge of #74932 - nnethercote:rm-ast-session-globals, r=petrochenkov
bors [Sat, 8 Aug 2020 05:58:57 +0000 (05:58 +0000)]
Auto merge of #74932 - nnethercote:rm-ast-session-globals, r=petrochenkov

Remove `librustc_ast` session globals

By moving the data onto `Session`.

r? @petrochenkov

3 years agoAuto merge of #75276 - JohnTitor:rollup-rz4hs0w, r=JohnTitor
bors [Sat, 8 Aug 2020 03:54:33 +0000 (03:54 +0000)]
Auto merge of #75276 - JohnTitor:rollup-rz4hs0w, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #75224 (Don't call a function in function-arguments-naked.rs)
 - #75237 (Display elided lifetime for non-reference type in doc)
 - #75250 (make MaybeUninit::as_(mut_)ptr const)
 - #75253 (clean up const-hacks in int endianess conversion functions)
 - #75259 (Add missing backtick)
 - #75267 (Small cleanup)
 - #75270 (fix a couple of clippy findings)

Failed merges:

r? @ghost

3 years agoRollup merge of #75270 - matthiaskrgr:clippy_aug_1, r=Dylan-DPC
Yuki Okushi [Sat, 8 Aug 2020 02:36:12 +0000 (11:36 +0900)]
Rollup merge of #75270 - matthiaskrgr:clippy_aug_1, r=Dylan-DPC

fix a couple of clippy findings

3 years agoRollup merge of #75267 - estebank:cleanup, r=Dylan-DPC
Yuki Okushi [Sat, 8 Aug 2020 02:36:10 +0000 (11:36 +0900)]
Rollup merge of #75267 - estebank:cleanup, r=Dylan-DPC

Small cleanup

* Add docstring to `Parser` field
* Remove unnecessary `unwrap`
* Remove unnecessary borrow
* Fix indentation of some `teach`text output

3 years agoRollup merge of #75259 - giraffate:add_missing_backtick, r=lcnr
Yuki Okushi [Sat, 8 Aug 2020 02:36:09 +0000 (11:36 +0900)]
Rollup merge of #75259 - giraffate:add_missing_backtick, r=lcnr

Add missing backtick

3 years agoRollup merge of #75253 - RalfJung:cleanup-const-hack, r=oli-obk
Yuki Okushi [Sat, 8 Aug 2020 02:36:07 +0000 (11:36 +0900)]
Rollup merge of #75253 - RalfJung:cleanup-const-hack, r=oli-obk

clean up const-hacks in int endianess conversion functions

Cleans up the const hacks added in https://github.com/rust-lang/rust/pull/69373.

r? @oli-obk

3 years agoRollup merge of #75250 - RalfJung:uninit-const-ptr, r=oli-obk
Yuki Okushi [Sat, 8 Aug 2020 02:36:05 +0000 (11:36 +0900)]
Rollup merge of #75250 - RalfJung:uninit-const-ptr, r=oli-obk

make MaybeUninit::as_(mut_)ptr const

I think it was just an oversight that they are not const yet.

I also changed their implementation as the old one created references to uninitialized memory.^^

3 years agoRollup merge of #75237 - nbdd0121:rustdoc, r=jyn514
Yuki Okushi [Sat, 8 Aug 2020 02:36:03 +0000 (11:36 +0900)]
Rollup merge of #75237 - nbdd0121:rustdoc, r=jyn514

Display elided lifetime for non-reference type in doc

In edition 2018 we encourage writing `<'_>` explicitly, so rustdoc should display like such as well.

Fixes #75225

~~Somehow when I run the compiled rustdoc using `cargo +stage2 doc` on other crates, it correctly produces `<'_>`, but I couldn't get the std doc to do the same with `./x.py doc --stage 2`. Might this be related to the recent change to x.py about how the doc is built?~~

3 years agoRollup merge of #75224 - Aaron1011:fix/function-arguments-naked, r=Amanieu
Yuki Okushi [Sat, 8 Aug 2020 02:36:02 +0000 (11:36 +0900)]
Rollup merge of #75224 - Aaron1011:fix/function-arguments-naked, r=Amanieu

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 agoIncrease `recursion_limit` in `librustc_plugin_impl`.
Nicholas Nethercote [Sat, 8 Aug 2020 02:05:10 +0000 (12:05 +1000)]
Increase `recursion_limit` in `librustc_plugin_impl`.

To avoid rustdoc problems.

3 years agoEliminate `librustc_hir`'s dependency on `librustc_session`.
Nicholas Nethercote [Fri, 7 Aug 2020 01:11:44 +0000 (11:11 +1000)]
Eliminate `librustc_hir`'s dependency on `librustc_session`.

3 years agoEliminate the `SessionGlobals` from `librustc_ast`.
Nicholas Nethercote [Thu, 30 Jul 2020 01:27:50 +0000 (11:27 +1000)]
Eliminate the `SessionGlobals` from `librustc_ast`.

By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This
means they are accessed via the `Session`, rather than via TLS. A few
`Attr` methods and `librustc_ast` functions are now methods of
`Session`.

All of this required passing a `Session` to lots of functions that didn't
already have one. Some of these functions also had arguments removed, because
those arguments could be accessed directly via the `Session` argument.

`contains_feature_attr()` was dead, and is removed.

Some functions were moved from `librustc_ast` elsewhere because they now need
to access `Session`, which isn't available in that crate.
- `entry_point_type()` --> `librustc_builtin_macros`
- `global_allocator_spans()` --> `librustc_metadata`
- `is_proc_macro_attr()` --> `Session`

3 years agoRemove some unnecessary uses of `Option`.
Nicholas Nethercote [Thu, 30 Jul 2020 01:15:51 +0000 (11:15 +1000)]
Remove some unnecessary uses of `Option`.

These arguments are never `None`.