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 11 pull requests #84948

Closed
wants to merge 27 commits into from
Closed

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented May 5, 2021

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

joshtriplett and others added 27 commits April 29, 2021 12:41
Searching for `chdir` in the Rust documentation produces no useful
results.
Clippy: Decreases indentation and improves readability

Signed-off-by: wcampbell <wcampbell1995@gmail.com>
This updates the documentation since `ptr::addr_of!` and
`ptr::addr_of_mut!` are now stable. One might remove the distinction
between the sections `# On packed structs` and `# Examples`, as the old
section on packed structs was primarily to prevent users of doing unde-
fined behavior, which is not necessary anymore.
There is also a new section in "how to obtain a pointer", which referen-
ces the `ptr::addr_of!` macros.

This commit contains squashed commits from code review.

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Co-authored-by: Soveu <marx.tomasz@gmail.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
When encountering a path that can't have generics, do not call
`generics_of`. This would happen when writing something like
`path::this_is_a_mod<const_val>`.

Fix rust-lang#84831.
…, r=pnkfelix

Improve diagnostic for when field is never read

Related to (but does not close) rust-lang#81658

This completes the first step of ````````@pnkfelix's```````` [mentoring instructions](rust-lang#81658 (comment)) but does not actually improve the diagnostics (yet!). The two tests are heavily reduced versions of code from the original bug report.

I've confirmed that the reduced `field-used-in-ffi` test [fails on nightly](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f0862c89ddca028c55c20a5ed05e679a) but [passes on stable](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f0862c89ddca028c55c20a5ed05e679a). This confirms that the regression is reproduced correctly. The `drop-only-field` test is a case that ````````@pnkfelix```````` mentioned in his mentoring instructions. It is not a regression, but will come in handy when we make the diagnostic smarter by looking at whether the field type implements `Drop`.

Per the [rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/tests/adding.html), each test includes a comment summarizing what it is about.
Update `ptr` docs with regards to `ptr::addr_of!`

This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing undefined behavior, which is not necessary anymore.

Technically there is now wrong/outdated documentation on stable, but I don't think this is worth a point release 😉

Fixes rust-lang#83509.

````````@rustbot```````` modify labels: T-doc
…albini

Update RELEASES.md for 1.52.0

### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.52.0/RELEASES.md)

r? ``````@Mark-Simulacrum``````
cc ``````@rust-lang/release``````
…lnay

Add doc alias for `chdir` to `std::env::set_current_dir`

Searching for `chdir` in the Rust documentation produces no useful
results.

I wrote some code recently that called `libc::chdir` and manually
handled errors, because I didn't realize that the safe
`std::env::set_current_dir` existed. I searched for `chdir` and
`change_dir` and `change_directory` (the latter two based on the
precedent of unabbreviating set by `create_dir`), and I also read
through `std::fs` expecting to potentially find it there. Given that
none of those led to `std::env::set_current_dir`, I think that provides
sufficient justification to add this specific alias.
…nkov

Reduce duplication in `impl_dep_tracking_hash` macros

Cherry-picked from rust-lang#84234 since it will be a while until it lands.
…olnay

use else if in std library

Decreases indentation and improves readability
…riplett

Clarify documentation for `[T]::contains`

Change the documentation to correctly characterize when the suggested alternative to `contains` applies, and correctly explain why it works.

Fixes rust-lang#84877
…tting, r=Dylan-DPC

platform-support: Center the contents of the `std` and `host` columns

Minor formatting improvement.
…RalfJung

Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`

Removing it per rust-lang#84842 (comment): it's a dead enum variant.

Note that `PointerArithmeticTest` also seems dead:
```
$ rg -F PointerArithmeticTest -C5
compiler/rustc_middle/src/mir/interpret/error.rs
169-
170-/// Details of why a pointer had to be in-bounds.
171-#[derive(Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)]
172-pub enum CheckInAllocMsg {
173-    MemoryAccessTest,
174:    PointerArithmeticTest,
175-    InboundsTest,
176-}
177-
178-impl fmt::Display for CheckInAllocMsg {
179-    /// When this is printed as an error the context looks like this
--
182-        write!(
183-            f,
184-            "{}",
185-            match *self {
186-                CheckInAllocMsg::MemoryAccessTest => "memory access",
187:                CheckInAllocMsg::PointerArithmeticTest => "pointer arithmetic",
188-                CheckInAllocMsg::InboundsTest => "inbounds test",
189-            }
190-        )
191-    }
192-}
```
Not sure if that is also desirable to be removed, however.
Do not ICE on invalid const param

When encountering a path that can't have generics, do not call
`generics_of`. This would happen when writing something like
`path::this_is_a_mod<const_val>`.

Fix rust-lang#84831.
@rustbot rustbot added the rollup A PR which is a rollup label May 5, 2021
@RalfJung
Copy link
Member Author

RalfJung commented May 5, 2021

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented May 5, 2021

📌 Commit f8cbe9a has been approved by RalfJung

@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 May 5, 2021
@bors
Copy link
Contributor

bors commented May 5, 2021

⌛ Testing commit f8cbe9a with merge 30f4bca2abe7e10ba5b321345461005325a2470b...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test test::test_workspaces_cwd ... ok

failures:

---- fix::fix_deny_warnings_but_not_others stdout ----
running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo fix --allow-no-vcs`
thread 'fix::fix_deny_warnings_but_not_others' panicked at 'assertion failed: p.read_file(\"src/lib.rs\").contains(\"fn bar() {}\")', src/tools/cargo/tests/testsuite/fix.rs:572:5


failures:
    fix::fix_deny_warnings_but_not_others
---


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --stage 2 src/tools/cargo src/tools/cargotest
Build completed unsuccessfully in 0:23:26
make: *** [check-aux] Error 1
Makefile:44: recipe for target 'check-aux' failed

@RalfJung
Copy link
Member Author

RalfJung commented May 5, 2021

Uff, no idea which one could have caused that...

---- fix::fix_deny_warnings_but_not_others stdout ----
running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo fix --allow-no-vcs`
thread 'fix::fix_deny_warnings_but_not_others' panicked at 'assertion failed: p.read_file(\"src/lib.rs\").contains(\"fn bar() {}\")', src/tools/cargo/tests/testsuite/fix.rs:572:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bors
Copy link
Contributor

bors commented May 5, 2021

💔 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 May 5, 2021
@RalfJung
Copy link
Member Author

RalfJung commented May 5, 2021

Cc @Dylan-DPC I dont have time for more rollups, but maybe you have an idea what happened here...

@RalfJung RalfJung closed this May 5, 2021
@RalfJung RalfJung deleted the rollup-1tpdmp3 branch May 5, 2021 11:06
@Dylan-DPC-zz
Copy link

@RalfJung no worries, happy to take over :)

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-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.