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

[beta] backport #114748

Merged
merged 17 commits into from
Aug 12, 2023
Merged

[beta] backport #114748

merged 17 commits into from
Aug 12, 2023

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Aug 12, 2023

r? cuviper

Urgau and others added 16 commits August 11, 2023 18:37
`()` is normally FFI-unsafe, but is FFI-safe when used as a return type.
It is also desirable that a transparent newtype for `()` is FFI-safe when
used as a return type.

In order to support this, when an type was deemed FFI-unsafe, because of
a `()` type, and was used in return type - then the type was considered
FFI-safe. However, this was the wrong approach - it didn't check that the
`()` was part of a transparent newtype! The consequence of this is that
the presence of a `()` type in a more complex return type would make it
the entire type be considered safe (as long as the `()` type was the
first that the lint found) - which is obviously incorrect.

Instead, this logic is removed, and a unit return type or a transparent
wrapper around a unit is checked for directly for functions and fn-ptrs.

Signed-off-by: David Wood <[email protected]>
(cherry picked from commit f53cef3)
Simplify this function a bit, it was quite hard to reason about.

Signed-off-by: David Wood <[email protected]>
(cherry picked from commit 99b1897)
Consider `()` within types to be FFI-safe, and `()` to be FFI-safe as a
return type (incl. when in a transparent newtype).

Signed-off-by: David Wood <[email protected]>
(cherry picked from commit 24f90fd)
Now that this lint runs on any external-ABI fn-ptr, normalization won't
always succeed, so use `try_normalize_erasing_regions` instead.

Signed-off-by: David Wood <[email protected]>
(cherry picked from commit 09434a2)
Rust requires a previous version of Rust to build, such as the current version, or the
previous version.  However, the version comparison logic did not take patch releases
into consideration when doing the version comparison for the current branch, e.g.
Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version
match, or the previous version.

Adjust the version comparison logic to tolerate mismatches in the patch version.

Signed-off-by: Ariadne Conill <[email protected]>
(cherry picked from commit 31a81a0)
…ported_symbols to only export the two symbols that proc-macros need.

(cherry picked from commit 3000c24)
(cherry picked from commit 7a0e2ee)
fix to test as proposed by wesleywiser

Co-authored-by: Wesley Wiser <[email protected]>
(cherry picked from commit 5881e5f)
…conditional logic otherwise.

(cherry picked from commit a2058dd)
…uct for the host.

thus we should no longer see test failures for e.g. wasm32 target.

(cherry picked from commit a2a7f27)
@rustbot
Copy link
Collaborator

rustbot commented Aug 12, 2023

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. labels Aug 12, 2023
(cherry picked from commit fb5efd7)
@cuviper
Copy link
Member Author

cuviper commented Aug 12, 2023

@bors r+ rollup=never p=1

@bors
Copy link
Contributor

bors commented Aug 12, 2023

📌 Commit 4d05014 has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2023
@bors
Copy link
Contributor

bors commented Aug 12, 2023

⌛ Testing commit 4d05014 with merge d1fa3e4...

@bors
Copy link
Contributor

bors commented Aug 12, 2023

☀️ Test successful - checks-actions
Approved by: cuviper
Pushing d1fa3e4 to beta...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2023
@bors bors merged commit d1fa3e4 into rust-lang:beta Aug 12, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Aug 12, 2023
@cuviper cuviper deleted the beta-next branch August 14, 2023 22:33
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.