Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Enum renaming misses symbols in function bodies #467

@phrohdoh

Description

@phrohdoh

My original code is as follows:

#[derive(Debug)]
enum MonoError {
    DataContainsNulByte,
    FailedToCreateDomain,
    FailedToOpenAssembly,

    Foobar,
}

// Just for demonstration purposes.
impl Default for MonoError {
    fn default() -> Self {
        MonoError::Foobar
    }
}

// The `self` here is also for demonstration purposes.
impl From<NulError> for self::MonoError {
    fn from(_: NulError) -> Self {
        MonoError::DataContainsNulByte
    }
}

In renaming MonoError to RtError I get:

#[derive(Debug)]
enum RtError {
    DataContainsNulByte,
    FailedToCreateDomain,
    FailedToOpenAssembly,

    Foobar,
}

// Just for demonstration purposes.
impl Default for RtError {
    fn default() -> Self {
        MonoError::Foobar
    }
}

// The `self` here is also for demonstration purposes.
impl From<NulError> for self::RtError {
    fn from(_: NulError) -> Self {
        MonoError::DataContainsNulByte
    }
}

You will notice that the MonoError instances inside of the function bodies were not renamed as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions