Skip to content

Use 'ref readonly' in 'Unsafe.AsPointer' #114406

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

Merged

Conversation

Sergio0694
Copy link
Contributor

Closes #114189

This PR updates the signature of Unsafe.AsPointer to take a ref readonly instead.

@Copilot Copilot AI review requested due to automatic review settings April 8, 2025 20:13
@ghost
Copy link

ghost commented Apr 8, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost
Copy link

ghost commented Apr 8, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@Sergio0694 Sergio0694 requested review from tannergooding and removed request for MichalStrehovsky and Copilot April 8, 2025 20:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 8, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices
See info in area-owners.md if you want to be subscribed.

@Sergio0694
Copy link
Contributor Author

Failure in Mono.Linker.Tests.TestCases.All.DataFlow(t: \"DynamicObjects\") seems unrelated? 🤔

MichalStrehovsky added a commit that referenced this pull request Apr 9, 2025
ToolsTests legs are failing: #114406 (comment)
Psychic debugging (without actually trying to repro anything) tells me this is from #114346 that makes us emit more dynamic keyword warnings. That PR didn't trigger the ToolsTests leg since it's not a ILLink change.
@MichalStrehovsky
Copy link
Member

Failure in Mono.Linker.Tests.TestCases.All.DataFlow(t: \"DynamicObjects\") seems unrelated? 🤔

Likely fallout from a different PR that didn't run the Tools_Tests leg. Attempted a fix at #114424.

MichalStrehovsky added a commit that referenced this pull request Apr 9, 2025
ToolsTests legs are failing: #114406 (comment)
Psychic debugging (without actually trying to repro anything) tells me this is from #114346 that makes us emit more dynamic keyword warnings. That PR didn't trigger the ToolsTests leg since it's not a ILLink change.
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/unsafe-aspointer-refreadonly branch from 4c7f63d to 6d3a3b9 Compare April 10, 2025 03:34
@jkotas jkotas merged commit 737a7d2 into dotnet:main Apr 11, 2025
142 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: change 'Unsafe.AsPointer' parameter to be 'ref readonly'
4 participants