Skip to content

mark sys_common::once::generic::Once::new const-stable - #103193

Merged
bors merged 1 commit into
rust-lang:masterfrom
krasimirgg:sysonce
Nov 22, 2022
Merged

mark sys_common::once::generic::Once::new const-stable#103193
bors merged 1 commit into
rust-lang:masterfrom
krasimirgg:sysonce

Conversation

@krasimirgg

@krasimirggkrasimirgg commented Oct 18, 2022

Copy link
Copy Markdown
Contributor

Attempt to address #103191 by marking the impl const-stable.
Picked the declaration from the callsite:

#[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]

This is similar to #98457.

With this in, python3 x.py build library/std --target x86_64-unknown-none succeeds.

@rustbotrustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 18, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 18, 2022
@krasimirgg
krasimirgg marked this pull request as ready for review October 18, 2022 15:57
@rustbot

Copy link
Copy Markdown
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@RalfJung

Copy link
Copy Markdown
Member

https://doc.rust-lang.org/nightly/std/sync/struct.Once.html#method.new has been const fn since forever so this is probably just an internal change?
r? @m-ou-se

@rustbotrustbot assigned m-ou-se and unassigned joshtriplettNov 5, 2022
@ManishearthManishearth added the regression-untriaged Untriaged performance or correctness regression. label Nov 21, 2022
@rustbotrustbot added the I-prioritize Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical} label Nov 21, 2022
@Amanieu

Copy link
Copy Markdown
Member

This seems to be necessary because the generic implementation uses ptr::invalid_mut, which is still unstable.

@bors r+ rollup

@bors

bors commented Nov 22, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit df5d035 has been approved by Amanieu

It is now in the queue for this repository.

@borsbors 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 Nov 22, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 22, 2022
…earth
Rollup of 7 pull requests
Successful merges:
- rust-lang#83608 (Add slice methods for indexing via an array of indices.)
- rust-lang#95583 (Deprecate the unstable `ptr_to_from_bits` feature)
- rust-lang#101655 (Make the Box one-liner more descriptive)
- rust-lang#102207 (Constify remaining `Layout` methods)
- rust-lang#103193 (mark sys_common::once::generic::Once::new const-stable)
- rust-lang#104622 (Use clang for the UEFI targets)
- rust-lang#104638 (Move macro_rules diagnostics to diagnostics module)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 3683c43 into rust-lang:masterNov 22, 2022
@rustbotrustbot added this to the 1.67.0 milestone Nov 22, 2022
@Manishearth

Copy link
Copy Markdown
Member

This seems to be necessary because the generic implementation uses ptr::invalid_mut, which is still unstable.

cc @estebank@oli-obk

might be worth looking at showing proximal cause in the diagnostics for stuff like this, fwiw

@estebank

Copy link
Copy Markdown
Contributor

@Manishearth can we have an minimal repro for this? I'm not as involved with the const fn space so I don't have the context for how the current state is bad.

@Manishearth

Copy link
Copy Markdown
Member

@estebank tricky thing is that because it has to do with const_stable it needs to be reprod in std.

I can try but I don't fully understand what's happening here either, that's why I cc'd oli

@oli-obk

Copy link
Copy Markdown
Contributor

I think this is a hole in our const stability checks. Basically functions without stability attributes are usable from stable const fn even if they internally call unstable const fn

@apirainoapiraino removed the I-prioritize Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical} label Nov 23, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

regression-untriagedUntriaged performance or correctness regression.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant 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.

12 participants

@krasimirgg@rust-highfive@rustbot@RalfJung@Amanieu@bors@Manishearth@estebank@oli-obk@joshtriplett@m-ou-se@apiraino