Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 19 pull requests #98433

Closed

Conversation

compiler-errors
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jmaargh and others added 30 commits June 19, 2022 20:46
Documentation for the following methods

    with_capacity
    with_capacity_in
    with_capacity_and_hasher
    reserve
    reserve_exact
    try_reserve
    try_reserve_exact

was inconsistent and often not entirely correct where they existed on the following types

    Vec
    VecDeque
    String
    OsString
    PathBuf
    BinaryHeap
    HashSet
    HashMap
    BufWriter
    LineWriter

since the allocator is allowed to allocate more than the requested capacity in all such cases, and will frequently "allocate" much more in the case of zero-sized types (I also checked BufReader, but there the docs appear to be accurate as it appears to actually allocate the exact capacity).

Some effort was made to make the documentation more consistent between types as well.

Fix with_capacity* methods for Vec

Fix *reserve*  methods for Vec

Fix docs for *reserve* methods of VecDeque

Fix docs for String::with_capacity

Fix docs for *reserve* methods of String

Fix docs for OsString::with_capacity

Fix docs for *reserve* methods on OsString

Fix docs for with_capacity* methods on HashSet

Fix docs for *reserve methods of HashSet

Fix docs for with_capacity* methods of HashMap

Fix docs for *reserve methods on HashMap

Fix expect messages about OOM in doctests

Fix docs for BinaryHeap::with_capacity

Fix docs for *reserve* methods of BinaryHeap

Fix typos

Fix docs for with_capacity on BufWriter and LineWriter

Fix consistent use of `hasher` between `HashMap` and `HashSet`

Fix warning in doc test

Add test for capacity of vec with ZST

Fix doc test error
…bligation_cause_code`

Most futures don't go through this code path, because they're caught by
`maybe_note_obligation_cause_for_async_await`. But all generators do,
and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses.

At some point, we may want to consider unifying this with the code for `maybe_note_async_await`,
so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points.
But both functions are quite complicated, and it's not clear to me how to combine them;
this seems like a good incremental improvement.
The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with `defer`, meaning it is often run after the document is rendered.
Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.

Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.
It got merged so fast I didn't have time to make changes xD
…ssoc type

use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span`

use `body_id.owner` directly

add description to label
this makes the api more flexible. the original function now calls the PlaceRef
version to avoid duplicating the code.
This seems likely to help more than it would hurt; let's see how it
goes.
This update provides a better error message when chromium crashes
…ix, r=Dylan-DPC

Fix documentation for  `with_capacity` and `reserve` families of methods

Fixes rust-lang#95614

Documentation for the following methods
 - `with_capacity`
 - `with_capacity_in`
 - `with_capacity_and_hasher`
 - `reserve`
 - `reserve_exact`
 - `try_reserve`
 - `try_reserve_exact`

was inconsistent and often not entirely correct where they existed on the following types
- `Vec`
- `VecDeque`
- `String`
- `OsString`
- `PathBuf`
- `BinaryHeap`
- `HashSet`
- `HashMap`
- `BufWriter`
- `LineWriter`

since the allocator is allowed to allocate more than the requested capacity in all such cases, and will frequently "allocate" much more in the case of zero-sized types (I also checked `BufReader`, but there the docs appear to be accurate as it appears to actually allocate the exact capacity).

Some effort was made to make the documentation more consistent between types as well.
…impl-nll, r=cjgillot

Give name if anonymous region appears in impl signature

Fixes rust-lang#98170

