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

ices/89864.rs: fixed with no errors #1247

Merged
merged 1 commit into from
May 13, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#89864

#![crate_type = "lib"]
#![feature(fmt_internals)]

use core::{fmt, marker::PhantomData};

pub trait WrapperTrait {
    type Assoc;
}

pub trait Trait {
    type Assoc;
}

pub struct Ice<T>(<<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc);

fn ice<T>(i: Ice<T>)
where
    <<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc: fmt::Debug,
{
    fmt::ArgumentV1::new(&i.0, fmt::Debug::fmt);
}

pub struct TraitImplementor;

impl Trait for TraitImplementor {
    type Assoc = ConcreteAssoc;
}

pub struct ConcreteAssoc;

impl<T> WrapperTrait for Dynamic<T> {
    type Assoc = TraitImplementor;
}

pub struct Dynamic<T>(PhantomData<T>);
=== stdout ===
=== stderr ===
warning: function is never used: `ice`
  --> /home/runner/work/glacier/glacier/ices/89864.rs:16:4
   |
16 | fn ice<T>(i: Ice<T>)
   |    ^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

==============

=== stdout ===
=== stderr ===
warning: function is never used: `ice`
  --> /home/runner/work/glacier/glacier/ices/89864.rs:16:4
   |
16 | fn ice<T>(i: Ice<T>)
   |    ^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

==============
@Alexendoo Alexendoo merged commit 3fd5620 into master May 13, 2022
@Alexendoo Alexendoo deleted the autofix/ices/89864.rs branch May 13, 2022 14:04
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