const_intrinsic_copy - Add Reference to tracking issue#80699
const_intrinsic_copy - Add Reference to tracking issue#80699bors merged 1 commit intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
| #[inline] | ||
| pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) { | ||
| extern "rust-intrinsic" { | ||
| #[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "none")] |
There was a problem hiding this comment.
This is not needed, right?
There was a problem hiding this comment.
I would have thought it is, otherwise you should not be able to call it below, looks like we have a hole in our analysis somewhere. The rustc_const_unstable attribute is what makes the intrinsic const, since we cannot have const fn intrinsics since the syntax doesn't allow this.
There was a problem hiding this comment.
uff.. I just checked, we have no unit tests ensuring that this actually works, so it must've regressed.
There was a problem hiding this comment.
The reason I noticed it was because I did not see the corresponding line for copy_nonoverlapping
There was a problem hiding this comment.
I believe I got the error before the rebase(the reason the attribute was on copy at all)
There was a problem hiding this comment.
As far as I can tell, only looking at #79684, the error probably disappeared somewhere between the 4th and 21th of December. Quite a large span, but perhaps somewhere to start...
I might be completely wrong
There was a problem hiding this comment.
I... have an inlkling. I'm waiting for a rebuild with some more trace! instructions, now that I am able to reproduce. I think the issue may be that the copy intrinsic is declare inside a function with rustc_const_unstable and inherits that
|
@bors r+ Let's merge it even with the "bug", I'll start working on it immediately. |
|
📌 Commit 63f5d61 has been approved by |
|
Ok, thanks :) |
|
☀️ Test successful - checks-actions |
…sics, r=RalfJung Stability oddity with const intrinsics cc `@RalfJung` In rust-lang#80699 (comment) `@usbalbin` realized we accepted some intrinsics as `const` without a `#[rustc_const_(un)stable]` attribute. I did some digging, and that example works because intrinsics inherit their stability from their parents... including `#[rustc_const_(un)stable]` attributes. While we may want to fix that (not sure, wasn't there just a MCPed PR that caused this on purpose?), we definitely want tests for it, thus this PR adding tests and some fun tracing statements.
…cs, r=RalfJung Stability oddity with const intrinsics cc `@RalfJung` In rust-lang#80699 (comment) `@usbalbin` realized we accepted some intrinsics as `const` without a `#[rustc_const_(un)stable]` attribute. I did some digging, and that example works because intrinsics inherit their stability from their parents... including `#[rustc_const_(un)stable]` attributes. While we may want to fix that (not sure, wasn't there just a MCPed PR that caused this on purpose?), we definitely want tests for it, thus this PR adding tests and some fun tracing statements.
Add reference to tracking issue #80697 for feature gate added in previous PR #79684