]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #95281 - pierwill:fix-85513, r=Dylan-DPC
Dylan DPC [Wed, 11 May 2022 11:49:28 +0000 (13:49 +0200)]
Rollup merge of #95281 - pierwill:fix-85513, r=Dylan-DPC

Fix inaccurate function name in `rustc_const_eval` docs

Looks to me like this fixes #85513. I had trouble making a intra-docs link to `eval_place_to_op` work, though...

2 years agoRollup merge of #91518 - luojia65:rustdoc-riscv-arch, r=GuillaumeGomez
Dylan DPC [Wed, 11 May 2022 11:49:27 +0000 (13:49 +0200)]
Rollup merge of #91518 - luojia65:rustdoc-riscv-arch, r=GuillaumeGomez

Add readable rustdoc display for RISC-V target

This pull request adds a human readable rustdoc display for RISC-V architecture. Target configuration marked as `#[cfg(target_arch = "riscv32")]` or `#[cfg(target_arch = "riscv64")]` are pretty formatted like `RISC-V RV32` and `RISC-V RV64` in Rust docs.

Before:

![图片](https://user-images.githubusercontent.com/40385009/152681944-58d758ae-ac4f-412b-b70c-1e673a2a071e.png)

After:

![图片](https://user-images.githubusercontent.com/40385009/152681923-91d5fe75-c3b2-4ac2-865c-54eac0aefe8d.png)

2 years agoAuto merge of #96933 - ehuss:update-books, r=ehuss
bors [Wed, 11 May 2022 08:48:11 +0000 (08:48 +0000)]
Auto merge of #96933 - ehuss:update-books, r=ehuss

Update books

## nomicon

9 commits in c7d8467ca9158da58ef295ae65dbf00a308752d9..10d40c59a581c66d8ecd29ad18d410bf97ed524d
2022-04-06 14:26:54 +0900 to 2022-05-07 10:45:07 +0900
- Introducing init/uninit before its use (rust-lang/nomicon#355)
- Change will to would to discuss what don't occur (rust-lang/nomicon#361)
- State that pop for length 1 is an example (rust-lang/nomicon#360)
- Correct a sentence that didn't seem to be proper (rust-lang/nomicon#358)
- Indicate that C reference are C reference (rust-lang/nomicon#357)
- Introduce and avoid dropck (rust-lang/nomicon#353)
- Rephrase improperly reduced borrows introduction (rust-lang/nomicon#352)
- Two lifetime clarification (rust-lang/nomicon#350)
- "UB" vs "Undefined Behavior" (rust-lang/nomicon#349)

## reference

9 commits in b5f6c2362baf932db9440fbfcb509b309237ee85..8e36971959ff238b5aa2575fbc7a2e09e1313e82
2022-04-10 19:19:51 -0700 to 2022-05-09 17:20:59 -0700
- Stop saying that const functions cannot use 'extern' (rust-lang/reference#1207)
- Moved the option variant imports (rust-lang/reference#1208)
- #[must_use] on traits also affects trait objects (rust-lang/reference#1203)
- Don't use PathPattern in RangePattern bounds (rust-lang/reference#1204)
- Inline assembly: Add kreg0 register class (rust-lang/reference#1205)
- Fix crate_type attribute examples (rust-lang/reference#1201)
- Say that that the default function return type is the unit type (rust-lang/reference#1199)
- Clarify guarantees provided by repr(packed) (rust-lang/reference#1163)
- Document the Termination trait for main() and test functions (rust-lang/reference#1194)

## book

43 commits in de0dbffc5812fd885700874e8d258dd334733ac4..d9415b7cbfcb4b24062683f429bd0ff535396362
2022-04-18 19:29:45 -0400 to 2022-05-09 09:10:44 -0400
- Update ch09-02-recoverable-errors-with-result.md
- Added missing be 2
- Added missing be
- Move hardcoded string into status_line to be consistent
- Fix trailing space
- Propagate tech review edits back to src
- Change "semantics" to "mechanics"; when referring to compiler behavior, rather than syntax.
- Propagate some edits to ch4 snapshot
- Suggestions from tech review
- Propagate edits to src
- Propagate edits back to nostarch version
- Clarify sentences about lock types. Fixes rust-lang/book#2937.
- Edits to edits to chapter 16
- Edits from nostarch for chapter 16
- Propagate nostarch edits back to src
- Add words to dictionary
- Propagating edits back to the nostarch snapshot
- Small wording change. Fixes rust-lang/book#3112.
- Clarify the kind of manual cleanup meant here
- Edits to edits to chapter 15
- Edits from nostarch
- Add missing word
- Improve sentence structure
- fix unidiomatic new functions in chapter 15
- Propagate nostarch ch14 to src
- Update a link and the -p publishing instructions
- Actually, I don't think we need to show the command output here
- Edits to edits to chapter 14
- Update manual regeneration instructions
- Reflect the addition of the -p flag in Cargo 1.56 in chapter 14
- Change polarity and names of variables in env var section
- Propagate nostarch edits back to ch 12
- Change environment variable and field name to perhaps be less confusing
- Responses to nostarch edits
- Merge remote-tracking branch 'origin/ch13'
- Fix rust-lang/book#3002 use noplayground with common.rs
- Propagate ch3 edits to src
- Updating chapter 3 to use new println style
- Specify loop label format. Fixes rust-lang/book#3105.
- Clarify function definition must be in an accessible scope. Fixes rust-lang/book#3003
- Addressing tech review comments, propagating other changes
- Comments from tech review
- Chapter 3, section 2 - Add explicit type annotation to example of scalar type char.

## rust-by-example

6 commits in 44a80e8d8bfc5881c9bd69a2cb3a570776ee4181..e9f93cfcf410bc092c9107b8a41a82f144c761f2
2022-04-19 07:46:28 -0300 to 2022-05-08 18:24:06 -0300
- Add empty slice example (rust-lang/rust-by-example#1538)
- Enhancement/print (rust-lang/rust-by-example#1536)
- Update cast.md (rust-lang/rust-by-example#1521)
- Update iter_any.md (rust-lang/rust-by-example#1522)
- Update tuples.md (rust-lang/rust-by-example#1524)
- fix indent in fs.md (rust-lang/rust-by-example#1535)

## rustc-dev-guide

8 commits in 043e60f4f191651e9f8bf52fa32df14defbb23d9..0c02acdb6f48f03907a02ea8e537c3272b4fde9f
2022-04-20 18:57:49 +0900 to 2022-05-10 09:45:31 -0300
- Update overview.md (rust-lang/rustc-dev-guide#1351)
- Update date references on parallel-rustc (rust-lang/rustc-dev-guide#1348)
- mention `WithOptConstParam` (rust-lang/rustc-dev-guide#1346)
- Fix format (rust-lang/rustc-dev-guide#1349)
- correct type of SubstsRef (rust-lang/rustc-dev-guide#1347)
- Document ErrorGuaranteed (rust-lang/rustc-dev-guide#1316)
- Edit "What the compiler does to your code" (rust-lang/rustc-dev-guide#1306)
- Update some date refs

2 years agoAuto merge of #96931 - JohnTitor:rollup-3um8o4j, r=JohnTitor
bors [Wed, 11 May 2022 06:29:04 +0000 (06:29 +0000)]
Auto merge of #96931 - JohnTitor:rollup-3um8o4j, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #96543 (Remove hacks in `make_token_stream`.)
 - #96887 (rustdoc: correct path to type alias methods)
 - #96896 (Add regression test for #68408)
 - #96900 (Fix js error)
 - #96903 (Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes)
 - #96916 (simplify length count)
 - #96925 (Fix issue #95151)

Failed merges:

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

2 years agoUpdate books
Eric Huss [Wed, 11 May 2022 05:27:45 +0000 (22:27 -0700)]
Update books

2 years agoRollup merge of #96925 - c410-f3r:z-errors, r=JohnTitor
Yuki Okushi [Wed, 11 May 2022 04:16:35 +0000 (13:16 +0900)]
Rollup merge of #96925 - c410-f3r:z-errors, r=JohnTitor

Fix issue #95151

Fixes  #95151

Nothing special here, just a test for a thing that used to ICE.

2 years agoRollup merge of #96916 - matthiaskrgr:simpl_count, r=compiler-errors
Yuki Okushi [Wed, 11 May 2022 04:16:34 +0000 (13:16 +0900)]
Rollup merge of #96916 - matthiaskrgr:simpl_count, r=compiler-errors

simplify length count

2 years agoRollup merge of #96903 - oli-obk:opaque_type_lifetime_constraints, r=compiler-errors
Yuki Okushi [Wed, 11 May 2022 04:16:34 +0000 (13:16 +0900)]
Rollup merge of #96903 - oli-obk:opaque_type_lifetime_constraints, r=compiler-errors

Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes

fixes https://github.com/rust-lang/rust/issues/96564

TLDR:

```rust
fn execute(ty: Ty<'_>) -> &str { todo!() }
```

(`Ty` being a type alias impl trait) used to produce the following error before this PR

```
error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
 --> src/lib.rs:4:27
  |
4 | fn execute(ty: Ty<'_>) -> &str { todo!() }
  |                           ^^^^
  |
  = note: lifetimes appearing in an associated type are not considered constrained
```

2 years agoRollup merge of #96900 - GuillaumeGomez:fix-js-error, r=notriddle
Yuki Okushi [Wed, 11 May 2022 04:16:33 +0000 (13:16 +0900)]
Rollup merge of #96900 - GuillaumeGomez:fix-js-error, r=notriddle

Fix js error

On the source code pages, we get a JS error:

![Screenshot from 2022-05-10 16-26-53](https://user-images.githubusercontent.com/3050060/167656292-51e0b0e9-6b0c-4f94-82e0-dd8fb77adf52.png)

It's fixed in the first commit. The second one is removing an unused CSS rule and the third one is a little cleanup of a GUI test.

cc ``@jsha``
r? ``@notriddle``

2 years agoRollup merge of #96896 - JohnTitor:issue-68408, r=compiler-errors
Yuki Okushi [Wed, 11 May 2022 04:16:32 +0000 (13:16 +0900)]
Rollup merge of #96896 - JohnTitor:issue-68408, r=compiler-errors

Add regression test for #68408

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

2 years agoRollup merge of #96887 - notriddle:notriddle/as-raw-fd, r=jsha
Yuki Okushi [Wed, 11 May 2022 04:16:31 +0000 (13:16 +0900)]
Rollup merge of #96887 - notriddle:notriddle/as-raw-fd, r=jsha

rustdoc: correct path to type alias methods

Fixes #83991

2 years agoRollup merge of #96543 - nnethercote:rm-make_token_stream-hacks, r=Aaron1011
Yuki Okushi [Wed, 11 May 2022 04:16:30 +0000 (13:16 +0900)]
Rollup merge of #96543 - nnethercote:rm-make_token_stream-hacks, r=Aaron1011

Remove hacks in `make_token_stream`.

`make_tokenstream` has three commented hacks, and a comment at the top
referring to #67062. These hacks have no observable effect, at least as judged
by running the test suite. The hacks were added in #82608, with an explanation
[here](https://github.com/rust-lang/rust/pull/82608#issuecomment-812877329). It
appears that one of the following is true: (a) they never did anything useful,
(b) they do something useful but we have no test coverage for them, or (c)
something has changed in the meantime that means they are no longer necessary.

This commit removes the hacks and the comments, in the hope that (b) is not
true.

r? `@Aaron1011`

2 years agoAuto merge of #96888 - Aaron1011:fake-borrow-no-sort, r=petrochenkov
bors [Wed, 11 May 2022 04:09:45 +0000 (04:09 +0000)]
Auto merge of #96888 - Aaron1011:fake-borrow-no-sort, r=petrochenkov

Use `FxIndexSet` to avoid sorting fake borrows

This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test

The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)

2 years agoAuto merge of #96375 - jyn514:bootstrap-submodules, r=Mark-Simulacrum
bors [Wed, 11 May 2022 00:41:50 +0000 (00:41 +0000)]
Auto merge of #96375 - jyn514:bootstrap-submodules, r=Mark-Simulacrum

Fix running bootstrap tests on a fresh clone

In #96303, I changed the tests not to manage submodules, with the main
goal of avoiding a clone for llvm-project. Unfortunately, there are some tests
which depend on submodules - I didn't notice locally because they were already checked out for me,
and CI doesn't use submodule handling at all. Fresh clones, however, were impacted:
```
failures:

---- builder::tests::defaults::doc_default stdout ----
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with No such file or directory (os error 2)', src/bootstrap/doc.rs:232:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- builder::tests::dist::dist_only_cross_host stdout ----
thread 'main' panicked at 'fs::read_to_string(&toml_file_name) failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1314:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Try and get the best of both worlds by only checking out the submodules actually used in tests.

2 years agoRemove some unnecessary invisible delimiter checks.
Nicholas Nethercote [Wed, 11 May 2022 00:14:49 +0000 (10:14 +1000)]
Remove some unnecessary invisible delimiter checks.

These seem to have no useful effect... they don't seem useful from a
code inspection point of view, and they affect anything in the test
suite.

2 years agoIgnore order
Michael Howell [Tue, 10 May 2022 23:42:48 +0000 (16:42 -0700)]
Ignore order

This isn't an ordering test really, anyway...

2 years agoFix running bootstrap tests on a fresh clone
Joshua Nelson [Mon, 25 Apr 2022 00:53:06 +0000 (19:53 -0500)]
Fix running bootstrap tests on a fresh clone

In #96303, I changed the tests not to manage submodules, with the main
goal of avoiding a clone for llvm-project. Unfortunately, there are some tests
which depend on submodules - I didn't notice locally because they were already checked out for me,
and CI doesn't use submodule handling at all. Fresh clones, however, were impacted:
```
failures:

---- builder::tests::defaults::doc_default stdout ----
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with No such file or directory (os error 2)', src/bootstrap/doc.rs:232:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- builder::tests::dist::dist_only_cross_host stdout ----
thread 'main' panicked at 'fs::read_to_string(&toml_file_name) failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1314:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Try and get the best of both worlds by only checking out the submodules actually used in tests.

2 years agoFix issue #95151
Caio [Tue, 10 May 2022 21:29:35 +0000 (18:29 -0300)]
Fix issue #95151

2 years agoAuto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, r=joshtriplett
bors [Tue, 10 May 2022 21:19:19 +0000 (21:19 +0000)]
Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, r=joshtriplett

Make `BorrowedFd::borrow_raw` a const fn.

Making `BorrowedFd::borrow_raw` a const fn allows it to be used to
create a constant `BorrowedFd<'static>` holding constants such as
`AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn.

For consistency, make similar changes to `BorrowedHandle::borrow_raw`
and `BorrowedSocket::borrow_raw`.

[`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html

r? `@joshtriplett`

2 years agosimplify length count
Matthias Krüger [Tue, 10 May 2022 18:42:45 +0000 (20:42 +0200)]
simplify length count

2 years agoAuto merge of #96905 - jyn514:revert-96803-faster-assemble, r=Mark-Simulacrum
bors [Tue, 10 May 2022 18:26:31 +0000 (18:26 +0000)]
Auto merge of #96905 - jyn514:revert-96803-faster-assemble, r=Mark-Simulacrum

Revert "Make "Assemble stage1 compiler" orders of magnitude faster"

Reverts rust-lang/rust#96803. This caused `llvm-tools-nightly` to fail when installing with `rustup-toolchain-install-master` because of the presence of symlinks. I'm not sure how the symlinks got in there, but revert the PR for now while I figure it out.

r? `@Mark-Simulacrum` cc `@RalfJung`

2 years agorustdoc: clean up method path index
Michael Howell [Tue, 10 May 2022 15:59:59 +0000 (08:59 -0700)]
rustdoc: clean up method path index

This removes a special case that doesn't seem to do anything
any more.

2 years agoRevert "Make "Assemble stage1 compiler" orders of magnitude faster"
Joshua Nelson [Tue, 10 May 2022 15:58:52 +0000 (10:58 -0500)]
Revert "Make "Assemble stage1 compiler" orders of magnitude faster"

2 years agoAuto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitor
bors [Tue, 10 May 2022 15:58:17 +0000 (15:58 +0000)]
Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #96717 (Handle mismatched generic param kinds in trait impls betterly)
 - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows)
 - #96849 (Move some tests to more reasonable places)
 - #96861 (Use Rust 2021 prelude in std itself.)
 - #96879 (rustdoc: search result ranking fix)
 - #96882 (Don't subst an AdtDef with its own substs)

Failed merges:

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

2 years agoRollup merge of #96882 - jackh726:no-subst, r=oli-obk
Yuki Okushi [Tue, 10 May 2022 15:09:36 +0000 (00:09 +0900)]
Rollup merge of #96882 - jackh726:no-subst, r=oli-obk

Don't subst an AdtDef with its own substs

2 years agoRollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez
Yuki Okushi [Tue, 10 May 2022 15:09:35 +0000 (00:09 +0900)]
Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez

rustdoc: search result ranking fix

# Before

![image](https://user-images.githubusercontent.com/1593513/167477286-91049761-67f9-4a73-8fb7-09dbb19ca76c.png)

# After

![image](https://user-images.githubusercontent.com/1593513/167477345-6733bc0f-4bb2-4625-9f7f-094031e36414.png)

2 years agoRollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplett
Yuki Okushi [Tue, 10 May 2022 15:09:34 +0000 (00:09 +0900)]
Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplett

Use Rust 2021 prelude in std itself.

2 years agoRollup merge of #96849 - c410-f3r:z-errors, r=petrochenkov
Yuki Okushi [Tue, 10 May 2022 15:09:33 +0000 (00:09 +0900)]
Rollup merge of #96849 - c410-f3r:z-errors, r=petrochenkov

Move some tests to more reasonable places

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`

2 years agoRollup merge of #96725 - nico-abram:win_tid, r=ChrisDenton
Yuki Okushi [Tue, 10 May 2022 15:09:32 +0000 (00:09 +0900)]
Rollup merge of #96725 - nico-abram:win_tid, r=ChrisDenton

Expose process windows_process_extensions_main_thread_handle on Windows

~~I did not find any tests in https://github.com/rust-lang/rust/blob/7d3e03666a93bd2b0f78b3933f9305832af771a5/library/std/src/sys/windows/process/tests.rs that actually launch processes, so I haven't added tests for this.~~ I ran the following locally, to check that it works as expected:
```rs
#![feature(windows_process_extensions_main_thread_handle)]

fn main() {
    use std::os::windows::process::{ChildExt, CommandExt};
    const CREATE_SUSPENDED: u32 = 0x00000004;

    let proc = std::process::Command::new("cmd")
        .args(["/C", "echo hello"])
        .creation_flags(CREATE_SUSPENDED)
        .spawn()
        .unwrap();

    extern "system" {
        fn ResumeThread(_: *mut std::ffi::c_void) -> u32;
    }
    unsafe {
        ResumeThread(proc.main_thread_handle());
    }

    let output = proc.wait_with_output().unwrap();
    let str_output = std::str::from_utf8(&output.stdout[..]).unwrap();
    println!("{}", str_output);
}

```

Without the feature attribute it wouldn't compile, and commenting the `ResumeThread` line makes it hang forever, showing that it works.

Trakcing issue https://github.com/rust-lang/rust/issues/96723

2 years agoRollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnr
Yuki Okushi [Tue, 10 May 2022 15:09:31 +0000 (00:09 +0900)]
Rollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnr

Handle mismatched generic param kinds in trait impls betterly

- Check that generic params on a generic associated type are the same as in the trait definition
- Check that const generics are not used in place of type generics (and the other way round too)

r? `@lcnr`

2 years agoUse lifetimes on type-alias-impl-trait used in function signatures to infer output...
Oli Scherer [Tue, 10 May 2022 14:50:31 +0000 (14:50 +0000)]
Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes

2 years agoClean up rustdoc GUI test
Guillaume Gomez [Tue, 10 May 2022 14:42:34 +0000 (16:42 +0200)]
Clean up rustdoc GUI test

2 years agoRemove unused CSS rule
Guillaume Gomez [Tue, 10 May 2022 14:40:32 +0000 (16:40 +0200)]
Remove unused CSS rule

2 years agoFix JS error in source code pages
Guillaume Gomez [Tue, 10 May 2022 14:40:14 +0000 (16:40 +0200)]
Fix JS error in source code pages

2 years agoAuto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwco
bors [Tue, 10 May 2022 13:39:43 +0000 (13:39 +0000)]
Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwco

Check hidden types for well formedness at the definition site instead of only at the opaque type itself

work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.

2 years agoAdd regression test for #68408
Yuki Okushi [Tue, 10 May 2022 11:52:01 +0000 (20:52 +0900)]
Add regression test for #68408

2 years agoAuto merge of #94799 - lcnr:list-ty-perf, r=petrochenkov
bors [Tue, 10 May 2022 10:53:47 +0000 (10:53 +0000)]
Auto merge of #94799 - lcnr:list-ty-perf, r=petrochenkov

update `hash_stable` for `List<Ty<'tcx>>`

cc https://github.com/rust-lang/rust/pull/93505#issuecomment-1047538798

this is the hottest part changed since the pre-merge perf run

2 years agoAuto merge of #96891 - Dylan-DPC:rollup-echa4wg, r=Dylan-DPC
bors [Tue, 10 May 2022 08:12:50 +0000 (08:12 +0000)]
Auto merge of #96891 - Dylan-DPC:rollup-echa4wg, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #93661 (Add missing rustc arg docs)
 - #96674 (docs: add link explaining variance to NonNull docs)
 - #96812 (Do not lint on explicit outlives requirements from external macros.)
 - #96823 (Properly fix #96638)
 - #96872 (make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks)

Failed merges:

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

2 years agoCheck hidden types for well formedness at the definition site instead of only at...
Oli Scherer [Thu, 5 May 2022 14:14:06 +0000 (14:14 +0000)]
Check hidden types for well formedness at the definition site instead of only at the opaque type itself

2 years agoRollup merge of #96872 - RalfJung:layout-sanity, r=eddyb
Dylan DPC [Tue, 10 May 2022 06:24:05 +0000 (08:24 +0200)]
Rollup merge of #96872 - RalfJung:layout-sanity, r=eddyb

make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks

`@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution!

I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones.

Cc `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/96221

2 years agoRollup merge of #96823 - jackh726:params-heuristics-fix, r=estebank
Dylan DPC [Tue, 10 May 2022 06:24:04 +0000 (08:24 +0200)]
Rollup merge of #96823 - jackh726:params-heuristics-fix, r=estebank

Properly fix #96638

Closes #96638

The main part of this change is `Error::Invalid` now returns both the input and arg indices. However, I realized the code here was kind of confusing and not internally consistent (and thus I was having trouble getting the right behavior). So I've also switched `input_indices` and `arg_indices` to more closely match some naming in `checks` (although I think a more thorough cleanup there could be beneficial). I've added comments, but essentially `input_indices` refers to *user provided* inputs and `arg_indices` refers to *expected* args.

2 years agoRollup merge of #96812 - cjgillot:no-lint-outllives-macro, r=petrochenkov
Dylan DPC [Tue, 10 May 2022 06:24:03 +0000 (08:24 +0200)]
Rollup merge of #96812 - cjgillot:no-lint-outllives-macro, r=petrochenkov

Do not lint on explicit outlives requirements from external macros.

The current implementation of the list rightfully skipped where predicates from external macros.
However, if the where predicate came from the current macro but the bounds were from an external macro, the lint still fired.

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

2 years agoRollup merge of #96674 - bstrie:vardoc, r=thomcc
Dylan DPC [Tue, 10 May 2022 06:24:02 +0000 (08:24 +0200)]
Rollup merge of #96674 - bstrie:vardoc, r=thomcc

docs: add link explaining variance to NonNull docs

2 years agoRollup merge of #93661 - ehuss:add-missing-rustc-arg-docs, r=estebank,Mark-Simulacrum
Dylan DPC [Tue, 10 May 2022 06:24:00 +0000 (08:24 +0200)]
Rollup merge of #93661 - ehuss:add-missing-rustc-arg-docs, r=estebank,Mark-Simulacrum

Add missing rustc arg docs

Add documentation for recently added rustc args

`-C symbol-mangling-version` was stabilized in #90128.
`--json=future-incompat` was stabilized in #91535.

2 years agoExpose process main_thread_handle on Windows
unknown [Tue, 10 May 2022 05:41:19 +0000 (02:41 -0300)]
Expose process main_thread_handle on Windows

2 years agoAuto merge of #96808 - cjgillot:impossible-trait, r=compiler-errors
bors [Tue, 10 May 2022 05:27:54 +0000 (05:27 +0000)]
Auto merge of #96808 - cjgillot:impossible-trait, r=compiler-errors

Detect trait fulfillment in `subst_and_check_impossible_predicates`

Split from https://github.com/rust-lang/rust/pull/91743
r? `@compiler-errors`

2 years agoAuto merge of #96803 - jyn514:faster-assemble, r=Mark-Simulacrum
bors [Tue, 10 May 2022 03:11:05 +0000 (03:11 +0000)]
Auto merge of #96803 - jyn514:faster-assemble, r=Mark-Simulacrum

Make "Assemble stage1 compiler" orders of magnitude faster

This used to take upwards of 5 seconds for me locally. I found that the culprit was copying the downloaded LLVM shared object:
```
[22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so"
[22:28:09]   c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } }
```

It turned out that `install()` used full copies unconditionally. Change it to try using a hard-link before falling back to copying.

2 years agoUse `FxIndexSet` to avoid sorting fake borrows
Aaron Hill [Tue, 10 May 2022 02:27:47 +0000 (22:27 -0400)]
Use `FxIndexSet` to avoid sorting fake borrows

This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test

The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)

2 years agorustdoc: correct path to type alias methods
Michael Howell [Tue, 10 May 2022 00:50:39 +0000 (17:50 -0700)]
rustdoc: correct path to type alias methods

2 years agoAuto merge of #96715 - cjgillot:trait-alias-loop, r=compiler-errors
bors [Tue, 10 May 2022 00:40:57 +0000 (00:40 +0000)]
Auto merge of #96715 - cjgillot:trait-alias-loop, r=compiler-errors

Fortify handing of where bounds on trait & trait alias definitions

Closes https://github.com/rust-lang/rust/issues/96664
Closes https://github.com/rust-lang/rust/issues/96665

Since https://github.com/rust-lang/rust/pull/93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters.  Both bugs were hidden by the special handling of bounds at  the generic parameter declaration position.

Trait alias expansion used to confuse predicates on `Self` and where predicates.
Exiting too late when listing all the bounds caused a cycle error.

2 years agoAuto merge of #96838 - tmiasko:lazy-switch-sources, r=oli-obk
bors [Mon, 9 May 2022 22:15:30 +0000 (22:15 +0000)]
Auto merge of #96838 - tmiasko:lazy-switch-sources, r=oli-obk

Optimize switch sources representation and usage

* Avoid constructing switch sources unless necessary - switch sources are used by backward analysis with a custom switch int edge effects, but are otherwise unnecessarily computed.
* Use sparse representation of switch sources to avoid quadratic space overhead.

2 years agoDon't subst an adt def
Jack Huey [Mon, 9 May 2022 20:04:31 +0000 (16:04 -0400)]
Don't subst an adt def

2 years agoAuto merge of #96473 - lcnr:querify-codegen-fn-attrs, r=cjgillot
bors [Mon, 9 May 2022 19:52:59 +0000 (19:52 +0000)]
Auto merge of #96473 - lcnr:querify-codegen-fn-attrs, r=cjgillot

store `codegen_fn_attrs` in crate metadata

extracted from #95562 because the change isn't trivial.

2 years agoalso sanity-check Abi::Vector, and slight refactoring
Ralf Jung [Mon, 9 May 2022 18:13:25 +0000 (20:13 +0200)]
also sanity-check Abi::Vector, and slight refactoring

2 years agoAdd test case for `hashset::insert` ranking
Michael Howell [Mon, 9 May 2022 19:17:47 +0000 (12:17 -0700)]
Add test case for `hashset::insert` ranking

2 years agorustdoc: search result ranking fix
Michael Howell [Mon, 9 May 2022 18:46:24 +0000 (11:46 -0700)]
rustdoc: search result ranking fix

2 years agoProperly fix issue 96638
Jack Huey [Sat, 7 May 2022 18:12:01 +0000 (14:12 -0400)]
Properly fix issue 96638

2 years agoAuto merge of #96877 - matthiaskrgr:rollup-evlh6ot, r=matthiaskrgr
bors [Mon, 9 May 2022 17:23:34 +0000 (17:23 +0000)]
Auto merge of #96877 - matthiaskrgr:rollup-evlh6ot, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #95483 (Improve floating point documentation)
 - #96008 (Warn on unused `#[doc(hidden)]` attributes on trait impl items)
 - #96841 (Revert "Implement [OsStr]::join", which was merged without FCP.)
 - #96844 (Actually fix ICE from #96583)
 - #96854 (Some subst cleanup)
 - #96858 (Remove unused param from search.js::checkPath)

Failed merges:

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

2 years agoPoint to the empty trait alias.
Camille GILLOT [Mon, 9 May 2022 17:03:37 +0000 (19:03 +0200)]
Point to the empty trait alias.

2 years agoRollup merge of #96858 - notriddle:notriddle/cleanup-search-js, r=GuillaumeGomez
Matthias Krüger [Mon, 9 May 2022 16:45:40 +0000 (18:45 +0200)]
Rollup merge of #96858 - notriddle:notriddle/cleanup-search-js, r=GuillaumeGomez

Remove unused param from search.js::checkPath

2 years agoRollup merge of #96854 - jackh726:subst-cleanup, r=compiler-errors
Matthias Krüger [Mon, 9 May 2022 16:45:39 +0000 (18:45 +0200)]
Rollup merge of #96854 - jackh726:subst-cleanup, r=compiler-errors

Some subst cleanup

Two separate things here. Both changes are useful for some refactoring I'm doing to add an "EarlyBinder" newtype. (Part of chalkification).

1) Remove `subst_spanned` and just use `subst`. It wasn't used much anyways. In practice, I think we can probably get most of the info just from the actual error message. If not, outputting logs should do the trick. (The specific line probably wouldn't help much anyways).

2) Call `.subst()` before `replace_bound_vars_with_fresh_vars` and `erase_late_bound_regions` in three places that do the opposite. I think there might have been some time in the past that the order here matter for something, but this shouldn't be the case anymore. Conceptually, it makes more sense to the of the *early bound* vars on `fn`s as "outside" the late bound vars.

2 years agoRollup merge of #96844 - Badel2:actually-fix-96583, r=compiler-errors
Matthias Krüger [Mon, 9 May 2022 16:45:38 +0000 (18:45 +0200)]
Rollup merge of #96844 - Badel2:actually-fix-96583, r=compiler-errors

Actually fix ICE from #96583

PR #96746 fixed a very similar bug, so the same logic is used in a different place.

I originally concluded that the two issues (#96583 and #96738) were identical by comparing the backtrace, but I didn't look close enough.

2 years agoRollup merge of #96841 - thomcc:revert-osstr-join, r=m-ou-se
Matthias Krüger [Mon, 9 May 2022 16:45:37 +0000 (18:45 +0200)]
Rollup merge of #96841 - thomcc:revert-osstr-join, r=m-ou-se

Revert "Implement [OsStr]::join", which was merged without FCP.

This reverts commit 4fcbc53820ab423bbeb41f07822369aa05da1d68, see https://github.com/rust-lang/rust/pull/96744. (I'm terribly sorry, and truly don't remember r+ing it, or even having seen it before yesterday, which is... genuinely very worrisome for me).

r? `@m-ou-se`

2 years agoRollup merge of #96008 - fmease:warn-on-useless-doc-hidden-on-assoc-impl-items, r...
Matthias Krüger [Mon, 9 May 2022 16:45:36 +0000 (18:45 +0200)]
Rollup merge of #96008 - fmease:warn-on-useless-doc-hidden-on-assoc-impl-items, r=lcnr

Warn on unused `#[doc(hidden)]` attributes on trait impl items

[Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60).

Whether an associated item in a trait impl is shown or hidden in the documentation entirely depends on the corresponding item in the trait declaration. Rustdoc completely ignores `#[doc(hidden)]` attributes on impl items. No error or warning is emitted:

```rust
pub trait Tr { fn f(); }
pub struct Ty;
impl Tr for Ty { #[doc(hidden)] fn f() {} }
//               ^^^^^^^^^^^^^^ ignored by rustdoc and currently
//                              no error or warning issued
```

This may lead users to the wrong belief that the attribute has an effect. In fact, several such cases are found in the standard library (I've removed all of them in this PR).
There does not seem to exist any incentive to allow this in the future either: Impl'ing a trait for a type means the type *fully* conforms to its API. Users can add `#[doc(hidden)]` to the whole impl if they want to hide the implementation or add the attribute to the corresponding associated item in the trait declaration to hide the specific item. Hiding an implementation of an associated item does not make much sense: The associated item can still be found on the trait page.

This PR emits the warn-by-default lint `unused_attribute` for this case with a future-incompat warning.

`@rustbot` label T-compiler T-rustdoc A-lint

2 years agoRollup merge of #95483 - golddranks:improve_float_docs, r=joshtriplett
Matthias Krüger [Mon, 9 May 2022 16:45:35 +0000 (18:45 +0200)]
Rollup merge of #95483 - golddranks:improve_float_docs, r=joshtriplett

Improve floating point documentation

This is my attempt to improve/solve https://github.com/rust-lang/rust/issues/95468 and https://github.com/rust-lang/rust/issues/73328 .

Added/refined explanations:
- Refine the "NaN as a special value" top level explanation of f32
- Refine `const NAN` docstring: add an explanation about there being multitude of NaN bitpatterns and disclaimer about the portability/stability guarantees.
- Refine `fn is_sign_positive` and `fn is_sign_negative` docstrings: add disclaimer about the sign bit of NaNs.
- Refine `fn min` and `fn max` docstrings: explain the semantics and their relationship to the standard and libm better.
- Refine `fn trunc` docstrings: explain the semantics slightly more.
- Refine `fn powi` docstrings: add disclaimer that the rounding behaviour might be different from `powf`.
- Refine `fn copysign` docstrings: add disclaimer about payloads of NaNs.
- Refine `minimum` and `maximum`: add disclaimer that "propagating NaN" doesn't mean that propagating the NaN bit patterns is guaranteed.
- Refine `max` and `min` docstrings: add "ignoring NaN" to bring the one-row explanation to parity with `minimum` and `maximum`.

Cosmetic changes:
- Reword `NaN` and `NAN` as plain "NaN", unless they refer to the specific `const NAN`.
- Reword "a number" to `self` in function docstrings to clarify.
- Remove "Returns NAN if the number is NAN" from `abs`, as this is told to be the default behavior in the top explanation.

2 years agoreview
lcnr [Mon, 9 May 2022 15:47:02 +0000 (17:47 +0200)]
review

2 years agoonly compute `codegen_fn_attrs` where needed
lcnr [Wed, 4 May 2022 09:18:37 +0000 (11:18 +0200)]
only compute `codegen_fn_attrs` where needed

2 years agofix codegen test failure
Ralf Jung [Mon, 9 May 2022 16:10:21 +0000 (18:10 +0200)]
fix codegen test failure

2 years agomake sure ScalarPair enums have ScalarPair variants; add some layout sanity checks
Ralf Jung [Mon, 9 May 2022 15:29:59 +0000 (17:29 +0200)]
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks

2 years agoAuto merge of #96845 - Patryk27:upgrade-llvm, r=nikic
bors [Mon, 9 May 2022 14:58:22 +0000 (14:58 +0000)]
Auto merge of #96845 - Patryk27:upgrade-llvm, r=nikic

Upgrade llvm-project (rustc + avr = lovelove back again!)

See:
https://github.com/rust-lang/llvm-project/pull/139

tl;dr:
- closes https://github.com/rust-lang/rust/issues/83633,
- closes https://github.com/rust-lang/rust/issues/82104,
- closes https://github.com/rust-lang/rust/issues/79889,
- closes https://github.com/rust-lang/compiler-builtins/issues/400.

🙂

2 years agoonly cache `codegen_fn_attrs` on disk if its local
lcnr [Wed, 27 Apr 2022 12:50:50 +0000 (14:50 +0200)]
only cache `codegen_fn_attrs` on disk if its local

2 years agomove `panic-in-drop=abort` check for `drop_in_place`
lcnr [Wed, 27 Apr 2022 08:44:00 +0000 (10:44 +0200)]
move `panic-in-drop=abort` check for `drop_in_place`

Whether `drop_in_place` can abort does depend on the
`panic-in-drop` option while compiling the current crate,
not `core`

2 years agostore `codegen_fn_attrs` in crate metadata
lcnr [Wed, 27 Apr 2022 08:22:08 +0000 (10:22 +0200)]
store `codegen_fn_attrs` in crate metadata

2 years agoAuto merge of #96815 - SparrowLii:promote_const, r=oli-obk
bors [Mon, 9 May 2022 11:49:09 +0000 (11:49 +0000)]
Auto merge of #96815 - SparrowLii:promote_const, r=oli-obk

optimize `promote_consts` by caching the results of `validate_local`

From the FIXME in the impl of `promote_consts`. Early return the `validate_local` should save some compile time.

`qualif_local` is similar to this, but requires futher changing because there are different types of qualif checks. If this PR is effective, I will do it as well.

2 years agouse `Result<(),()>` instead of Validity enum
SparrowLii [Mon, 9 May 2022 09:13:30 +0000 (17:13 +0800)]
use `Result<(),()>` instead of Validity enum

2 years agoUse Rust 2021 prelude in std itself.
Mara Bos [Mon, 9 May 2022 09:12:32 +0000 (11:12 +0200)]
Use Rust 2021 prelude in std itself.

2 years agochore: Upgrade llvm-project
Patryk Wychowaniec [Sun, 8 May 2022 18:59:41 +0000 (20:59 +0200)]
chore: Upgrade llvm-project

See: https://github.com/rust-lang/llvm-project/pull/139

2 years agoRemove unused param from search.js::checkPath
Michael Howell [Mon, 9 May 2022 05:19:40 +0000 (22:19 -0700)]
Remove unused param from search.js::checkPath

2 years agoAuto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errors
bors [Mon, 9 May 2022 04:47:30 +0000 (04:47 +0000)]
Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errors

Remove `#[rustc_deprecated]`

This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`.

I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.

2 years agoMake "Assemble stage1 compiler" orders of magnitude faster
Joshua Nelson [Sat, 7 May 2022 03:42:36 +0000 (22:42 -0500)]
Make "Assemble stage1 compiler" orders of magnitude faster

This used to take upwards of 5 seconds for me locally. I found that the culprit was copying the downloaded LLVM shared object:
```
[22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so"
[22:28:09]   c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } }
```

It turned out that `install()` used full copies unconditionally. Change it to try using a hard-link before falling back to copying.

2 years agoAuto merge of #96802 - gimbles:windows_slice, r=thomcc
bors [Mon, 9 May 2022 02:25:32 +0000 (02:25 +0000)]
Auto merge of #96802 - gimbles:windows_slice, r=thomcc

[feat] Make sys::windows::os_str::Slice repr(transparent)

Fixes #96577

2 years agoReorder erasing/replacing late bound vars and substs
Jack Huey [Mon, 9 May 2022 01:49:12 +0000 (21:49 -0400)]
Reorder erasing/replacing late bound vars and substs

2 years agoRemove subst_spanned
Jack Huey [Mon, 9 May 2022 01:34:36 +0000 (21:34 -0400)]
Remove subst_spanned

2 years agoAuto merge of #95542 - xFrednet:rfc-2383-expect-query, r=wesleywiser
bors [Mon, 9 May 2022 00:02:55 +0000 (00:02 +0000)]
Auto merge of #95542 - xFrednet:rfc-2383-expect-query, r=wesleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE https://github.com/rust-lang/rust/issues/94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. :sauropod:

---

Closes: https://github.com/rust-lang/rust/issues/94953
cc: https://github.com/rust-lang/rust/issues/85549

r? `@wesleywiser`

cc: `@rust-lang/rustdoc`

2 years agoUse sparse representation of switch sources
Tomasz Miąsko [Sun, 8 May 2022 00:00:00 +0000 (00:00 +0000)]
Use sparse representation of switch sources

to avoid quadratic space overhead

2 years agoAuto merge of #96846 - matthiaskrgr:rollup-yxu9ot9, r=matthiaskrgr
bors [Sun, 8 May 2022 21:37:26 +0000 (21:37 +0000)]
Auto merge of #96846 - matthiaskrgr:rollup-yxu9ot9, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #96617 (Fix incorrect syntax suggestion with `pub async fn`)
 - #96828 (Further elaborate the lack of guarantees from `Hasher`)
 - #96829 (Fix the `x.py clippy` command)
 - #96830 (Add and tweak const-generics tests)
 - #96835 (Add more eslint rules)

Failed merges:

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

2 years agoAvoid constructing switch sources unless necessary
Tomasz Miąsko [Sun, 8 May 2022 00:00:00 +0000 (00:00 +0000)]
Avoid constructing switch sources unless necessary

Switch sources are used by backward analysis with a custom switch int
edge effects, but are otherwise unnecessarily computed.

Delay the computation until we know that switch sources are indeed
required and avoid the computation otherwise.

2 years agoWarn on unused doc(hidden) on trait impl items
León Orell Valerian Liehr [Sat, 9 Apr 2022 15:19:33 +0000 (17:19 +0200)]
Warn on unused doc(hidden) on trait impl items

2 years agoMove some tests to more reasonable places
Caio [Sun, 8 May 2022 20:31:05 +0000 (17:31 -0300)]
Move some tests to more reasonable places

2 years agoRollup merge of #96835 - GuillaumeGomez:eslint-rules, r=notriddle
Matthias Krüger [Sun, 8 May 2022 19:31:20 +0000 (21:31 +0200)]
Rollup merge of #96835 - GuillaumeGomez:eslint-rules, r=notriddle

Add more eslint rules

Slowly continuing to enforce more rules with eslint.

Part of https://github.com/rust-lang/rust/issues/93058.

r? `@notriddle`

2 years agoRollup merge of #96830 - JohnTitor:issue-96654, r=compiler-errors
Matthias Krüger [Sun, 8 May 2022 19:31:19 +0000 (21:31 +0200)]
Rollup merge of #96830 - JohnTitor:issue-96654, r=compiler-errors

Add and tweak const-generics tests

Closes #96654
Also correct the src/test/ui/const-generics/issues/issue-77357.rs test's issue number.

2 years agoRollup merge of #96829 - JohnTitor:fix-xpy-clippy, r=jyn514
Matthias Krüger [Sun, 8 May 2022 19:31:18 +0000 (21:31 +0200)]
Rollup merge of #96829 - JohnTitor:fix-xpy-clippy, r=jyn514

Fix the `x.py clippy` command

Fixes #96826, confirmed clippy runs correctly on local
r? `@Mark-Simulacrum`

2 years agoRollup merge of #96828 - scottmcm:clarify-hasher-write, r=Amanieu
Matthias Krüger [Sun, 8 May 2022 19:31:17 +0000 (21:31 +0200)]
Rollup merge of #96828 - scottmcm:clarify-hasher-write, r=Amanieu

Further elaborate the lack of guarantees from `Hasher`

I realized that I got too excited in #94598 by adding new methods, and forgot to do the documentation to really answer the core question in #94026.

This PR just has that doc update.

r? `@Amanieu`

2 years agoRollup merge of #96617 - ken-matsui:fix-incorrect-syntax-suggestion-with-pub-async...
Matthias Krüger [Sun, 8 May 2022 19:31:16 +0000 (21:31 +0200)]
Rollup merge of #96617 - ken-matsui:fix-incorrect-syntax-suggestion-with-pub-async-fn, r=cjgillot

Fix incorrect syntax suggestion with `pub async fn`

This PR closes: https://github.com/rust-lang/rust/issues/96555

2 years agoAuto merge of #96302 - Serial-ATA:more-diagnostic-items, r=manishearth
bors [Sun, 8 May 2022 19:08:34 +0000 (19:08 +0000)]
Auto merge of #96302 - Serial-ATA:more-diagnostic-items, r=manishearth

Add more diagnostic items

This just adds a handful diagnostic items I noticed were missing.

Would it be worth doing this for all of the remaining types? I'm willing to do it if it'd be helpful.

2 years agoActually fix ICE from #96583
Badel2 [Sun, 8 May 2022 17:57:47 +0000 (19:57 +0200)]
Actually fix ICE from #96583

PR #96746 fixed a very similar bug, so the same logic is used in a
different place.

2 years agoAuto merge of #93675 - name1e5s:fix/strip_prefix_panic, r=Mark-Simulacrum
bors [Sun, 8 May 2022 16:51:00 +0000 (16:51 +0000)]
Auto merge of #93675 - name1e5s:fix/strip_prefix_panic, r=Mark-Simulacrum

fix panic in Path::strip_prefix

close #93586

2 years agoRevert "Implement [OsStr]::join", which was merged without FCP
Thom Chiovoloni [Sun, 8 May 2022 16:37:36 +0000 (09:37 -0700)]
Revert "Implement [OsStr]::join", which was merged without FCP

This reverts commit 4fcbc53820ab423bbeb41f07822369aa05da1d68.

2 years agoFixed typo in docs and correct doc links
Fridtjof Stoldt [Tue, 5 Apr 2022 16:23:38 +0000 (18:23 +0200)]
Fixed typo in docs and correct doc links

Co-authored-by: Philipp Krones <hello@philkrones.com>
2 years agofix panic in Path::strip_prefix
name1e5s [Sat, 19 Mar 2022 14:05:56 +0000 (22:05 +0800)]
fix panic in Path::strip_prefix