-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make dyn*
's value backend type a pointer
#107772
Make dyn*
's value backend type a pointer
#107772
Conversation
1fbad25
to
f4a0097
Compare
@bors r+ |
📌 Commit f4a0097f3119667b0f3d9ceceec9a49a4d1ec564 has been approved by It is now in the queue for this repository. |
It would be good to add a case to // CHECK: { {{i8\*|ptr}}, {{i8\*|ptr}} } @dyn_star({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %x.1)
#[no_mangle]
pub fn dyn_star(x: dyn* Drop) -> dyn* Drop {
x
} |
// FIXME(dyn-star): We probably have to do a bitcast first, then inttoptr. | ||
kind => bug!("unexpected TypeKind for left-hand side of `dyn*` cast: {kind:?}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be hit by using a type such as
#[repr(C)]
struct S(usize);
and then doing S(0) as dyn* Send
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's broken for another reason (#104694), which I plan on rebasing/reworking once your Miri support for dyn* PR lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's not surprising -- I assume so far this has only been tested with types that have Scalar layout.
(i32, i32)
would also be an interesting testcase, that will have ScalarPair layout. Also better left for a future PR, probably.
@bors rollup=never |
@bors r- i'll address ralf's comments today |
2078fff
to
adc351c
Compare
@bors r=eholk |
📌 Commit adc351cadf47722f149d30b40b0136a3cfcbfdef has been approved by It is now in the queue for this repository. |
@bors r- |
dca87df
to
8c4eb8d
Compare
⌛ Testing commit 7f798c2 with merge 23d857844c85097003539b8f2e2b9a4707cf266a... |
💔 Test failed - checks-actions |
It didn't even start testing? @bors retry |
⌛ Testing commit 7f798c2 with merge 6910affab408ca9a6fcf649ae16a3b58d1d7c1a7... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
CI error is spurious, opened #108227 to track it |
Thanks, in that case @bors retry |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (73f4019): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
One tweak on top of Ralf's commit should fix using
usize
as adyn*
-coercible type, and should fix when we're using various other pointer types when LLVM opaque pointers is disabled.r? @eholk but feel free to reassign
cc #107728 (comment) @RalfJung