Skip to content

Regression in autoderef on ascii traits #32074

Closed
@Manishearth

Description

@Manishearth

The following code compiles on stable but gives an error on beta/nightly:

use std::ascii::AsciiExt; 

fn main() {
        let x = "a".to_string();
        x.eq_ignore_ascii_case("A");
}

playpen

<anon>:5:32: 5:35 error: mismatched types:
 expected `&collections::string::String`,
    found `&'static str`
(expected struct `collections::string::String`,
    found str) [E0308]
<anon>:5         x.eq_ignore_ascii_case("A");

This was caused by the new impl of AsciiExt on String: 700ac0e

cc @SimonSapin @alexcrichton

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-highHigh priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions