Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing id on hypetrain eventsub #208

Merged
merged 2 commits into from
Sep 5, 2021
Merged

fix missing id on hypetrain eventsub #208

merged 2 commits into from
Sep 5, 2021

Conversation

Emilgardis
Copy link
Member

No description provided.

@Emilgardis
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Sep 2, 2021
208: fix missing id on hypetrain eventsub r=Emilgardis a=Emilgardis



Co-authored-by: Emil Gardström <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 2, 2021

Canceled.

@Emilgardis
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Sep 2, 2021
208: fix missing id on hypetrain eventsub r=Emilgardis a=Emilgardis



Co-authored-by: Emil Gardström <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 2, 2021

Build failed:

@Emilgardis
Copy link
Member Author

Emilgardis commented Sep 2, 2021

ICE D:

thread 'rustc' panicked at 'internal error: entered unreachable code', src\librustdoc\html\render\print_item.rs:943:80
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

error: could not document `twitch_api2`

this seems wierd, I can replicate myself, but can't replicate with another library/crate, trying to find the cause to file an issue (if applicable)

it's this https://github.com/GuillaumeGomez/rust/blob/a5213888e04b6bacda5198dc41026b604fe410ef/src/librustdoc/html/render/print_item.rs#L943

edit: probably some wierd state I have, going to try and find out where it is, features ftw :D
edit2: it's pubsub, now to pinpoint the cause
edit3: pubsub + unsupported
edit4: can't even replicate with pubsub in its own crate
edit5: managed to get it again, now to see what it is...

@Emilgardis
Copy link
Member Author

found it. rust-lang/rust#88600

@Emilgardis
Copy link
Member Author

Emilgardis commented Sep 5, 2021

tried to fix it with something like this

// Custom default trait because I don't want to make T a real Default.
trait CustomDefault {
    fn custom_default() -> Self;
}

impl CustomDefault for HypeTrainCooldownExpiration{
    fn custom_default() -> Self {
        HypeTrainCooldownExpiration { }
    }
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct HypeTrainCooldownExpiration {}

#[derive(Deserialize)]
pub enum HypeTrainEventsV1Reply {
    #[serde(default = "CustomDefault::custom_default", "rename = "hype-train-cooldown-expiration")]
    HypeTrainCooldownExpiration(HypeTrainCooldownExpiration),
}

but that doesn't work. serde-rs/serde#2088

While waiting for a fix in rustdoc, I'll make the field not hidden and make it use a real struct for content and wrap it with an option, in case there ever will be content attached to the event.

@Emilgardis
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 5, 2021

Build succeeded:

@bors bors bot merged commit c65ad5c into master Sep 5, 2021
@bors bors bot deleted the hypetrain branch September 5, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant