Skip to content

Rollup of 8 pull requests - #95666

Closed
Dylan-DPC wants to merge 20 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-n5bl0y6
Closed

Rollup of 8 pull requests#95666
Dylan-DPC wants to merge 20 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-n5bl0y6

Conversation

@Dylan-DPC

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ben0x539and others added 20 commits March 23, 2022 13:00
Per https://www.freedesktop.org/software/systemd/man/os-release.html,
> Variable assignment values must be enclosed in double or single quotes
> if they include spaces, semicolons or other special characters outside
> of A–Z, a–z, 0–9. (Assignments that do not include these special
> characters may be enclosed in quotes too, but this is optional.)
So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`.
One of these is necessary between NixOS/nixpkgs#162168 and
NixOS/nixpkgs#164068, but this seems more correct either way.
Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme.
The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler.
Change them to consistently only pass it when `--target` is present.
bootstrap.py: nixos check in /etc/os-release with quotes
Per https://www.freedesktop.org/software/systemd/man/os-release.html,
> Variable assignment values must be enclosed in double or single quotes
> if they include spaces, semicolons or other special characters outside
> of A–Z, a–z, 0–9. (Assignments that do not include these special
> characters may be enclosed in quotes too, but this is optional.)
So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`.
One of these is necessary between NixOS/nixpkgs#162168 and
NixOS/nixpkgs#164068, but this seems more correct either way.
Fix `x doc --stage 0 compiler`
Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme.
The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler.
Change them to consistently only pass it when `--target` is present.
cc rust-lang#74976 (comment)Fixesrust-lang#79980
r? `@ehuss`
…77, r=compiler-errors
Suggest derivable trait on E0277 error
Closesrust-lang#95099 .
…n1011
Note invariance reason for FnDef types
Fixesrust-lang#95272. Is it worthwhile even printing a variance explanation here? Or should I try to track down which function parameter is responsible for the invariance?
r? `@Aaron1011` since you wrote rust-lang#89336
…raits-in-scope-primitive, r=jyn514
Fix intra doc link ICE when trying to get traits in scope for primitive
Fixesrust-lang#95633.
I think `@notriddle` was the one who worked on this part of the code last so:
r? `@notriddle`
…davidtwco
diagnostics: use correct span for const generics
Fixesrust-lang#95616
Rely on #[link] attribute for unwind on Fuchsia.
Closesrust-lang#95575.
Update panic docs to make it clearer when to use panic vs Result
This is based on a question that came up in one of my [error handling office hours](https://twitter.com/yaahc_/status/1506376624509374467?s=20&t=Sp-cEjrx5kpMdNsAGPOo9w) meetings. I had a user who was fairly familiar with error type design, thiserror and anyhow, and rust in general, but who was still confused about when to use panics vs when to use Result and `Error`.
This will also be cross referenced in an error handling FAQ that I will be creating in the https://github.com/rust-lang/project-error-handling repo shortly.
@rustbotrustbot added T-compiler Relevant to the compiler 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 Apr 5, 2022
@Dylan-DPC

Copy link
Copy Markdown
MemberAuthor

@bors p=5 rollup=never

@Dylan-DPC

Copy link
Copy Markdown
MemberAuthor

@bors r+

@bors

bors commented Apr 5, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 87836c5 has been approved by Dylan-DPC

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 5, 2022
@bors

bors commented Apr 5, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 87836c5 with merge 40de905dd5d504b2e20d150e2fa0d1e9f3a0f503...

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

---- [ui (nll)] ui/kindck/kindck-impl-type-params.rs stdout ----
diff of stderr:
93 LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
94 | ^^^^^^^^^^^ ^^^^
95 = note: required for the cast to the object type `dyn Gettable<Foo>`
+ help: consider annotating `Foo` with `#[derive(Copy)]`
+ |
+ LL | #[derive(Copy)]
96 97 error: aborting due to 6 previous errors
98 The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-impl-type-params.nll/kindck-impl-type-params.nll.stderr
To only update this specific test, also pass `--test-args kindck/kindck-impl-type-params.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/kindck/kindck-impl-type-params.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-impl-type-params.nll" "-Zborrowck=mir" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-impl-type-params.nll/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: `T` cannot be sent between threads safely
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:18:13
|
LL | let a = &t as &dyn Gettable<T>;
| ^^ `T` cannot be sent between threads safely
|
note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
|
LL | fn f<T: std::marker::Send>(val: T) {
error[E0277]: the trait bound `T: Copy` is not satisfied
Some tests failed in compiletest suite=ui compare_mode=Nll mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:18:13
|
LL | let a = &t as &dyn Gettable<T>;
| ^^ the trait `Copy` is not implemented for `T`
|
note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
|
LL | fn f<T: std::marker::Copy>(val: T) {
error[E0277]: `T` cannot be sent between threads safely
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:25:31
|
LL | let a: &dyn Gettable<T> = &t;
| ^^ `T` cannot be sent between threads safely
|
note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
|
LL | fn g<T: std::marker::Send>(val: T) {
error[E0277]: the trait bound `T: Copy` is not satisfied
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:25:31
|
LL | let a: &dyn Gettable<T> = &t;
| ^^ the trait `Copy` is not implemented for `T`
|
note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
|
LL | fn g<T: std::marker::Copy>(val: T) {
error[E0277]: the trait bound `String: Copy` is not satisfied
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:38:13
|
|
LL | let a = t as Box<dyn Gettable<String>>;
| ^ the trait `Copy` is not implemented for `String`
|
= help: the trait `Gettable<T>` is implemented for `S<T>`
note: required because of the requirements on the impl of `Gettable<String>` for `S<String>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<String>`
error[E0277]: the trait bound `Foo: Copy` is not satisfied
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:46:37
|
|
LL | let a: Box<dyn Gettable<Foo>> = t;
| ^ the trait `Copy` is not implemented for `Foo`
|
= help: the trait `Gettable<T>` is implemented for `S<T>`
note: required because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
--> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
LL | #[derive(Copy)]
|
error: aborting due to 6 previous errors

@bors

bors commented Apr 5, 2022

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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 Apr 5, 2022
@Dylan-DPC
Dylan-DPC deleted the rollup-n5bl0y6 branch April 5, 2022 12:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollupA PR which is a rollupS-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant 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.

12 participants

@Dylan-DPC@bors@rust-log-analyzer@rustbot@ben0x539@jyn514@GuillaumeGomez@notriddle@anp@yaahc@ohno418@compiler-errors