Skip to content

c-variadic: test that we use equality up to free lifetimes#158039

Open
folkertdev wants to merge 1 commit into
rust-lang:mainfrom
folkertdev:c-variadic-lifetimes
Open

c-variadic: test that we use equality up to free lifetimes#158039
folkertdev wants to merge 1 commit into
rust-lang:mainfrom
folkertdev:c-variadic-lifetimes

Conversation

@folkertdev

@folkertdev folkertdev commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

tracking issue: #44930

Test that we use equality up to free lifetimes, and correctly consider for<'a> &'a to be different from &'static. I'm not sure if I'm missing any type subtleties here? Because it seems like the current implementation already has the behavior that we want. (and that == on Ty has this behavior).

Also see #155697 (comment) and #155697 (comment).

cc @theemathas
r? RalfJung,lcnr

@folkertdev folkertdev added the F-c_variadic `#![feature(c_variadic)]` label Jun 17, 2026
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If possible, consider making this change to rust-lang/miri instead.

cc @rust-lang/miri

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 17, 2026
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@rust-bors

This comment has been minimized.

@folkertdev folkertdev force-pushed the c-variadic-lifetimes branch from 49f9839 to 9b9496c Compare June 20, 2026 11:02
@rustbot

rustbot commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@RalfJung

Copy link
Copy Markdown
Member

Did @theemathas report this as an issue somewhere? The link to the tracking issue is un-specific.

This seems fine to me but I don't have a good handle on how we should deal with lifetimes here.

@theemathas

Copy link
Copy Markdown
Contributor

@RalfJung No. See #155697 (comment) and #155697 (comment)

Comment thread src/tools/miri/tests/pass/c-variadic.rs Outdated
@RalfJung

Copy link
Copy Markdown
Member

Ah, that was the one, thanks.

@folkertdev folkertdev force-pushed the c-variadic-lifetimes branch from fc89fa6 to 40aef82 Compare June 22, 2026 08:56
@folkertdev

Copy link
Copy Markdown
Contributor Author

@lcnr idk if the notifications etc work when reviewers are added manually, but I think this just needs your quick confirmation that the behavior is what you expect (basically that we use == on Ty for the equality comparison).

@RalfJung

Copy link
Copy Markdown
Member

Since this only affects tests we can still land it -- but the stabilization PR should wait for someone from t-types to confirm the intended behavior.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 40aef82 has been approved by RalfJung

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 23, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 24, 2026
…=RalfJung

c-variadic: test that we use equality up to free lifetimes

tracking issue: rust-lang#44930

Test that we use equality up to free lifetimes, and correctly consider `for<'a> &'a` to be different from `&'static`. I'm not sure if I'm missing any type subtleties here? Because it seems like the current implementation already has the behavior that we want. (and that `==` on `Ty` has this behavior).

Also see rust-lang#155697 (comment) and rust-lang#155697 (comment).

cc @theemathas
r? RalfJung,lcnr
rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rollup of 27 pull requests

Successful merges:

 - #158315 (`rust-analyzer` subtree update)
 - #155739 (Add temporary scope to assert_eq and assert_ne)
 - #156885 (Fix misattributed type inference error span for index expressions)
 - #157271 (simplify some `proc_macro` things)
 - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit)
 - #157921 (trait solver: Resolve region vars in max universe)
 - #157960 (delegation: add support for infers in generics)
 - #157983 (Lift the same-signature restriction for `extern "tail"`)
 - #158053 (Optimize network address parser)
 - #158105 (Extract all instance shim variants into new `ShimKind` enum)
 - #158207 (Resolver: local/external split of  `resolve_ident_in_module_non_globs_unadjusted` )
 - #158279 (Follow goto and drop when linting unreachable code)
 - #157527 (Move derive tests into their dedicated folder)
 - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`)
 - #158020 (Update mingw-w64 C toolchain)
 - #158039 (c-variadic: test that we use equality up to free lifetimes)
 - #158222 (format: ignore println newline in foreign format hints)
 - #158223 (Move target checking for #[lang] to the attribute parser)
 - #158252 (Use `cfg_select` in `std::os`)
 - #158257 ( fix escaping placeholder check in next solver normalization folder)
 - #158263 (Only load the feature list once in the entire resolver)
 - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use)
 - #158274 (triagebot: Stop pinging myself)
 - #158282 (slice_split_once: bounds check optimization note)
 - #158300 (Improve unknown crate_type diagnostic suggestions)
 - #158304 (mailmap: update mu001999)
 - #158309 (Update `rustc-literal-escaper` version to `0.0.8`)

Failed merges:

 - #158256 (Avoid parser panics bubbling out to proc macros)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 24, 2026
…=RalfJung

c-variadic: test that we use equality up to free lifetimes

tracking issue: rust-lang#44930

Test that we use equality up to free lifetimes, and correctly consider `for<'a> &'a` to be different from `&'static`. I'm not sure if I'm missing any type subtleties here? Because it seems like the current implementation already has the behavior that we want. (and that `==` on `Ty` has this behavior).

Also see rust-lang#155697 (comment) and rust-lang#155697 (comment).

cc @theemathas
r? RalfJung,lcnr
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 24, 2026
…=RalfJung

c-variadic: test that we use equality up to free lifetimes

tracking issue: rust-lang#44930

Test that we use equality up to free lifetimes, and correctly consider `for<'a> &'a` to be different from `&'static`. I'm not sure if I'm missing any type subtleties here? Because it seems like the current implementation already has the behavior that we want. (and that `==` on `Ty` has this behavior).

Also see rust-lang#155697 (comment) and rust-lang#155697 (comment).

cc @theemathas
r? RalfJung,lcnr
rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rollup of 35 pull requests

Successful merges:

 - #158315 (`rust-analyzer` subtree update)
 - #158336 (Stop excluding `stdarch` test crates from `rust-src`)
 - #155739 (Add temporary scope to assert_eq and assert_ne)
 - #156885 (Fix misattributed type inference error span for index expressions)
 - #157271 (simplify some `proc_macro` things)
 - #157419 (move rustc_type_ir Term things to term_kind.rs)
 - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit)
 - #157921 (trait solver: Resolve region vars in max universe)
 - #157960 (delegation: add support for infers in generics)
 - #157983 (Lift the same-signature restriction for `extern "tail"`)
 - #158053 (Optimize network address parser)
 - #158105 (Extract all instance shim variants into new `ShimKind` enum)
 - #158207 (Resolver: local/external split of  `resolve_ident_in_module_non_globs_unadjusted` )
 - #158279 (Follow goto and drop when linting unreachable code)
 - #157527 (Move derive tests into their dedicated folder)
 - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`)
 - #157939 (Reorganize `tests/ui/issues` [8/N])
 - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public)
 - #158003 (Reorganize `tests/ui/issues` [9/N])
 - #158020 (Update mingw-w64 C toolchain)
 - #158039 (c-variadic: test that we use equality up to free lifetimes)
 - #158060 (Reorganize `tests/ui/issues` [10/N])
 - #158222 (format: ignore println newline in foreign format hints)
 - #158223 (Move target checking for #[lang] to the attribute parser)
 - #158252 (Use `cfg_select` in `std::os`)
 - #158263 (Only load the feature list once in the entire resolver)
 - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use)
 - #158272 (Reorganize `tests/ui/issues` [13/N])
 - #158274 (triagebot: Stop pinging myself)
 - #158282 (slice_split_once: bounds check optimization note)
 - #158300 (Improve unknown crate_type diagnostic suggestions)
 - #158304 (mailmap: update mu001999)
 - #158309 (Update `rustc-literal-escaper` version to `0.0.8`)
 - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact)
 - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rollup of 35 pull requests

Successful merges:

 - #158315 (`rust-analyzer` subtree update)
 - #158336 (Stop excluding `stdarch` test crates from `rust-src`)
 - #155739 (Add temporary scope to assert_eq and assert_ne)
 - #156885 (Fix misattributed type inference error span for index expressions)
 - #157271 (simplify some `proc_macro` things)
 - #157419 (move rustc_type_ir Term things to term_kind.rs)
 - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit)
 - #157921 (trait solver: Resolve region vars in max universe)
 - #157960 (delegation: add support for infers in generics)
 - #157983 (Lift the same-signature restriction for `extern "tail"`)
 - #158053 (Optimize network address parser)
 - #158105 (Extract all instance shim variants into new `ShimKind` enum)
 - #158207 (Resolver: local/external split of  `resolve_ident_in_module_non_globs_unadjusted` )
 - #158279 (Follow goto and drop when linting unreachable code)
 - #157527 (Move derive tests into their dedicated folder)
 - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`)
 - #157939 (Reorganize `tests/ui/issues` [8/N])
 - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public)
 - #158003 (Reorganize `tests/ui/issues` [9/N])
 - #158020 (Update mingw-w64 C toolchain)
 - #158039 (c-variadic: test that we use equality up to free lifetimes)
 - #158060 (Reorganize `tests/ui/issues` [10/N])
 - #158222 (format: ignore println newline in foreign format hints)
 - #158223 (Move target checking for #[lang] to the attribute parser)
 - #158252 (Use `cfg_select` in `std::os`)
 - #158263 (Only load the feature list once in the entire resolver)
 - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use)
 - #158272 (Reorganize `tests/ui/issues` [13/N])
 - #158274 (triagebot: Stop pinging myself)
 - #158282 (slice_split_once: bounds check optimization note)
 - #158300 (Improve unknown crate_type diagnostic suggestions)
 - #158304 (mailmap: update mu001999)
 - #158309 (Update `rustc-literal-escaper` version to `0.0.8`)
 - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact)
 - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rollup of 35 pull requests

Successful merges:

 - #158315 (`rust-analyzer` subtree update)
 - #158336 (Stop excluding `stdarch` test crates from `rust-src`)
 - #155739 (Add temporary scope to assert_eq and assert_ne)
 - #156885 (Fix misattributed type inference error span for index expressions)
 - #157271 (simplify some `proc_macro` things)
 - #157419 (move rustc_type_ir Term things to term_kind.rs)
 - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit)
 - #157921 (trait solver: Resolve region vars in max universe)
 - #157960 (delegation: add support for infers in generics)
 - #157983 (Lift the same-signature restriction for `extern "tail"`)
 - #158053 (Optimize network address parser)
 - #158105 (Extract all instance shim variants into new `ShimKind` enum)
 - #158207 (Resolver: local/external split of  `resolve_ident_in_module_non_globs_unadjusted` )
 - #158279 (Follow goto and drop when linting unreachable code)
 - #157527 (Move derive tests into their dedicated folder)
 - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`)
 - #157939 (Reorganize `tests/ui/issues` [8/N])
 - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public)
 - #158003 (Reorganize `tests/ui/issues` [9/N])
 - #158020 (Update mingw-w64 C toolchain)
 - #158039 (c-variadic: test that we use equality up to free lifetimes)
 - #158060 (Reorganize `tests/ui/issues` [10/N])
 - #158222 (format: ignore println newline in foreign format hints)
 - #158223 (Move target checking for #[lang] to the attribute parser)
 - #158252 (Use `cfg_select` in `std::os`)
 - #158263 (Only load the feature list once in the entire resolver)
 - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use)
 - #158272 (Reorganize `tests/ui/issues` [13/N])
 - #158274 (triagebot: Stop pinging myself)
 - #158282 (slice_split_once: bounds check optimization note)
 - #158300 (Improve unknown crate_type diagnostic suggestions)
 - #158304 (mailmap: update mu001999)
 - #158309 (Update `rustc-literal-escaper` version to `0.0.8`)
 - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact)
 - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rollup of 35 pull requests

Successful merges:

 - #158315 (`rust-analyzer` subtree update)
 - #158336 (Stop excluding `stdarch` test crates from `rust-src`)
 - #155739 (Add temporary scope to assert_eq and assert_ne)
 - #156885 (Fix misattributed type inference error span for index expressions)
 - #157271 (simplify some `proc_macro` things)
 - #157419 (move rustc_type_ir Term things to term_kind.rs)
 - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit)
 - #157921 (trait solver: Resolve region vars in max universe)
 - #157960 (delegation: add support for infers in generics)
 - #157983 (Lift the same-signature restriction for `extern "tail"`)
 - #158053 (Optimize network address parser)
 - #158105 (Extract all instance shim variants into new `ShimKind` enum)
 - #158207 (Resolver: local/external split of  `resolve_ident_in_module_non_globs_unadjusted` )
 - #158279 (Follow goto and drop when linting unreachable code)
 - #157527 (Move derive tests into their dedicated folder)
 - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`)
 - #157939 (Reorganize `tests/ui/issues` [8/N])
 - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public)
 - #158003 (Reorganize `tests/ui/issues` [9/N])
 - #158020 (Update mingw-w64 C toolchain)
 - #158039 (c-variadic: test that we use equality up to free lifetimes)
 - #158060 (Reorganize `tests/ui/issues` [10/N])
 - #158222 (format: ignore println newline in foreign format hints)
 - #158223 (Move target checking for #[lang] to the attribute parser)
 - #158252 (Use `cfg_select` in `std::os`)
 - #158263 (Only load the feature list once in the entire resolver)
 - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use)
 - #158272 (Reorganize `tests/ui/issues` [13/N])
 - #158274 (triagebot: Stop pinging myself)
 - #158282 (slice_split_once: bounds check optimization note)
 - #158300 (Improve unknown crate_type diagnostic suggestions)
 - #158304 (mailmap: update mu001999)
 - #158309 (Update `rustc-literal-escaper` version to `0.0.8`)
 - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact)
 - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 24, 2026
…=RalfJung

c-variadic: test that we use equality up to free lifetimes

tracking issue: rust-lang#44930

Test that we use equality up to free lifetimes, and correctly consider `for<'a> &'a` to be different from `&'static`. I'm not sure if I'm missing any type subtleties here? Because it seems like the current implementation already has the behavior that we want. (and that `==` on `Ty` has this behavior).

Also see rust-lang#155697 (comment) and rust-lang#155697 (comment).

cc @theemathas
r? RalfJung,lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-c_variadic `#![feature(c_variadic)]` 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.

5 participants