Skip to content
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

Undesired formatting with &raw (place) #6503

Closed
antonio-hickey opened this issue Mar 13, 2025 · 3 comments
Closed

Undesired formatting with &raw (place) #6503

antonio-hickey opened this issue Mar 13, 2025 · 3 comments

Comments

@antonio-hickey
Copy link

pub fn some_fn(&self) -> u32 {
    unsafe { &raw (*self.as_ptr()) }
}

when formatted becomes:

pub fn some_fn(&self) -> u32 {
    unsafe { &raw(*self.as_ptr()) }
}

this makes it look like raw is a function, which doesn't exist and won't compile.

@ytmimi
Copy link
Contributor

ytmimi commented Mar 13, 2025

Is there a tracking issue you can link to? I'm not familiar with raw places.

Edit: I think this is the tracking issue, and it looks like this was stabilized recently.

@ytmimi
Copy link
Contributor

ytmimi commented Mar 13, 2025

@antonio-hickey does this compile before formatting?

Maybe you meant to write &raw const or &raw mut?

@antonio-hickey
Copy link
Author

Yes, &raw const in which case works fine.

Thanks

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

No branches or pull requests

2 participants