]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoRollup merge of #101088 - nicholasbishop:bishop-uefi-pdb, r=davidtwco
Yuki Okushi [Tue, 30 Aug 2022 23:47:18 +0000 (08:47 +0900)]
Rollup merge of #101088 - nicholasbishop:bishop-uefi-pdb, r=davidtwco

Set DebuginfoKind::Pdb in msvc_base

This PDB setting was added to `windows_msvc_base` in
https://github.com/rust-lang/rust/pull/98051. It's also needed for the
UEFI targets, and since `uefi_msvc_base` and `windows_msvc_base` are the
only things that inherit from `msvc_base`, just move the PDB setting up
to `mscv_base` to cover both.

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

22 months agoRollup merge of #100927 - andrewpollack:fuchsia-docs-rustup, r=tmandry
Yuki Okushi [Tue, 30 Aug 2022 23:47:17 +0000 (08:47 +0900)]
Rollup merge of #100927 - andrewpollack:fuchsia-docs-rustup, r=tmandry

Adding new Fuchsia rustup docs... reworking walkthrough

Docs improvements:
* Adding new `rustup` target add for Fuchsia targets
* Reworking walkthrough to show directory building as it happens
* Reworking walkthrough to use `hello_fuchsia_pkg/` directory

cc. `@djkoloski`

22 months agoRollup merge of #100892 - sunfishcode:wasi-stdio-asfd, r=joshtriplett
Yuki Okushi [Tue, 30 Aug 2022 23:47:15 +0000 (08:47 +0900)]
Rollup merge of #100892 - sunfishcode:wasi-stdio-asfd, r=joshtriplett

Add `AsFd` implementations for stdio types on WASI.

This mirrors the implementations on Unix platforms, and also mirrors the
existing `AsRawFd` impls.

22 months agoRollup merge of #100804 - GuillaumeGomez:search-results-color-ayu, r=notriddle
Yuki Okushi [Tue, 30 Aug 2022 23:47:14 +0000 (08:47 +0900)]
Rollup merge of #100804 - GuillaumeGomez:search-results-color-ayu, r=notriddle

Fix search results color on hover for ayu theme

Before:

![image](https://user-images.githubusercontent.com/3050060/185747851-038d2333-8b01-44a8-a104-ceb7410ac089.png)

After:

![image](https://user-images.githubusercontent.com/3050060/185747869-53b502f5-5800-470f-b897-2683f1cdb7ee.png)

You can test it [here](https://rustdoc.crud.net/imperio/search-results-color-ayu/foo/index.html?search=item).

r? ``@jsha``

22 months agoUpdate src/doc/rustc/src/platform-support/fuchsia.md
andrewpollack [Tue, 30 Aug 2022 23:06:36 +0000 (16:06 -0700)]
Update src/doc/rustc/src/platform-support/fuchsia.md

Co-authored-by: Tyler Mandry <tmandry@gmail.com>
22 months agoUpdate src/doc/rustc/src/platform-support/fuchsia.md
andrewpollack [Tue, 30 Aug 2022 23:06:27 +0000 (16:06 -0700)]
Update src/doc/rustc/src/platform-support/fuchsia.md

Co-authored-by: Tyler Mandry <tmandry@gmail.com>
22 months agoAdding new Fuchsia rustup docs... reworking walkthrough
Andrew Pollack [Tue, 23 Aug 2022 19:06:49 +0000 (19:06 +0000)]
Adding new Fuchsia rustup docs... reworking walkthrough

22 months agoAuto merge of #98919 - 5225225:stricter-invalid-value, r=RalfJung
bors [Tue, 30 Aug 2022 20:39:01 +0000 (20:39 +0000)]
Auto merge of #98919 - 5225225:stricter-invalid-value, r=RalfJung

Strengthen invalid_value lint to forbid uninit primitives, adjust docs to say that's UB

For context: https://github.com/rust-lang/rust/issues/66151#issuecomment-1174477404=

This does not make it a FCW, but it does explicitly state in the docs that uninit integers are UB.

This also doesn't affect any runtime behavior, uninit u32's will still successfully be created through mem::uninitialized.

22 months agoAuto merge of #101203 - fortanix:raoul/remove_rls_from_git_submodule_update, r=jyn514
bors [Tue, 30 Aug 2022 17:33:24 +0000 (17:33 +0000)]
Auto merge of #101203 - fortanix:raoul/remove_rls_from_git_submodule_update, r=jyn514

Avoid bootstrap from updating rls submodule

Our CI performing tests of the `x86_64-fortanix-unknown-sgx` failed with:
```
21:00:53 + ./configure --enable-lld --disable-rpath --set llvm.ninja=false --set rust.verbose-tests=true
21:00:53 + ./x.py test --stage=1 --target=x86_64-fortanix-unknown-sgx library/std --host= --no-doc --exclude src/tools/linkchecker
21:00:53 Building rustbuild
21:00:53     Finished dev [unoptimized] target(s) in 0.11s
21:00:53 Updating submodule src/tools/rls
21:00:54 Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
21:00:54     Updating crates.io index
21:00:55     Updating git repository `[https://github.com/rust-lang/cargo`](https://github.com/rust-lang/cargo%60)
...
21:00:55     Updating git repository `[https://github.com/rust-lang/rust-clippy`](https://github.com/rust-lang/rust-clippy%60)
21:00:56     Updating git repository `[https://github.com/rust-lang/rustfmt`](https://github.com/rust-lang/rustfmt%60)
21:00:56 error: failed to select a version for `libgit2-sys`.
21:00:56     ... required by package `cargo v0.65.0 (https://github.com/rust-lang/cargo?rev=5514f1e0e1b3650ed8a78306198e90b66b292693#5514f1e0)`
21:00:56     ... which satisfies git dependency `cargo` of package `rls v1.41.0 (/home/jenkins/workspace/rust-sgx-ci/rust/src/tools/rls)`
21:00:56 versions that meet the requirements `^0.13.2` are: 0.13.4+1.4.2, 0.13.3+1.4.2, 0.13.2+1.4.2
21:00:56
21:00:56 the package `libgit2-sys` links to the native library `git2`, but it conflicts with a previous package which links to `git2` as well:
21:00:56 package `libgit2-sys v0.14.0+1.5.0`
21:00:56     ... which satisfies dependency `libgit2-sys = "^0.14.0"` of package `cargo v0.66.0 (/home/jenkins/workspace/rust-sgx-ci/rust/src/tools/cargo)`
21:00:56 Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='libgit2-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
21:00:56
21:00:56 failed to select a version for `libgit2-sys` which could resolve this conflict
```
This is related to the version bump of `libgit2-sys` in #11004, but the root cause is the RLS is sunset (#100863). When the bootstrapper manages the git submodules, the wrong repo commit is checked out. This PR removes rls from the list of rust submodules.

22 months agoAuto merge of #101195 - Dylan-DPC:rollup-rhjaz6r, r=Dylan-DPC
bors [Tue, 30 Aug 2022 14:52:02 +0000 (14:52 +0000)]
Auto merge of #101195 - Dylan-DPC:rollup-rhjaz6r, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #99517 (Display raw pointer as *{mut,const} T instead of *-ptr in errors)
 - #99928 (Do not leak type variables from opaque type relation)
 - #100473 (Attempt to normalize `FnDef` signature in `InferCtxt::cmp`)
 - #100653 (Move the cast_float_to_int fallback code to GCC)
 - #100941 (Point at the string inside literal and mention if we need string inte…)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoAvoid bootstrap from updating rls submodule
Raoul Strackx [Tue, 30 Aug 2022 13:43:25 +0000 (15:43 +0200)]
Avoid bootstrap from updating rls submodule

22 months agoRollup merge of #100941 - lyming2007:issue-100584, r=oli-obk
Dylan DPC [Tue, 30 Aug 2022 11:26:10 +0000 (16:56 +0530)]
Rollup merge of #100941 - lyming2007:issue-100584, r=oli-obk

Point at the string inside literal and mention if we need string inte…

…rpolation

modified:   compiler/rustc_passes/src/liveness.rs

22 months agoRollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyo
Dylan DPC [Tue, 30 Aug 2022 11:26:09 +0000 (16:56 +0530)]
Rollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyo

Move the cast_float_to_int fallback code to GCC

Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.

22 months agoRollup merge of #100473 - compiler-errors:normalize-the-fn-def-sig-plz, r=lcnr
Dylan DPC [Tue, 30 Aug 2022 11:26:08 +0000 (16:56 +0530)]
Rollup merge of #100473 - compiler-errors:normalize-the-fn-def-sig-plz, r=lcnr

Attempt to normalize `FnDef` signature in `InferCtxt::cmp`

Stashes a normalization callback in `InferCtxt` so that the signature we get from `tcx.fn_sig(..).subst(..)` in `InferCtxt::cmp` can be properly normalized, since we cannot expect for it to have normalized types since it comes straight from astconv.

This is kind of a hack, but I will say that `@jyn514` found the fact that we present unnormalized types to be very confusing in real life code, and I agree with that feeling. Though altogether I am still a bit unsure about whether this PR is worth the effort, so I'm open to alternatives and/or just closing it outright.

On the other hand, this isn't a ridiculously heavy implementation anyways -- it's less than a hundred lines of changes, and half of that is just miscellaneous cleanup.

This is stacked onto #100471 which is basically unrelated, and it can be rebased off of that when that lands or if needed.

---

The code:
```rust
trait Foo { type Bar; }

impl<T> Foo for T {
    type Bar = i32;
}

fn foo<T>(_: <T as Foo>::Bar) {}

fn needs_i32_ref_fn(f: fn(&'static i32)) {}

fn main() {
    needs_i32_ref_fn(foo::<()>);
}
```

Before:
```
   = note: expected fn pointer `fn(&'static i32)`
                 found fn item `fn(<() as Foo>::Bar) {foo::<()>}`
```

After:
```
   = note: expected fn pointer `fn(&'static i32)`
                 found fn item `fn(i32) {foo::<()>}`
```

22 months agoRollup merge of #99928 - compiler-errors:issue-99914, r=oli-obk
Dylan DPC [Tue, 30 Aug 2022 11:26:07 +0000 (16:56 +0530)]
Rollup merge of #99928 - compiler-errors:issue-99914, r=oli-obk

Do not leak type variables from opaque type relation

The "root cause" is that we call `InferCtxt::resolve_vars_if_possible` (3d9dd681f520d1d59f38aed0056cf9474894cc74) on the types we get back in `TypeError::Sorts` since I added a call to it in `InferCtxt::same_type_modulo_infer`. However if this `TypeError` comes from a `InferCtxt::commit_if_ok`, then it may reference type variables that do not exist anymore, which is problematic.

We avoid this by substituting the `TypeError` with the types we had before being generalized while handling opaques.

This is kinda gross, and I feel like we can get the same issue from other places where we generalize type/const inference variables. Maybe not? I don't know.

Fixes #99914
Fixes #99970
Fixes #100463

22 months agoRollup merge of #99517 - Nilstrieb:display-raw-ptr, r=compiler-errors
Dylan DPC [Tue, 30 Aug 2022 11:26:06 +0000 (16:56 +0530)]
Rollup merge of #99517 - Nilstrieb:display-raw-ptr, r=compiler-errors

Display raw pointer as *{mut,const} T instead of *-ptr in errors

The `*-ptr` is rather confusing, and we have the full information for properly displaying the information.

22 months agoAuto merge of #98100 - bjorn3:use_object_for_bitcode_reading, r=wesleywiser
bors [Tue, 30 Aug 2022 11:13:58 +0000 (11:13 +0000)]
Auto merge of #98100 - bjorn3:use_object_for_bitcode_reading, r=wesleywiser

Use object instead of LLVM for reading bitcode from rlibs

Together with changes I plan to make as part of https://github.com/rust-lang/rust/pull/97485 this will allow entirely removing usage of LLVM's archive reader and thus allow removing `archive_ro.rs` and `ArchiveWrapper.cpp`.

22 months agoAuto merge of #101183 - Dylan-DPC:rollup-6kewixv, r=Dylan-DPC
bors [Tue, 30 Aug 2022 08:29:42 +0000 (08:29 +0000)]
Auto merge of #101183 - Dylan-DPC:rollup-6kewixv, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #95376 (Add `vec::Drain{,Filter}::keep_rest`)
 - #100092 (Fall back when relating two opaques by substs in MIR typeck)
 - #101019 (Suggest returning closure as `impl Fn`)
 - #101022 (Erase late bound regions before comparing types in `suggest_dereferences`)
 - #101101 (interpret: make read-pointer-as-bytes a CTFE-only error with extra information)
 - #101123 (Remove `register_attr` feature)
 - #101175 (Don't --bless in pre-push hook)
 - #101176 (rustdoc: remove unused CSS selectors for `.table-display`)
 - #101180 (Add another MaybeUninit array test with const)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRollup merge of #101180 - SUPERCILEX:const-maybeuninit, r=TaKO8Ki
Dylan DPC [Tue, 30 Aug 2022 05:56:55 +0000 (11:26 +0530)]
Rollup merge of #101180 - SUPERCILEX:const-maybeuninit, r=TaKO8Ki

Add another MaybeUninit array test with const

This is another possible syntax and I just want to be absolutely sure it behaves correctly.

22 months agoRollup merge of #101176 - notriddle:notriddle/rustdoc-table-display, r=jsha
Dylan DPC [Tue, 30 Aug 2022 05:56:54 +0000 (11:26 +0530)]
Rollup merge of #101176 - notriddle:notriddle/rustdoc-table-display, r=jsha

rustdoc: remove unused CSS selectors for `.table-display`

This class was added to support the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving these selectors unused.

Continuation of #101046

22 months agoRollup merge of #101175 - tmandry:curse-push-hook, r=jyn514
Dylan DPC [Tue, 30 Aug 2022 05:56:53 +0000 (11:26 +0530)]
Rollup merge of #101175 - tmandry:curse-push-hook, r=jyn514

Don't --bless in pre-push hook

Running with --bless causes the push to succeed if there are fixable
formatting changes, but the changes don't make it into the push.

We should have the user rerun with --bless (or x.py fmt) and commit the
changes themselves (they might want to amend a particular commit, for
instance).

22 months agoRollup merge of #101123 - JohnTitor:rm-register-attr, r=TaKO8Ki
Dylan DPC [Tue, 30 Aug 2022 05:56:52 +0000 (11:26 +0530)]
Rollup merge of #101123 - JohnTitor:rm-register-attr, r=TaKO8Ki

Remove `register_attr` feature

Closes #66080

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
22 months agoRollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obk
Dylan DPC [Tue, 30 Aug 2022 05:56:51 +0000 (11:26 +0530)]
Rollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obk

interpret: make read-pointer-as-bytes a CTFE-only error with extra information

Next step in the reaction to https://github.com/rust-lang/rust/issues/99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes https://github.com/rust-lang/miri/issues/2456.

Pointer-to-int transmutation during CTFE now produces a message like this:
```
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
```

r? ``@oli-obk``

22 months agoRollup merge of #101022 - compiler-errors:issue-101020, r=jackh726
Dylan DPC [Tue, 30 Aug 2022 05:56:50 +0000 (11:26 +0530)]
Rollup merge of #101022 - compiler-errors:issue-101020, r=jackh726

Erase late bound regions before comparing types in `suggest_dereferences`

Fixes #101020

22 months agoRollup merge of #101019 - compiler-errors:return-closure-suggestion, r=cjgillot
Dylan DPC [Tue, 30 Aug 2022 05:56:49 +0000 (11:26 +0530)]
Rollup merge of #101019 - compiler-errors:return-closure-suggestion, r=cjgillot

Suggest returning closure as `impl Fn`

Fixes #100936

22 months agoRollup merge of #100092 - compiler-errors:issue-100075, r=oli-obk
Dylan DPC [Tue, 30 Aug 2022 05:56:48 +0000 (11:26 +0530)]
Rollup merge of #100092 - compiler-errors:issue-100075, r=oli-obk

Fall back when relating two opaques by substs in MIR typeck

This is certainly _one_ way to fix #100075. Not really confident it's the _best_ way to do it, though.

The root cause of this issue is that during MIR type-check, we end up trying to equate an opaque against the same opaque def-id but with different substs. Because of the way that we replace RPITs during (HIR) typeck with an inference variable, we don't end up emitting a type-checking error, so the delayed MIR bug causes an ICE.

See the `src/test/ui/impl-trait/issue-100075-2.rs` test below to make that clear -- in that example, we try to equate `{impl Sized} substs=[T]` and `{impl Sized} substs=[Option<T>]`, which causes an ICE. This new logic will instead cause us to infer `{impl Sized} substs=[Option<T>]` as the hidden type for `{impl Sized} substs=[T]`, which causes a proper error to be emitted later on when we check that an opaque isn't recursive.

I'm open to closing this in favor of something else. Ideally we'd fix this in typeck, but the thing we do to ensure backwards compatibility with weird RPIT cases makes that difficult. Also open to discussing this further.

22 months agoRollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay
Dylan DPC [Tue, 30 Aug 2022 05:56:47 +0000 (11:26 +0530)]
Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay

Add `vec::Drain{,Filter}::keep_rest`

This PR adds `keep_rest` methods to `vec::Drain` and `vec::DrainFilter` under `drain_keep_rest` feature gate:
```rust
// mod alloc::vec

impl<T, A: Allocator> Drain<'_, T, A> {
    pub fn keep_rest(self);
}

impl<T, F, A: Allocator> DrainFilter<'_, T, F, A>
where
    F: FnMut(&mut T) -> bool,
{
    pub fn keep_rest(self);
}
```

Both these methods cancel draining of elements that were not yet yielded from the iterators. While this needs more testing & documentation, I want at least start the discussion. This may be a potential way out of the "should `DrainFilter` exhaust itself on drop?" argument.

22 months agoAuto merge of #100812 - Nilstrieb:revert-let-chains-nightly, r=Mark-Simulacrum
bors [Tue, 30 Aug 2022 05:48:22 +0000 (05:48 +0000)]
Auto merge of #100812 - Nilstrieb:revert-let-chains-nightly, r=Mark-Simulacrum

Revert let_chains stabilization

This is the revert against master, the beta revert was already done in #100538.

Bumps the stage0 compiler which already has it reverted.

22 months agoAdd another MaybeUninit array test with const
Alex Saveau [Tue, 30 Aug 2022 03:09:25 +0000 (23:09 -0400)]
Add another MaybeUninit array test with const

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
22 months agorustdoc: remove unused CSS selectors for `.table-display`
Michael Howell [Tue, 30 Aug 2022 00:25:43 +0000 (17:25 -0700)]
rustdoc: remove unused CSS selectors for `.table-display`

This class was added to support the function signature [src] lockup. That
lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox
instead, leaving these selectors unused.

22 months agoDon't --bless in pre-push hook
Tyler Mandry [Mon, 29 Aug 2022 23:43:47 +0000 (16:43 -0700)]
Don't --bless in pre-push hook

Running with --bless causes the push to succeed if there are fixable
formatting changes, but the changes don't make it into the push.

We should have the user rerun with --bless (or x.py fmt) and commit the
changes themselves (they might want to amend a particular commit, for
instance).

22 months agoAuto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgr
bors [Mon, 29 Aug 2022 22:49:04 +0000 (22:49 +0000)]
Auto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #100898 (Do not report too many expr field candidates)
 - #101056 (Add the syntax of references to their documentation summary.)
 - #101106 (Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items)
 - #101131 (CTFE: exposing pointers and calling extern fn is just impossible)
 - #101141 (Simplify `get_trait_ref` fn used for `virtual_function_elimination`)
 - #101146 (Various changes to logging of borrowck-related code)
 - #101156 (Remove `Sync` requirement from lint pass objects)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoFix tests due to stricter invalid_value
5225225 [Mon, 29 Aug 2022 20:28:35 +0000 (21:28 +0100)]
Fix tests due to stricter invalid_value

22 months agoRollup merge of #101156 - Jarcho:remove_sync_lint_pass, r=compiler-errors
Matthias Krüger [Mon, 29 Aug 2022 19:13:00 +0000 (21:13 +0200)]
Rollup merge of #101156 - Jarcho:remove_sync_lint_pass, r=compiler-errors

Remove `Sync` requirement from lint pass objects

This is blocking the clippy sync (#101140). One of the lint passes contains a `Cell` in order to make lifetimes work. It could be worked around, but this is the easier change to make if there are no objections.

Rational for removing the requirement
* All lint pass methods take `&mut self` arguments.
* Many passes depend on running is visitor order.
* Lint passes are created on demand so they're only ever stored in a local.
* `Send` is enough to lint different passes in parallel.

`LintStore` remains `Sync` with this. The constructor functions it contains still maintain their `Sync` requirement.

r? rust-lang/compiler

22 months agoRollup merge of #101146 - jackh726:borrowck-logging, r=compiler-errors
Matthias Krüger [Mon, 29 Aug 2022 19:12:59 +0000 (21:12 +0200)]
Rollup merge of #101146 - jackh726:borrowck-logging, r=compiler-errors

Various changes to logging of borrowck-related code

Cleanups found when doing other changes

r? `@compiler-errors`

22 months agoRollup merge of #101141 - compiler-errors:get-trait-ref-is-a-misleading-name, r=oli-obk
Matthias Krüger [Mon, 29 Aug 2022 19:12:58 +0000 (21:12 +0200)]
Rollup merge of #101141 - compiler-errors:get-trait-ref-is-a-misleading-name, r=oli-obk

Simplify `get_trait_ref` fn used for `virtual_function_elimination`

1. The name `get_trait_ref` is misleading, so I renamed it to something more like `expect_...` because it ICEs if used incorrectly.
2. No need to manually go through the existential trait refs, we already have `.principal()` for that.

22 months agoRollup merge of #101131 - RalfJung:ctfe-no-needs-rfc, r=oli-obk
Matthias Krüger [Mon, 29 Aug 2022 19:12:57 +0000 (21:12 +0200)]
Rollup merge of #101131 - RalfJung:ctfe-no-needs-rfc, r=oli-obk

CTFE: exposing pointers and calling extern fn is just impossible

The remaining "needs RFC" errors are just needlessly confusing, I think -- time to get rid of that error variant. They are anyway only reachable with miri-unleashed (if at all).

r? `@oli-obk`

22 months agoRollup merge of #101106 - aDotInTheVoid:rdj-stripped-mod, r=GuillaumeGomez
Matthias Krüger [Mon, 29 Aug 2022 19:12:56 +0000 (21:12 +0200)]
Rollup merge of #101106 - aDotInTheVoid:rdj-stripped-mod, r=GuillaumeGomez

Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items

Fixes #101103
Fixes #100973

r? `@GuillaumeGomez`

22 months agoRollup merge of #101056 - kpreid:prim-doc, r=JohnTitor
Matthias Krüger [Mon, 29 Aug 2022 19:12:55 +0000 (21:12 +0200)]
Rollup merge of #101056 - kpreid:prim-doc, r=JohnTitor

Add the syntax of references to their documentation summary.

Without this change, in <https://doc.rust-lang.org/1.63.0/std/#primitives>, `reference` is the only entry in that list which does not contain the syntax by which the type is named in source code. With this change, it contains them, in roughly the same way as the `pointer` entry does.

22 months agoRollup merge of #100898 - compiler-errors:too-many-expr-fields, r=spastorino
Matthias Krüger [Mon, 29 Aug 2022 19:12:54 +0000 (21:12 +0200)]
Rollup merge of #100898 - compiler-errors:too-many-expr-fields, r=spastorino

Do not report too many expr field candidates

When considering "this expressions' field has a {field/method}" suggestions:
1. Don't report methods that are out of scope
2. Use `span_suggestions` instead of reporting each field candidate, which caps the number of suggestions to 4
4. Blacklist some common traits like `Clone` and `Deref`

Fixes #100894

22 months agoPoint at the string inside literal and mention if we need string interpolation
Yiming Lei [Wed, 24 Aug 2022 02:30:04 +0000 (19:30 -0700)]
Point at the string inside literal and mention if we need string interpolation
modified:   compiler/rustc_passes/src/liveness.rs

new file:   src/test/ui/type/issue-100584.rs
new file:   src/test/ui/type/issue-100584.stderr

22 months agoAuto merge of #101152 - Dylan-DPC:rollup-v4iw8ux, r=Dylan-DPC
bors [Mon, 29 Aug 2022 18:56:59 +0000 (18:56 +0000)]
Auto merge of #101152 - Dylan-DPC:rollup-v4iw8ux, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #98304 (Add MaybeUninit memset test)
 - #98801 (Add a `File::create_new` constructor)
 - #99821 (Remove separate indexing of early-bound regions)
 - #100239 (remove an ineffective check in const_prop)
 - #100337 (Stabilize `std::io::read_to_string`)
 - #100819 (Make use of `[wrapping_]byte_{add,sub}`)
 - #100934 (Remove a panicking branch from `fmt::builders::PadAdapter`)
 - #101000 (Separate CountIsStar from CountIsParam in rustc_parse_format.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoDisplay raw pointer as `*{mut,const} T` instead of `*-ptr` in errors
nils [Wed, 20 Jul 2022 16:32:58 +0000 (18:32 +0200)]
Display raw pointer as `*{mut,const} T` instead of `*-ptr` in errors

The `*-ptr` is rather confusing, and we have the full information for
properly displaying the information.

22 months agoMigrate stable let_chains error to session diagnostics
Nilstrieb [Mon, 29 Aug 2022 17:49:30 +0000 (19:49 +0200)]
Migrate stable let_chains error to session diagnostics

22 months agoRevert let_chains stabilization
Nilstrieb [Sat, 20 Aug 2022 18:40:08 +0000 (20:40 +0200)]
Revert let_chains stabilization

This reverts commit 326646074940222d602f3683d0559088690830f4.

This is the revert against master, the beta revert was already done in #100538.

22 months agoBump stage0
Nilstrieb [Sat, 20 Aug 2022 18:30:25 +0000 (20:30 +0200)]
Bump stage0

This is needed for the revert of let_chains.

22 months agoAuto merge of #101147 - weihanglo:update-cargo, r=Mark-Simulacrum
bors [Mon, 29 Aug 2022 16:04:11 +0000 (16:04 +0000)]
Auto merge of #101147 - weihanglo:update-cargo, r=Mark-Simulacrum

Update cargo

5 commits in 6da726708a4406f31f996d813790818dce837161..4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5
2022-08-23 21:39:56 +0000 to 2022-08-27 18:41:39 +0000
- doc: pause, for readability (rust-lang/cargo#11027)
- Bump git2 to 0.15 and libgit2-sys to 0.14 (rust-lang/cargo#11004)
- Fix typo (rust-lang/cargo#11025)
- Update cargo-toml-vs-cargo-lock.md (rust-lang/cargo#11021)
- Apply GitHub fast path even for partial hashes (rust-lang/cargo#10807)

22 months agoVarious changes to logging of borrowck-related code
Jack Huey [Mon, 29 Aug 2022 06:00:08 +0000 (02:00 -0400)]
Various changes to logging of borrowck-related code

22 months agoRemove `Sync` requirement from lint pass objects as they are created on demand
Jason Newcomb [Mon, 29 Aug 2022 14:00:22 +0000 (10:00 -0400)]
Remove `Sync` requirement from lint pass objects as they are created on demand

22 months agoRollup merge of #101000 - m-ou-se:count-is-star, r=nagisa
Dylan DPC [Mon, 29 Aug 2022 11:19:45 +0000 (16:49 +0530)]
Rollup merge of #101000 - m-ou-se:count-is-star, r=nagisa

Separate CountIsStar from CountIsParam in rustc_parse_format.

`rustc_parse_format`'s parser would result in the exact same output for `{:.*}` and `{:.0$}`, making it hard for diagnostics to handle these cases properly.

This splits those cases by adding a new `CountIsStar` enum variant.

This fixes #100995

Prerequisite for https://github.com/rust-lang/rust/pull/100996

22 months agoRollup merge of #100934 - a1phyr:improve_fmt_PadAdapter, r=Mark-Simulacrum
Dylan DPC [Mon, 29 Aug 2022 11:19:44 +0000 (16:49 +0530)]
Rollup merge of #100934 - a1phyr:improve_fmt_PadAdapter, r=Mark-Simulacrum

Remove a panicking branch from `fmt::builders::PadAdapter`

22 months agoRollup merge of #100819 - WaffleLapkin:use_ptr_byte_methods, r=scottmcm
Dylan DPC [Mon, 29 Aug 2022 11:19:43 +0000 (16:49 +0530)]
Rollup merge of #100819 - WaffleLapkin:use_ptr_byte_methods, r=scottmcm

Make use of `[wrapping_]byte_{add,sub}`

These new methods trivially replace old `.cast().wrapping_offset().cast()` & similar code.
Note that [`arith_offset`](https://doc.rust-lang.org/std/intrinsics/fn.arith_offset.html) and `wrapping_offset` are the same thing.

r? ``@scottmcm``

_split off from #100746_

22 months agoRollup merge of #100337 - camelid:stabilize-io_read_to_string, r=JohnTitor
Dylan DPC [Mon, 29 Aug 2022 11:19:42 +0000 (16:49 +0530)]
Rollup merge of #100337 - camelid:stabilize-io_read_to_string, r=JohnTitor

Stabilize `std::io::read_to_string`

Closes #80218. :tada:

This PR stabilizes the `std::io::read_to_string` function, with the following public API:

```rust
pub fn read_to_string<R: Read>(reader: R) -> Result<String>;
```

It's analogous to `std::fs::read_to_string` for files, but it works on anything that implements `io::Read`, including `io::stdin()`.

See the tracking issue (#80218) or documentation for details.

22 months agoRollup merge of #100239 - RalfJung:const-prop-uninit, r=oli-obk
Dylan DPC [Mon, 29 Aug 2022 11:19:40 +0000 (16:49 +0530)]
Rollup merge of #100239 - RalfJung:const-prop-uninit, r=oli-obk

remove an ineffective check in const_prop

Based on https://github.com/rust-lang/rust/pull/100043, only the last two commits are new.

ConstProp has a special check when reading from a local that prevents reading uninit locals. However, if that local flows into `force_allocation`, then no check fires and evaluation proceeds. So this check is not really effective at preventing accesses to uninit locals.

With https://github.com/rust-lang/rust/pull/100043, `read_immediate` and friends always fail when reading uninit locals, so I don't see why ConstProp would need a separate check. Thus I propose we remove it. This is needed to be able to do https://github.com/rust-lang/rust/pull/100085.

22 months agoRollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors
Dylan DPC [Mon, 29 Aug 2022 11:19:39 +0000 (16:49 +0530)]
Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors

Remove separate indexing of early-bound regions

~Based on https://github.com/rust-lang/rust/pull/99728.~

This PR copies some modifications from https://github.com/rust-lang/rust/pull/97839 around object lifetime defaults.
These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.

22 months agoRollup merge of #98801 - joshtriplett:file-create-new, r=thomcc
Dylan DPC [Mon, 29 Aug 2022 11:19:38 +0000 (16:49 +0530)]
Rollup merge of #98801 - joshtriplett:file-create-new, r=thomcc

Add a `File::create_new` constructor

We have `File::create` for creating a file or opening an existing file,
but the secure way to guarantee creating a new file requires a longhand
invocation via `OpenOptions`.

Add `File::create_new` to handle this case, to make it easier for people
to do secure file creation.

22 months agoRollup merge of #98304 - SUPERCILEX:maybeuninit, r=nikic
Dylan DPC [Mon, 29 Aug 2022 11:19:37 +0000 (16:49 +0530)]
Rollup merge of #98304 - SUPERCILEX:maybeuninit, r=nikic

Add MaybeUninit memset test

Closes #96274

22 months agoAuto merge of #98626 - oli-obk:tracing, r=lcnr
bors [Mon, 29 Aug 2022 11:13:42 +0000 (11:13 +0000)]
Auto merge of #98626 - oli-obk:tracing, r=lcnr

bump tracing version

Bump tracing dependency to 0.1.35 to give us features like printing the return value of functions

22 months agoAuto merge of #100786 - sunshowers:macos-posix-chdir, r=sunshowers
bors [Mon, 29 Aug 2022 07:54:06 +0000 (07:54 +0000)]
Auto merge of #100786 - sunshowers:macos-posix-chdir, r=sunshowers

Use posix_spawn for absolute paths on macOS

Currently, on macOS, Rust never uses the fast posix_spawn path if a
directory change is requested, due to a bug in Apple's libc. However, the
bug is only triggered if the program is a relative path.

This PR makes it so that the fast path continues to work if the program
is an absolute path or a lone filename.

This was an alternative proposed in https://github.com/rust-lang/rust/pull/80537#issue-776674009, and it makes a measurable performance difference in some of my code that spawns thousands of processes.

22 months agoUpdate cargo
Weihang Lo [Mon, 29 Aug 2022 06:15:36 +0000 (07:15 +0100)]
Update cargo

5 commits in 6da726708a4406f31f996d813790818dce837161..4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5
2022-08-23 21:39:56 +0000 to 2022-08-27 18:41:39 +0000
- doc: pause, for readability (rust-lang/cargo#11027)
- Bump git2 to 0.15 and libgit2-sys to 0.14 (rust-lang/cargo#11004)
- Fix typo (rust-lang/cargo#11025)
- Update cargo-toml-vs-cargo-lock.md (rust-lang/cargo#11021)
- Apply GitHub fast path even for partial hashes (rust-lang/cargo#10807)

22 months agoAuto merge of #101143 - matthiaskrgr:rollup-g8y5k0g, r=matthiaskrgr
bors [Mon, 29 Aug 2022 05:12:53 +0000 (05:12 +0000)]
Auto merge of #101143 - matthiaskrgr:rollup-g8y5k0g, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #94890 (Support parsing IP addresses from a byte string)
 - #96334 (socket `set_mark` addition.)
 - #99027 (Replace `Body::basic_blocks()` with field access)
 - #100437 (Improve const mismatch `FulfillmentError`)
 - #100843 (Migrate part of rustc_infer to session diagnostic)
 - #100897 (extra sanity check against consts pointing to mutable memory)
 - #100959 (translations: rename warn_ to warning)
 - #101111 (Use the declaration's SourceInfo for FnEntry retags, not the outermost)
 - #101116 ([rustdoc] Remove Attrs type alias)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRollup merge of #101116 - GuillaumeGomez:rm-attrs-ty-alias, r=notriddle
Matthias Krüger [Mon, 29 Aug 2022 04:34:49 +0000 (06:34 +0200)]
Rollup merge of #101116 - GuillaumeGomez:rm-attrs-ty-alias, r=notriddle

[rustdoc] Remove Attrs type alias

When working on https://github.com/rust-lang/rust/pull/101006, I was quite confused because of this type alias as I'm used to having rustdoc types into `clean/types.rs`. Anyway, considering how few uses of it we have, I simply removed it.

r? `````@notriddle`````

22 months agoRollup merge of #101111 - saethlin:better-fnentry-spans, r=RalfJung
Matthias Krüger [Mon, 29 Aug 2022 04:34:48 +0000 (06:34 +0200)]
Rollup merge of #101111 - saethlin:better-fnentry-spans, r=RalfJung

Use the declaration's SourceInfo for FnEntry retags, not the outermost

This addresses a long-standing `// FIXME` in the pass that adds retags.

The changes to Miri's UI tests will look like this:
```
   --> $DIR/aliasing_mut1.rs:LL:CC
    |
 LL | pub fn safe(_x: &mut i32, _y: &mut i32) {}
<   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag <TAG> because incompatible item [Unique for <TAG>] is protected by call ID
>   |                           ^^ not granting access to tag <TAG> because incompatible item [Unique for <TAG>] is protected by call ID
    |
```

r? ````@RalfJung````

22 months agoRollup merge of #100959 - LuisCardosoOliveira:translation-rename-attr-warning, r...
Matthias Krüger [Mon, 29 Aug 2022 04:34:47 +0000 (06:34 +0200)]
Rollup merge of #100959 - LuisCardosoOliveira:translation-rename-attr-warning, r=davidtwco

translations: rename warn_ to warning

## Description

This MR renames the the macro `warn_` to `warning`.

To give a little bit of context, as [explained](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20diag.20translation/near/295074146) by ```````@davidtwco``````` in the Zulip channel, `warn_`  was named like that because the keyword `warn` is a built-in attribute and at the time this macro was created the word `warning` was also
taken.

However, it is no longer the case and we can rename `warn_` to `warning`.

22 months agoRollup merge of #100897 - RalfJung:const-not-to-mutable, r=lcnr
Matthias Krüger [Mon, 29 Aug 2022 04:34:46 +0000 (06:34 +0200)]
Rollup merge of #100897 - RalfJung:const-not-to-mutable, r=lcnr

extra sanity check against consts pointing to mutable memory

This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.

22 months agoRollup merge of #100843 - IntQuant:issue-100717-infer, r=compiler-errors
Matthias Krüger [Mon, 29 Aug 2022 04:34:45 +0000 (06:34 +0200)]
Rollup merge of #100843 - IntQuant:issue-100717-infer, r=compiler-errors

Migrate part of rustc_infer to session diagnostic

22 months agoRollup merge of #100437 - compiler-errors:better-const-mismatch-err, r=oli-obk
Matthias Krüger [Mon, 29 Aug 2022 04:34:44 +0000 (06:34 +0200)]
Rollup merge of #100437 - compiler-errors:better-const-mismatch-err, r=oli-obk

Improve const mismatch `FulfillmentError`

Fixes #100414

22 months agoRollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk
Matthias Krüger [Mon, 29 Aug 2022 04:34:43 +0000 (06:34 +0200)]
Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk

Replace `Body::basic_blocks()` with field access

Since the refactoring in #98930, it is possible to borrow the basic blocks
independently from other parts of MIR by accessing the `basic_blocks` field
directly.

Replace unnecessary `Body::basic_blocks()` method with a direct field access,
which has an additional benefit of borrowing the basic blocks only.

22 months agoRollup merge of #96334 - devnexen:socket_mark, r=dtolnay
Matthias Krüger [Mon, 29 Aug 2022 04:34:42 +0000 (06:34 +0200)]
Rollup merge of #96334 - devnexen:socket_mark, r=dtolnay

socket `set_mark` addition.

to be able to set a marker/id on the socket for network filtering
 (iptables/ipfw here) purpose.

22 months agoRollup merge of #94890 - marmeladema:ip-addr-try-from-bytes, r=joshtriplett
Matthias Krüger [Mon, 29 Aug 2022 04:34:41 +0000 (06:34 +0200)]
Rollup merge of #94890 - marmeladema:ip-addr-try-from-bytes, r=joshtriplett

Support parsing IP addresses from a byte string

Fixes #94821

The goal is to be able to parse addresses from a byte string without requiring to do any utf8 validation. Since internally the parser already works on byte strings, this should be possible and I personally already needed this in the past too.

~~I used the proposed approach from the issue by implementing `TryFrom<&'a [u8]>` for all 6 address types (3 ip address types and 3 socket address types). I believe implementing stable traits for stable types is insta-stable so this will probably need an FCP?~~

Switched to an unstable inherent method approach called `parse_ascii` as requested.

cc ``````@jyn514``````

22 months agoSimplify get_trait_ref a bit
Michael Goulet [Mon, 29 Aug 2022 04:19:14 +0000 (04:19 +0000)]
Simplify get_trait_ref a bit

22 months agoUse posix_spawn for absolute paths on macOS
Rain [Sat, 20 Aug 2022 01:24:21 +0000 (18:24 -0700)]
Use posix_spawn for absolute paths on macOS

Currently, on macOS, Rust never uses the fast posix_spawn path if a
directory change is requested due to a bug in Apple's libc. However, the
bug is only triggered if the program is a relative path.

This PR makes it so that the fast path continues to work if the program
is an absolute path or a lone filename.

This was an alternative proposed in
https://github.com/rust-lang/rust/pull/80537#issue-776674009, and it
makes a measurable performance difference in some of my code that spawns
thousands of processes.

22 months agoAuto merge of #100908 - lnicola:rust-analyzer-2022-08-23, r=lnicola
bors [Mon, 29 Aug 2022 02:16:57 +0000 (02:16 +0000)]
Auto merge of #100908 - lnicola:rust-analyzer-2022-08-23, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

22 months agocheck_missing_items.py: Check imports
Nixon Enraght-Moony [Sun, 28 Aug 2022 01:43:13 +0000 (02:43 +0100)]
check_missing_items.py: Check imports

22 months agoRustdoc-Json: Retain Stripped Modules when they are imported, not when they have...
Nixon Enraght-Moony [Sun, 28 Aug 2022 01:35:44 +0000 (02:35 +0100)]
Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items.

Fixes #101103
Fixes #100973

22 months agoAuto merge of #100578 - Urgau:float-next-up-down, r=scottmcm
bors [Sun, 28 Aug 2022 22:31:19 +0000 (22:31 +0000)]
Auto merge of #100578 - Urgau:float-next-up-down, r=scottmcm

Add next_up and next_down for f32/f64 - take 2

This is a revival of https://github.com/rust-lang/rust/pull/88728 which staled due to inactivity of the original author. I've address the last review comment.

---

This is a pull request implementing the features described at https://github.com/rust-lang/rfcs/pull/3173.

`@rustbot` label +T-libs-api -T-libs
r? `@scottmcm`
cc `@orlp`

22 months agoStabilize `std::io::read_to_string`
Noah Lev [Tue, 9 Aug 2022 18:08:56 +0000 (11:08 -0700)]
Stabilize `std::io::read_to_string`

22 months agoAuto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot
bors [Sun, 28 Aug 2022 18:31:08 +0000 (18:31 +0000)]
Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot

Avoid cloning a collection only to iterate over it

`@rustbot` label: +C-cleanup

22 months agoentirely get rid of NeedsRfc CTFE errors
Ralf Jung [Sun, 28 Aug 2022 17:31:36 +0000 (13:31 -0400)]
entirely get rid of NeedsRfc CTFE errors

22 months agoCTFE: exposing pointers and calling extern fn doesn't need an RFC, it is just impossible
Ralf Jung [Sun, 28 Aug 2022 17:13:13 +0000 (13:13 -0400)]
CTFE: exposing pointers and calling extern fn doesn't need an RFC, it is just impossible

22 months agoimprove OFFSET_IS_ADDR docs
Ralf Jung [Sun, 28 Aug 2022 17:01:56 +0000 (13:01 -0400)]
improve OFFSET_IS_ADDR docs

22 months agovalidation should only catch UB errors
Ralf Jung [Sun, 28 Aug 2022 15:48:55 +0000 (11:48 -0400)]
validation should only catch UB errors

22 months agoUse the declaration's SourceInfo for FnEntry retags, not the outermost
Ben Kimock [Sun, 28 Aug 2022 05:39:59 +0000 (01:39 -0400)]
Use the declaration's SourceInfo for FnEntry retags, not the outermost

22 months agoAuto merge of #100201 - RalfJung:thread-local-key, r=thomcc
bors [Sun, 28 Aug 2022 15:12:31 +0000 (15:12 +0000)]
Auto merge of #100201 - RalfJung:thread-local-key, r=thomcc

std: use realstd fast key when building tests

Under `cfg(test)`, the `std` crate is not the actual standard library, just any old crate we are testing. It imports the real standard library as `realstd`, and then does some careful `cfg` magic so that the crate built for testing uses the `realstd` global state rather than having its own copy of that.

However, this was not done for all global state hidden in std: the 'fast' version of thread-local keys, at least on some platforms, also involves some global state. Specifically its macOS version has this [`static REGISTERED`](https://github.com/rust-lang/rust/blob/bc63d5a26a65752fb105957d3235cc9c8cb0767f/library/std/src/sys/unix/thread_local_dtor.rs#L62) that would get duplicated. So this PR imports the 'fast' key type from `realstd` rather than using the local copy, to ensure its internal state (and that of the functions it calls) does not get duplicated.

I also noticed that the `__OsLocalKeyInner` is unused under `cfg(target_thread_local)`, so I removed it for that configuration. There was a comment saying macOS picks between `__OsLocalKeyInner` and `__FastLocalKeyInner` at runtime, but I think that comment is outdated -- I found no trace of such a runtime switching mechanism, and the library still check-builds on apple targets with this PR. (I don't have a Mac so I cannot actually run it.)

22 months agofill-in tracking issue for `feature(drain_keep_rest)`
Maybe Waffle [Sun, 28 Aug 2022 13:02:37 +0000 (17:02 +0400)]
fill-in tracking issue for `feature(drain_keep_rest)`

22 months agoadd examples to `vec::Drain{,Filter}::keep_rest` docs
Maybe Waffle [Sun, 28 Aug 2022 12:38:26 +0000 (16:38 +0400)]
add examples to `vec::Drain{,Filter}::keep_rest` docs

22 months agoAuto merge of #96324 - berendjan:set_tcp_quickack, r=dtolnay
bors [Sun, 28 Aug 2022 12:26:37 +0000 (12:26 +0000)]
Auto merge of #96324 - berendjan:set_tcp_quickack, r=dtolnay

Add setter and getter for TCP_QUICKACK on TcpStream for Linux

Reference issue #96256

Setting TCP_QUICKACK on TcpStream for Linux

22 months agoRemove `register_attr`-related tests
Yuki Okushi [Sun, 28 Aug 2022 12:23:39 +0000 (21:23 +0900)]
Remove `register_attr`-related tests

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
22 months agoRemove `register_attr` feature
Yuki Okushi [Sun, 28 Aug 2022 12:23:23 +0000 (21:23 +0900)]
Remove `register_attr` feature

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
22 months agoAuto merge of #101115 - matthiaskrgr:rollup-iy14ztr, r=matthiaskrgr
bors [Sun, 28 Aug 2022 09:45:27 +0000 (09:45 +0000)]
Auto merge of #101115 - matthiaskrgr:rollup-iy14ztr, r=matthiaskrgr

Rollup of 13 pull requests

Successful merges:

 - #97015 (std::io: migrate ReadBuf to BorrowBuf/BorrowCursor)
 - #98301 (Add GDB/LLDB pretty-printers for NonZero types)
 - #99570 (Box::from(slice): Clarify that contents are copied)
 - #100296 (Add standard C error function aliases to last_os_error)
 - #100520 (Add mention of `BufReader` in `Read::bytes` docs)
 - #100885 (Export Cancel from std::os::fortanix_sgx::usercalls::raw)
 - #100955 (Some papercuts on error::Error)
 - #101002 (Provide structured suggestion for `hashmap[idx] = val`)
 - #101038 (no alignment check during interning)
 - #101055 (Use smaller span for suggestions)
 - #101091 (Extend attrs if local_def_id exists)
 - #101098 (rustc_middle: Remove `Visibility::Invisible`)
 - #101102 (unstable-book-gen: use std::fs::write)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRemove Attrs type alias
Guillaume Gomez [Sun, 28 Aug 2022 08:34:19 +0000 (10:34 +0200)]
Remove Attrs type alias

22 months agoRollup merge of #101102 - est31:unstable_book_gen_write, r=Mark-Simulacrum
Matthias Krüger [Sun, 28 Aug 2022 07:35:23 +0000 (09:35 +0200)]
Rollup merge of #101102 - est31:unstable_book_gen_write, r=Mark-Simulacrum

unstable-book-gen: use std::fs::write

I wrote this code in 2017 back when std::fs::write wasn't available.
Also, use the t macro from tidy.

22 months agoRollup merge of #101098 - petrochenkov:noinvis, r=TaKO8Ki
Matthias Krüger [Sun, 28 Aug 2022 07:35:22 +0000 (09:35 +0200)]
Rollup merge of #101098 - petrochenkov:noinvis, r=TaKO8Ki

rustc_middle: Remove `Visibility::Invisible`

It had a different meaning in the past, but now it's only used as an implementation detail of import resolution.

22 months agoRollup merge of #101091 - TaKO8Ki:fix-101076, r=notriddle
Matthias Krüger [Sun, 28 Aug 2022 07:35:21 +0000 (09:35 +0200)]
Rollup merge of #101091 - TaKO8Ki:fix-101076, r=notriddle

Extend attrs if local_def_id exists

Fixes #101076

22 months agoRollup merge of #101055 - TaKO8Ki:use-smaller-span, r=compiler-errors
Matthias Krüger [Sun, 28 Aug 2022 07:35:20 +0000 (09:35 +0200)]
Rollup merge of #101055 - TaKO8Ki:use-smaller-span, r=compiler-errors

Use smaller span for suggestions

22 months agoRollup merge of #101038 - RalfJung:interning-alignment, r=oli-obk
Matthias Krüger [Sun, 28 Aug 2022 07:35:19 +0000 (09:35 +0200)]
Rollup merge of #101038 - RalfJung:interning-alignment, r=oli-obk

no alignment check during interning

This should fix https://github.com/rust-lang/rust/issues/101034
r? `@oli-obk`

Unfortunately we don't have a self-contained testcase for this problem. I am not sure how it can be triggered...

22 months agoRollup merge of #101002 - estebank:hashmap-idx, r=davidtwco
Matthias Krüger [Sun, 28 Aug 2022 07:35:18 +0000 (09:35 +0200)]
Rollup merge of #101002 - estebank:hashmap-idx, r=davidtwco

Provide structured suggestion for `hashmap[idx] = val`

22 months agoRollup merge of #100955 - nrc:chain, r=joshtriplett
Matthias Krüger [Sun, 28 Aug 2022 07:35:17 +0000 (09:35 +0200)]
Rollup merge of #100955 - nrc:chain, r=joshtriplett

Some papercuts on error::Error

Renames the chain method, since I chain could mean anything and doesn't refer to a chain of sources (cc #58520) (and adds a comment explaining why sources is not a provided method on Error). Renames arguments to the request method from `req` to `demand` since the type is `Demand` rather than Request or Requisition.

r? ``@yaahc``

22 months agoRollup merge of #100885 - mzohreva:mz/sgx-export-cancel-type, r=Mark-Simulacrum
Matthias Krüger [Sun, 28 Aug 2022 07:35:16 +0000 (09:35 +0200)]
Rollup merge of #100885 - mzohreva:mz/sgx-export-cancel-type, r=Mark-Simulacrum

Export Cancel from std::os::fortanix_sgx::usercalls::raw

This was missed in https://github.com/rust-lang/rust/pull/100642

cc ``@raoulstrackx`` and ``@jethrogb``

22 months agoRollup merge of #100520 - jakubdabek:patch-1, r=thomcc
Matthias Krüger [Sun, 28 Aug 2022 07:35:15 +0000 (09:35 +0200)]
Rollup merge of #100520 - jakubdabek:patch-1, r=thomcc

Add mention of `BufReader` in `Read::bytes` docs

There is a general paragraph about `BufRead` in the `Read` trait's docs, however using `bytes` without `BufRead` *always* has a large impact, due to reads of size 1.

`@rustbot` label +A-docs