We probably should remove the two unwraps in [`report_general_error`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_borrowck/diagnostics/region_errors.rs.html#683-685), but I have no idea what to provide if those regions are missing, so I've kept those in. Let me know if I should try harder to remove those.
…umeGomez

rustdoc: optimize loading of source sidebar

The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with `defer`, meaning it is often run after the document is rendered.
Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.

Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.

Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html

r? ```@GuillaumeGomez```
…=davidtwco

Migrate two diagnostics from the `rustc_builtin_macros` crate

Migrate two diagnostics to use the struct derive and be translatable.

r? ``@davidtwco``
…etrochenkov

Update no_default_libraries handling for emscripten target

``@sbc100`` says:

> `-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]` is almost certainly wrong/out-of-date.   This setting defaults to the empty list anyway these days so its redundant.  Also we now support `-nodefaultlibs` so you can use that, as with other toolchains.

rust-lang#98303 (comment)
clarify Arc::clone overflow check comment

I had to read this twice to realize that this is explaining that the code is technically unsound, so move that into a dedicated paragraph and make the wording a bit more explicit.
…view-comments, r=eholk

Address review comments from rust-lang#98259

It got approved so fast I didn't have time to make changes xD

r? `@eholk`
implement `iter_projections` function on `PlaceRef`

this makes the api more flexible. the original function now calls the PlaceRef
version to avoid duplicating the code.
…, r=notriddle

Fixes handling of keywords in rustdoc json output

Fixes rust-lang#98002.

Instead of panicking, we just filter them out.

cc ``@matthiaskrgr``
r? ``@notriddle``
…=Mark-Simulacrum

triagebot.toml: Allow applying nominated labels
Update books

## reference

6 commits in 683bfe5cd64d589c6a1645312ab5f93b6385ccbb..9fce337a55ee4a4629205f6094656195cecad231
2022-05-27 11:54:20 -0700 to 2022-06-22 13:59:28 -0700
- Remove outdated restriction on recursive types (rust-lang/reference#1231)
- Clarify "string continue" for (byte) string literals (rust-lang/reference#1042)
- Add a note to the turbofish section about impl Trait (rust-lang/reference#1212)
- modify confusing variance example (rust-lang/reference#1224)
- Add stable references of `macro_metavar_expr` (rust-lang/reference#1192)
- Document native library modifier `bundle` (rust-lang/reference#1210)

## book

33 commits in 396fdb69de7fb18f24b15c7ad13491b1c1fa7231..efbafdba3618487fbc9305318fcab9775132ac15
2022-06-08 10:02:35 -0400 to 2022-06-19 21:06:50 -0400
- Propagate tech review edits to appendices to src
- Tech review comments and further edits to the appendices
- Duplicate fragment "mutation and borrowing"
- Propagate ch20 tech review edits to src
- Edits in response to tech review of chapter 20
- Comments from tech review on chapter 20
- Propagate ch7 tech review edits to src
- Responding to tech review of ch7
- Tech review comments on ch7
- Propagate ch19 tech review edits to src
- Responses to tech review of ch19
- Tech review comments on ch 19
- Update ch03-01-variables-and-mutability.md
- Add more explanation to CONTRIBUTING about the nostarch directory
- Duplicate sentence
- Missing period
- Regenerate ch09-02 error messages
- Change some print formatting styles in ch18
- Propagate tech review ch18 edits to src
- Responses to tech review comments of chapter 18
- Chapter 18 from tech review
- Snapshot of introduction for nostarch
- Propagate edits of ch1 to src
- Edits to edits to chapter 1
- Edits from nostarch for chapter 1
- Update Visual Studio instructions for 2022
- bugfix/typo-ch10-01 Fix typo in chapter ch10-01
- Tweak rustfmt slightly for these listings
- Propagate edits to ch13 to src
- Responses to nostarch edits to ch13
- Edits to ch13 from nostarch
- Apply complex Clippy recommendation
- Apply Clippy recommendations: `cargo clippy --fix`

## rust-by-example

4 commits in dbb7e5e2345ee26199ffba218156b6009016a20c..1095df2a5850f2d345fad43a30633133365875ba
2022-06-02 16:30:51 -0300 to 2022-06-18 21:47:12 -0300
- Add example for `array.get()` (rust-lang/rust-by-example#1554)
- Example improvements (rust-lang/rust-by-example#1552)
- Fix for a set of typos (rust-lang/rust-by-example#1551)
- Make guard examples clearer around `_` (rust-lang/rust-by-example#1550)

## rustc-dev-guide

11 commits in 6e4d6435db89bcc027b1bba9742e4f59666f5412..048d925f0a955aac601c4160c0e7f05771bcf63b
2022-06-08 08:06:32 +0900 to 2022-06-21 22:25:34 +0900
- not obvious what Ex is, so rather get rid (rust-lang/rustc-dev-guide#1372)
- small improves (rust-lang/rustc-dev-guide#1371)
- make clear that other versions can work (rust-lang/rustc-dev-guide#1373)
- Fix small `src/diagnostics.md` typo (rust-lang/rustc-dev-guide#1370)
- Add an "is" and rearange "We next" to "Next, we" (rust-lang/rustc-dev-guide#1369)
- diagnostics: add translation documentation
- diagnostics: line wrapping/heading changes
- later -> latter
- Remove mention of -Zborrowck=mir with Polonius. (rust-lang/rustc-dev-guide#1367)
- Remove nll compare mode. (rust-lang/rustc-dev-guide#1366)
- add section on user types (rust-lang/rustc-dev-guide#1359)

## embedded-book

1 commits in cbb494f96da3268c2925bdadc65ca83d42f2d4ef..e17dcef5e96346ee3d7fa56820ddc7e5c39636bc
2022-05-26 06:58:43 +0000 to 2022-06-19 10:28:00 +0000
- Fix a typo  (rust-embedded/book#319)
…te, r=Dylan-DPC

Update browser-ui-test version to 0.9.6

This update provides a better error message when chromium crashes.

cc `@jsha`
r? `@Dylan-DPC`
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 23, 2022
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=19

@bors
Copy link
Contributor

bors commented Jun 23, 2022

📌 Commit 53f79f9 has been approved by compiler-errors

@bors
Copy link
Contributor

bors commented Jun 23, 2022

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 23, 2022
@compiler-errors
Copy link
Member Author

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Jun 23, 2022

⌛ Testing commit 53f79f9 with merge d8457518cce75363ffb5861bd908e153cd33be13...

@bors
Copy link
Contributor

bors commented Jun 23, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 23, 2022
@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
$DIR\coerce-issue-49593-box-never-windows.rs
$DIR\coerce-issue-49593-box-never-windows.rs
diff of stderr:

4 LL |     /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x)
5    |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
-    = note: required for the cast to the object type `dyn std::error::Error`
+    = note: required for the cast from `()` to the object type `dyn std::error::Error`
8 
9 error[E0277]: the trait bound `(): std::error::Error` is not satisfied
9 error[E0277]: the trait bound `(): std::error::Error` is not satisfied
10   --> $DIR/coerce-issue-49593-box-never-windows.rs:23:49

12 LL |     /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
13    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
-    = note: required for the cast to the object type `(dyn std::error::Error + 'static)`
-    = note: required for the cast to the object type `(dyn std::error::Error + 'static)`
+    = note: required for the cast from `()` to the object type `(dyn std::error::Error + 'static)`
17 error: aborting due to 2 previous errors
18 



The actual stderr differed from the expected stderr.
Actual stderr saved to D:\a\rust\rust\build\i686-pc-windows-msvc\test\ui\coercion\coerce-issue-49593-box-never-windows.nofallback\coerce-issue-49593-box-never-windows.nofallback.stderr
To only update this specific test, also pass `--test-args coercion\coerce-issue-49593-box-never-windows.rs`


error in revision `nofallback`: 1 errors occurred comparing output.
status: exit code: 1
command: PATH="D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-bootstrap-tools\i686-pc-windows-msvc\release\deps;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\msys2\mingw32\bin;C:\hostedtoolcache\windows\Python\3.10.5\x64\Scripts;C:\hostedtoolcache\windows\Python\3.10.5\x64;C:\msys64\usr\bin;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\2.7.5\x64;C:\cabal\bin;C:\ghcup\bin;C:\tools\ghc-9.2.3\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.2.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.17.11\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.332-9\x64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\bin\\rustc.exe" "D:\\a\\rust\\rust\\src/test\\ui\\coercion\\coerce-issue-49593-box-never-windows.rs" "-Zthreads=1" "--target=i686-pc-windows-msvc" "--cfg" "nofallback" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\ui\\coercion\\coerce-issue-49593-box-never-windows.nofallback" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "-L" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\ui\\coercion\\coerce-issue-49593-box-never-windows.nofallback\\auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
   |
   |
LL |     /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x)
   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
   = note: required for the cast from `()` to the object type `dyn std::error::Error`

error[E0277]: the trait bound `(): std::error::Error` is not satisfied
  --> D:\a\rust\rust\src/test\ui\coercion\coerce-issue-49593-box-never-windows.rs:23:49
  --> D:\a\rust\rust\src/test\ui\coercion\coerce-issue-49593-box-never-windows.rs:23:49
   |
LL |     /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
   |
   = note: required for the cast from `()` to the object type `(dyn std::error::Error + 'static)`
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
test result: FAILED. 12901 passed; 1 failed; 204 ignored; 0 measured; 0 filtered out; finished in 500.49s

Some tests failed in compiletest suite=ui mode=ui host=i686-pc-windows-msvc target=i686-pc-windows-msvc
Build completed unsuccessfully in 0:38:59
make: *** [Makefile:72: ci-subset-2] Error 1

@compiler-errors
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2022
@compiler-errors compiler-errors deleted the rollup-43hwqq3 branch August 11, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.