Skip to content

"left.extend_from_slice(right.strip_prefix(&mut left[n..]).unwrap())" doesn't compile #110362

Open
@safinaskar

Description

@safinaskar

Here is simplified version of my code from actual production code base:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=99a751acd113949b2a77fa251e33f955 (rustc 1.68.2)

The code doesn't compile, but the code is correct, and it should compile. Yes, I can do the same task easier, but the code is still correct.

-Zpolonius doesn't change anything, i. e. this bug is not fixed by Polonius.

@rustbot label +A-lifetimes +T-compiler +A-borrow-checker +NLL-polonius +A-NLL

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-borrow-checkerArea: The borrow checkerA-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.NLL-poloniusIssues related for using Polonius in the borrow checkerT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions