Repository navigation
Rollup of 8 pull requests - #165018
Closed
tgross35 wants to merge 19 commits into
Closed
Rollup of 8 pull requests#165018tgross35 wants to merge 19 commits into
tgross35 wants to merge 19 commits into
Conversation
This avoids the unsoundness-hazard of using `&'ll mut` to represent an owning pointer that typically does not live for as long as its enclosing context.
The SimpleCx type contains references tied to the lifetime of the LLVM context, but the SimpleCx itself has a shorter lifetime.
This commit changes the type of LLVM context references from `&'ll Context` to a dedicated newtype struct `Context<'ll>` with an invariant lifetime brand. The current usage of `&'ll Context` is not sound, because covariance in `'ll` allows different contexts to be mixed in ways that the underlying bindings are not prepared to handle. (Most of the time, mixing contexts is unlikely to happen by accident, but switching to a more-sound API is good maintenance hygiene for these complex bindings.)
Lex and parse emoji in lifetimes, and disallow them in the parser with a hard error. Allow emoji to start a lifetime name even if they are not XID_Start. ``` error: lifetimes cannot contain emoji --> $DIR/emoji-in-lifetime.rs:1:22 | LL | fn bad_lifetime_name<'🐛🐛🐛family👨👩👧👦>( | ^^^^^^^^^^^^^^^^^^^^^ ``` Unify lifetime and identifier parsing. Use `bad_unicode_identifiers` for lifetimes.
During work on PR 164772 [1], I've noticed another tiny inconsistency in doc code examples: `HashMap`'s `Entry::insert_entry()`'s doc code example did not have an assertion where `BTreeMap`'s `Entry::insert_entry()`'s docs did. I've added an assertion where it was missing. [1] rust-lang#164772
This function is documented as allowed to continue, which is useful behavior during const eval. Split a new `resumable_breakpoint` intrinsic from `breakpoint` which has the behavior of continuing in Miri and CTFE.
…s-tests, r=lqd Add tests for unsoundness involving alias liveness This adds a number of tests demonstrating unsoundness with alias liveness (some on stable w/ NLL, some only with Polonius Alpha). This reopens rust-lang#153215. See tests/ui/borrowck/alias-liveness/projection-hide-one-bound-153215.rs. This adds tests for rust-lang#160979, rust-lang#161038, rust-lang#151861, and rust-lang#163886. r? lqd
…tes, r=Mark-Simulacrum core: Constify `resumable_breakpoint` and re-export it in `std` This function is documented as allowed to continue, which is useful behavior during const eval. Split a new `resumable_breakpoint` intrinsic from `breakpoint` which has the behavior of continuing in Miri and CTFE.
cg_llvm: Use an invariant lifetime brand for LLVM contexts This PR changes the type of LLVM context references from `&'ll Context` to `&'ll Context<'ll>`, introducing an invariant lifetime brand. The current usage of `&'ll Context` is not sound, because covariance in `'ll` allows different contexts to be mixed in ways that the underlying bindings are not prepared to handle. (Most of the time, mixing contexts is unlikely to happen by accident, but switching to a more-sound API is good maintenance hygiene for these complex bindings.) In most code there is no practical difference between `&'ll Context<'ll>` and `&Context<'ll>`, but when storing the context in structures (e.g. SCx) it is helpful to be able to avoid an extra lifetime. --- A big chunk of the migration was done via a regex replace of `Context` with `Context<'ll>`, and then manually chasing down any resultant/remaining errors. I have tried to manually check each of the changes multiple times, forwards and backwards, but this is a pretty tedious process so hopefully I did catch everything that shouldn't be there. I intend to migrate various other related types as well, but just Context on its own is quite a lot to review already. There should be no change to compiler output.
…ross35 Add behavior tests for `Arc` and `Rc` See <rust-lang#141348 (comment)>. r? @tgross35
x86-64-linux-gnu seems to have working f128 now There was some progress in llvm/llvm-project#44744 that seems to have helped. At least, I can compile and run Miri's `tests/pass/float.rs` on my system successfully. Let's see what CI says.
…lmann,Veykril Lex lifetimes as identifiers, recover from emoji and emit appropriate error Lex and parse emoji in lifetimes by using the identifier logic, and disallow them in the parser with a hard error. Allow emoji to start a lifetime name even if they are not XID_Start. ``` error: identifiers cannot contain emoji: `'🐛🐛🐛family👨👩👧👦` --> $DIR/emoji-in-lifetime.rs:1:22 | LL | fn bad_lifetime_name<'🐛🐛🐛family👨👩👧👦>( | ^^^^^^^^^^^^^^^^^^^^^ ``` Address rust-lang#141081 (but we could provide more information in the diagnostic, pointing at the specific chars, providing a link to the reference on identifiers and/or some other extra information).
…r=mejrs Disable recovery when attribute parser shouldn't emit Removes some duplicate diagnostics. r? @mejrs
…aapoalas docs: Nitpick change in `HashMap`'s `.insert_entry()` doc example During work on PR 164772 [1], I've noticed another tiny inconsistency in doc code examples: `HashMap`'s `Entry::insert_entry()`'s doc code example did not have an assertion where `BTreeMap`'s `Entry::insert_entry()`'s docs did. I've added an assertion where it was missing. [1] rust-lang#164772
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
Rollup of 8 pull requests Successful merges: - #164168 (Add tests for unsoundness involving alias liveness) - #164608 (core: Constify `resumable_breakpoint` and re-export it in `std`) - #164787 (cg_llvm: Use an invariant lifetime brand for LLVM contexts ) - #164851 (Add behavior tests for `Arc` and `Rc`) - #164966 (x86-64-linux-gnu seems to have working f128 now) - #153893 (Lex lifetimes as identifiers, recover from emoji and emit appropriate error) - #164895 (Disable recovery when attribute parser shouldn't emit) - #165004 (docs: Nitpick change in `HashMap`'s `.insert_entry()` doc example)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for ade807b failed: CI. Failed job:
|
Contributor
|
PR #164851, which is a member of this rollup, was unapproved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
resumable_breakpointand re-export it instd#164608 (core: Constifyresumable_breakpointand re-export it instd)ArcandRc#164851 (Add behavior tests forArcandRc)HashMap's.insert_entry()doc example #165004 (docs: Nitpick change inHashMap's.insert_entry()doc example)r? @ghost
Create a similar rollup