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 4 pull requests #95600

Merged
merged 10 commits into from
Apr 2, 2022
Merged

Rollup of 4 pull requests #95600

merged 10 commits into from
Apr 2, 2022

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 10 commits April 1, 2022 10:38
…bounds, r=Dylan-DPC

Remove need for associated_type_bounds in std.
Include a header in .rlink files

I couldn't find the right place where to put tests. Is there some location that tests `.rlink` creation and loading?
I only found `src/test/run-make-fulldeps/separate-link/Makefile`, but I'm not sure how to check the error message in the Makefile.

Fixes: rust-lang#95297

r? `@bjorn3`
…t-context, r=compiler-errors

diagnostics: add test case for bogus T:Sized suggestion

Closes rust-lang#69228
Refer to u8 by absolute path in expansion of thread_local

The standard library's `thread_local!` macro previously referred to `u8` just as `u8`, resolving to whatever `u8` existed in the type namespace at the call site. This PR replaces those with `$crate::primitive::u8` which always refers to `std::primitive::u8` regardless of what's in scope at the call site. Unambiguously naming primitives inside macro-generated code is the reason that std::primitive was introduced in the first place.

<details>
<summary>Here is the error message prior to this PR ⬇️</summary>

```console
error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected struct `u8`, found integer
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_expected struct `u8`, found integer
  |   this expression has type `u8`
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected `u8`, found struct `u8`
  |
  = note: expected raw pointer `*mut u8` (`u8`)
             found raw pointer `*mut u8` (struct `u8`)
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected `u8`, found struct `u8`
  |
  = note: expected fn pointer `unsafe extern "C" fn(*mut u8)`
                found fn item `unsafe extern "C" fn(*mut u8) {destroy}`
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_expected struct `u8`, found integer
  |   expected due to this type
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `u8`
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_u8
  |   {integer}
  |
note: an implementation of `PartialEq<_>` might be missing for `u8`
 --> src/main.rs:4:1
  |
4 | struct u8;
  | ^^^^^^^^^^ must implement `PartialEq<_>`
  = note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `u8` with `#[derive(PartialEq)]`
  |
4 | #[derive(PartialEq)]
  |

error[E0277]: `u8` doesn't implement `Debug`
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ `u8` cannot be formatted using `{:?}`
  |
  = help: the trait `Debug` is not implemented for `u8`
  = note: add `#[derive(Debug)]` to `u8` or manually `impl Debug for u8`
  = note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
```
</details>
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 2, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Apr 2, 2022

📌 Commit 0e528f0 has been approved by Dylan-DPC

@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 Apr 2, 2022
@bors
Copy link
Contributor

bors commented Apr 2, 2022

⌛ Testing commit 0e528f0 with merge 76d770a...

@bors
Copy link
Contributor

bors commented Apr 2, 2022

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 76d770a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 2, 2022
@bors bors merged commit 76d770a into rust-lang:master Apr 2, 2022
@rustbot rustbot added this to the 1.61.0 milestone Apr 2, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76d770a): comparison url.

Summary:

  • Primary benchmarks: no relevant changes found. 1 results were found to be statistically significant but too small to be relevant.
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 1 0 1
mean2 N/A N/A -0.4% N/A -0.4%
max N/A N/A -0.4% N/A 0.0%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants