Skip to content

Print type name when panicking due to violating aliasing laws#239

Merged
Imberflur merged 3 commits intoamethyst:masterfrom
richard-uk1:type_name
Feb 28, 2025
Merged

Print type name when panicking due to violating aliasing laws#239
Imberflur merged 3 commits intoamethyst:masterfrom
richard-uk1:type_name

Conversation

@richard-uk1
Copy link
Contributor

When you have a lot of storages in a big project, and especially when backtraces are not available (e.g. web) it can be difficult to know which storage is breaking the borrow rules (mut + immut borrow or 2+ mut borrows). This patch adds the type name to the panic message.

@Imberflur
Copy link
Contributor

Hi, was this closed from inactivity? I just fixed the unrelated issues causing the CI to fail.

@richard-uk1
Copy link
Contributor Author

No, I'm no longer working at the company that this work was for. But I can re-open if you want to take the PR?

@richard-uk1 richard-uk1 reopened this Feb 27, 2025
@Imberflur
Copy link
Contributor

But I can re-open if you want to take the PR?

Looks like a nice improvement to me and didn't have any performance impact when I tested it so I think merging it would be nice.

@richard-uk1
Copy link
Contributor Author

CI is green

@Imberflur Imberflur merged commit 35d3fa8 into amethyst:master Feb 28, 2025
4 checks passed
@Imberflur
Copy link
Contributor

Thanks!

@richard-uk1 richard-uk1 deleted the type_name branch February 28, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants