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

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

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

krasimirgg
Copy link
Contributor

@krasimirgg krasimirgg commented Oct 18, 2022

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.

@rustbot rustbot 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
Collaborator

r? @joshtriplett

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

@rust-highfive rust-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
Collaborator

rustbot commented Oct 18, 2022

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
Member

RalfJung commented Nov 5, 2022

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

@rustbot rustbot assigned m-ou-se and unassigned joshtriplett Nov 5, 2022
@Manishearth Manishearth added the regression-untriaged Untriaged performance or correctness regression. label Nov 21, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 21, 2022
@Amanieu
Copy link
Member

Amanieu commented Nov 22, 2022

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

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 22, 2022

📌 Commit df5d035 has been approved by Amanieu

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 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:master Nov 22, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 22, 2022
@Manishearth
Copy link
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
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
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
Contributor

oli-obk commented Nov 22, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-untriaged Untriaged performance or correctness regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.