Skip to content

Type parameter Self/#0 out of range when substituting #9781

Closed
@nickgerace

Description

@nickgerace

Using rustup on stable-aarch64-apple-darwin, I upgraded to Rust 1.65. Upon running cargo clean and fixing new clippy warnings (there were many, so it would be may to pin down a trigger, if applicable), I ran the following commands:

cargo clean # success
cargo build --all-targets # success
cargo clippy --no-deps --all-targets # fails with error below

The last command produces the following error:

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:626:9: type parameter `Self/#0` (Self/0) out of range when substituting, substs=[]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/897e37553bba8b42751c67658967889d11ecd120/compiler/rustc_errors/src/lib.rs:1462:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.65 (897e3755 2022-11-02)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `redacted-crate-name`
warning: build failed, waiting for other jobs to finish...

Since the message recommended that I file a bug... here I am!

EDIT 1: the --all-targets flag appears to be the trigger.

EDIT 2: the issue appears to happen on both Linux (unknown-gnu) amd64 and macOS aarch64 systems using the corresponding their corresponding stable toolchains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions