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 5 pull requests #125415

Merged
merged 17 commits into from
May 22, 2024
Merged

Rollup of 5 pull requests #125415

merged 17 commits into from
May 22, 2024

Conversation

fmease
Copy link
Member

@fmease fmease commented May 22, 2024

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 17 commits May 8, 2024 17:46
…r=oli-obk

miri: rename intrinsic_fallback_checks_ub to intrinsic_fallback_is_spec

Checking UB is not the only concern, we also have to make sure we are not losing out on non-determinism.

r? ``@oli-obk`` (not urgent, take your time)
…-params, r=spastorino

Pattern types: Prohibit generic args on const params

Addresses https://github.com/rust-lang/rust/pull/123689/files#r1562676629.

NB: Technically speaking, *not* prohibiting generics args on const params is not a bug as `pattern_types` is an *internal* feature and as such any uncaught misuses of it are considered to be the fault of the user. However, permitting this makes me slightly uncomfortable esp. since we might want to make pattern types available to the public at some point and I don't want this oversight to be able to slip into the language (for comparison, ICEs triggered by the use of internal features are like super fine).

Furthermore, this is an ad hoc fix. A more general fix would be changing the representation of the pattern part of pattern types in such a way that it can reuse preexisting lowering routines for exprs / anon consts. See also this [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/pattern.20type.20HIR.20nodes/near/432410768) and rust-lang#124650.

Also note that we currently don't properly typeck the pattern of pat tys. This however is out of scope for this PR.

cc ``@oli-obk``
r? ``@spastorino`` as discussed
Disallow cast with trailing braced macro in let-else

This fixes an edge case I noticed while porting rust-lang#118880 and rust-lang#119062 to syn.

Previously, rustc incorrectly accepted code such as:

```rust
let foo = &std::ptr::null as &'static dyn std::ops::Fn() -> *const primitive! {
    8
} else {
    return;
};
```

even though a right curl brace `}` directly before `else` in a `let...else` statement is not supposed to be valid syntax.
… r=oli-obk

An async closure may implement `FnMut`/`Fn` if it has no self-borrows

There's no reason that async closures may not implement `FnMut` or `Fn` if they don't actually borrow anything with the closure's env lifetime. Specifically, rust-lang#123660 made it so that we don't always need to borrow captures from the closure's env.

See the doc comment on `should_reborrow_from_env_of_parent_coroutine_closure`:

https://github.com/rust-lang/rust/blob/c00957a3e269219413041a4e3565f33b1f9d0779/compiler/rustc_hir_typeck/src/upvar.rs#L1777-L1823

If there are no such borrows, then we are free to implement `FnMut` and `Fn` as permitted by our closure's inferred `ClosureKind`.

As far as I can tell, this change makes `async || {}` work in precisely the set of places they used to work before rust-lang#120361.
Fixes rust-lang#125247.

r? oli-obk
…ieb,michaelwoerister

Fix `unexpected_cfgs` lint on std

closes rust-lang#125291

r? rust-lang/compiler
@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels May 22, 2024
@fmease
Copy link
Member Author

fmease commented May 22, 2024

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented May 22, 2024

📌 Commit 8219fd2 has been approved by fmease

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 May 22, 2024
@bors
Copy link
Contributor

bors commented May 22, 2024

⌛ Testing commit 8219fd2 with merge 93e7cb8...

@bors
Copy link
Contributor

bors commented May 22, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing 93e7cb8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 22, 2024
@bors bors merged commit 93e7cb8 into rust-lang:master May 22, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 22, 2024
@fmease fmease deleted the rollup-n2bg7q5 branch May 22, 2024 21:42
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#124896 miri: rename intrinsic_fallback_checks_ub to intrinsic_fall… 04dbfe3e3b2e337df0e9ebaa4fd4c46c6ed2babf (link)
#125015 Pattern types: Prohibit generic args on const params a1fc6c610c5ab9b0edca6ddd6f704e2a3c6ca53c (link)
#125049 Disallow cast with trailing braced macro in let-else b2ecedfe449872d8bd3b4f942f973d88af1c576d (link)
#125259 An async closure may implement FnMut/Fn if it has no se… 6fca8c8d52ed8303ed8639a5e581887cd053202a (link)
#125296 Fix unexpected_cfgs lint on std c12870d24130de4b2f5ddb7aa2d43b0f79bd3239 (link)

previous master: 22f5bdc42b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (93e7cb8): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.7%, secondary 1.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.7% [2.2%, 5.2%] 2
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.7% [2.2%, 5.2%] 2

Cycles

Results (secondary -2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 670.997s -> 673.478s (0.37%)
Artifact size: 315.70 MiB -> 315.67 MiB (-0.01%)

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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants