Skip to content

Undesired formatting with &raw (place) #6503

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants