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

ICE with complex custom derive #1360

Closed
Xanewok opened this issue Feb 25, 2019 · 1 comment
Closed

ICE with complex custom derive #1360

Xanewok opened this issue Feb 25, 2019 · 1 comment

Comments

@Xanewok
Copy link
Member

Xanewok commented Feb 25, 2019

Originally created by @nrc (rust-dev-tools/rls-analysis#83):

See https://github.com/DanielKeep/rust-conv/blob/master/src/errors.rs#L227-L256

custom_derive!{
    /**
    A general error enumeration that subsumes all other conversion errors.
    This exists primarily as a "catch-all" for reliably unifying various different kinds of conversion errors.
    */
    #[derive(
        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
        IntoInner, DummyDebug, FromNoError,
        EnumDesc(
            NegOverflow => "conversion resulted in negative overflow",
            PosOverflow => "conversion resulted in positive overflow",
            Unrepresentable => "could not convert unrepresentable value",
        ),
        FromName(Unrepresentable),
        FromName(NegOverflow),
        FromName(PosOverflow),
        FromRemap(RangeError(NegOverflow, PosOverflow))
    )]
    pub enum GeneralError<T> {
        /// Input was too negative for the target type.
        NegOverflow(T),

        /// Input was too positive for the target type.
        PosOverflow(T),

        /// Input was not representable in the target type.
        Unrepresentable(T),
    }
}

I think the ICE is happening when compiling the conv crate

@Xanewok
Copy link
Member Author

Xanewok commented Mar 3, 2019

Just tested this and the ICE is gone now, so closing.

@Xanewok Xanewok closed this as completed Mar 3, 2019
@Xanewok Xanewok added the bug label Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant