`#[inline]` affects whether consteval happens
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
fn foo<T>() {
const { panic!() }
}
// uncommenting this line makes it compile
// #[inline]
pub fn wut() {
foo::<i32>();
}
I expected #[inline] to not affect whether the code compiles or not. However, the code compiles with #[inline], and fails to compile without #[inline]. I'm not sure if this is a bug or not.
Discovered in https://github.com/rust-lang/rust/pull/144363
@rustbot labels +A-const-eval
Meta
Reproducible on the playground with stable rust 1.88.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example on the Rust playground with stable Rust 1.88.0, comparing compilation with and without #[inline]. Trace the const-eval behavior involved in the const block and add a regression test showing that compilation should not depend on the inline attribute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100