Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/64848.rs: fixed with no errors #243

Merged
merged 1 commit into from
Dec 31, 2019
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#64848

trait AssociatedConstant {
    const DATA: ();
}

impl<F, T> AssociatedConstant for F
where
    F: FnOnce() -> T,
    T: AssociatedConstant,
{
    const DATA: () = T::DATA;
}

impl AssociatedConstant for () {
    const DATA: () = ();
}

fn foo() -> impl AssociatedConstant {
    ()
}

fn get_data<T: AssociatedConstant>(_: T) -> &'static () {
    &T::DATA
}

fn main() {
    get_data(foo);
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@JohnTitor JohnTitor merged commit d215287 into master Dec 31, 2019
@JohnTitor JohnTitor deleted the autofix/ices/64848.rs branch December 31, 2019 12:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants