about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-04-27 23:44:45 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-04-27 23:44:45 -0700
commit8857cc2131e2f09bcb44c8867b6e6a50d9b4ae32 (patch)
tree5f363702227dc1546c482f24d99241f7aad6da66 /compiler/rustc_parse/src/parser/expr.rs
parent1c42cb4ef0544fbfaa500216e53382d6b079c001 (diff)
downloadrust-8857cc2131e2f09bcb44c8867b6e6a50d9b4ae32.tar.gz
rust-8857cc2131e2f09bcb44c8867b6e6a50d9b4ae32.zip
`inline(always)` for `lt`/`le`/`ge`/`gt` on integers and floats
I happened to notice one of these not getting inlined as part of `Range::next` in <https://rust.godbolt.org/z/4WKWWxj1G>
```rust
    bb1: {
        StorageLive(_5);
        _6 = &mut _4;
        StorageLive(_21);
        StorageLive(_14);
        StorageLive(_15);
        _15 = &((*_6).0: usize);
        StorageLive(_16);
        _16 = &((*_6).1: usize);
        _14 = <usize as PartialOrd>::lt(move _15, move _16) -> bb7;
    }
```

So since a call for something this trivial is never the right choice, `#[inline(always)]` seems appropriate.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions