Skip to content

Rust nightly broke formatdoc! #106408

Closed
Closed
@VorfeedCanal

Description

@VorfeedCanal

I guess good deeds don't go unpubished.

When I filed issue about indoc crashing the compiler with safe code I was, kinda, expecting that fix for the issue would lead to successful compilation, not regression.

Note that this code:

use indoc::formatdoc;

fn main() {
    let trait_name = "Trait";
    let fn_name = "fun";
    println!("{}", formatdoc!("
                          pub trait {trait_name};
                          fn {fn_name};}}"));
}

works on all version of Rust starting from 1.58 till 1.67.

Now it no longer works (after fix for #106191).

One may argue that code was never supposed to work, but since it was supported for whole year… it's probably good to note it somewhere (preferable in release notes, I guess).

Metadata

Metadata

Assignees

Labels

P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions