Skip to content

Replace always_inline with inline(always)? #6446

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

Closed
kud1ing opened this issue May 13, 2013 · 5 comments
Closed

Replace always_inline with inline(always)? #6446

kud1ing opened this issue May 13, 2013 · 5 comments

Comments

@kud1ing
Copy link

kud1ing commented May 13, 2013

librustc/middle/trans/adt.rs is the only place to use the form #[always_inline].
Other places uses #[inline(always)].

Could this be unified?

@luqmana
Copy link
Member

luqmana commented May 13, 2013

It doesn't seem like #[always_inline] is respected at all. I'm guessing a mistype.

@kud1ing
Copy link
Author

kud1ing commented May 13, 2013

src/rt/rust_globals.h has some #define ALWAYS_INLINE __attribute((always_inline)) INLINE.
ALWAYS_INLINE is used in src/rt/arch/i386/sp.h and src/rt/arch/x86_64/sp.h.

Maybe this is a special or an ancient form?

@luqmana
Copy link
Member

luqmana commented May 13, 2013

Yep, but those are for c++ in the runtime.

@kud1ing
Copy link
Author

kud1ing commented May 13, 2013

I am not sure whether __attribute((always_inline)) would query the values set by #[always_inline].

@luqmana
Copy link
Member

luqmana commented May 13, 2013

They wouldn't, #[foo] are attributes in Rust code, while __attribute((always_inline)) is c/c++ compiler specific function attribute.

@kud1ing kud1ing closed this as completed May 13, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 24, 2022
Fix `await_holding_lock` not linting `parking_lot` Mutex/RwLock

This adds tests for `RwLock` and `parking_lot::{Mutex, RwLock}`, which were added before in rust-lang/rust-clippy@2dc8c08, but never tested in UI tests. I noticed this while reading [fasterthanli.me](https://fasterthanli.me/articles/a-rust-match-made-in-hell) latest blog post, complaining that Clippy doesn't catch this for `parking_lot`. (Too many people read his blog, he's too powerful)

Some more things:
- Adds a test for rust-lang#6446
- Improves the lint message

changelog: [`await_holding_lock`]: Now also lints for `parking_lot::{Mutex, RwLock}`
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