rust-lang / rust-lang/rust

ICE in tail_expr_drop_order lint

Open
#142,155 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-async-await A-lints C-bug I-ICE requires-debug-assertions S-bug-has-test S-has-mcve T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

!! requires debug assertions !!

rustc a.rs --edition=2021

#![warn(tail_expr_drop_order)]
use core::future::Future;
use core::pin::Pin;

fn wrapped_fn<'a>() -> Pin<Box<(dyn Future<Output = Result<Box<()>, String>> + Send + 'static)>> {
    Box::pin(async { Err("nope".into()) })
}

pub fn main() {}
Meta

rustc --version --verbose:

c57119b9a1c86968188bb9703a7859c17f8bc71c
Error output
<output>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided example with a debug-assertions rustc using rustc a.rs --edition=2021 and #![warn(tail_expr_drop_order)], then trace the compiler entry point for that lint. Done means this example no longer triggers an internal compiler error and a regression test covers the behavior.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.