Skip to content

Conversation

@sarah-quinones
Copy link

@sarah-quinones sarah-quinones commented Dec 9, 2024

amazing crate! hope it's fine for me to suggest a few improvements

this pr makes the constructors of Id and Guard const, allows multiple identifiers in make_guard!, and makes the compiler error for mismatching lifetimes point to the relevant guards instead of the compiler always complaining about branded_place, which should be an implementation detail

@ArhanChaudhary
Copy link

@CAD97 you should take a look!

@CAD97
Copy link
Owner

CAD97 commented Aug 6, 2025

Current compilers don't mention branded_place by name anymore, so I'm going to go ahead and close this for now. Rust also doesn't really do multiple declarations in one line, so I don't really think that doing so for make_guard! is really necessary. While creating multiple branded lifetimes is useful for showing the compiler error, it's very rarely needed in brand-using code anyway.

@CAD97 CAD97 closed this Aug 6, 2025
@ArhanChaudhary
Copy link

Oh right, I didn't even realize temporaries weren't called out by name any more. What about the #[inline] stuff for this PR? That looks useful.

@CAD97
Copy link
Owner

CAD97 commented Aug 6, 2025

There was a change in the compiler at some point that "trivial" functions in MIR are automatically given equivalent to #[inline] treatment. They all get inlined at the MIR level already, so there's no need to further press on the compiler and mess with the heuristic differences that exist between debug and release, imo.

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.

3 participants