Skip to content

Added mutability to PtrType and RefType TypeInfo#127

Merged
automergerpr-permission-manager[bot] merged 1 commit intomasterfrom
dc/ptr-mutability
Feb 28, 2026
Merged

Added mutability to PtrType and RefType TypeInfo#127
automergerpr-permission-manager[bot] merged 1 commit intomasterfrom
dc/ptr-mutability

Conversation

@dkcumming
Copy link
Collaborator

An error was seen with PtrToPtr casts in mir-semantics when there is an array of arrays being cast to change mutability. The current model incorrectly assumes it wants to point to an interior element, but this case needs to be distinguished from the case that is purely changing mutability. Therefore the mutability of the pointer needs to be accessible in the TypeInfo

@dkcumming dkcumming requested review from a team and mariaKt February 27, 2026 17:39
Copy link
Collaborator

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

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

Makes sense! The mk_graph TypeKind::Ptr/Ref variants now carry mutability, but nothing in the graph rendering reads it yet. Not a blocker (the data is there for when someone needs it), but worth tracking as a follow-up.

I created issue #128 to track it.

@automergerpr-permission-manager automergerpr-permission-manager bot merged commit ff1a18f into master Feb 28, 2026
5 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the dc/ptr-mutability branch February 28, 2026 07:46
@dkcumming
Copy link
Collaborator Author

dkcumming commented Feb 28, 2026

@cds-amal

but nothing in the graph rendering reads it yet

Actually the graph rendering already was _display_ing the information because the Display formatter for the ty is enough to print *const T or *mut T. So the graph has had the information, but the json has not until now (I got confused by this for a while when I connected the mutability and realised it was already printing).

image

cds-amal added a commit to cds-rs/stable-mir-json that referenced this pull request Mar 1, 2026
…ntimeverification#124, runtimeverification#126, runtimeverification#127

Several merged PRs were missing from the changelog or lacked PR links:

- runtimeverification#127: mutability field on PtrType/RefType in TypeMetadata
- runtimeverification#124: ADR-001 (index-first graph architecture)
- runtimeverification#121: existing entries for 3-phase pipeline, AllocMap coherence, and
  dead fixup removal now link to the PR
- runtimeverification#126: existing entries for UI test runner rewrite and provenance
  resolution fixes now link to the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants