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

ices/59311.rs: fixed with errors #450

Merged
merged 1 commit into from
Jul 28, 2020
Merged

ices/59311.rs: fixed with errors #450

merged 1 commit into from
Jul 28, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#59311

use std::sync::mpsc::channel;

pub struct S<T> {
    pub thing: T,
}

#[derive(Debug)]
struct E;

impl std::fmt::Display for E {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        unimplemented!()
    }
}

impl std::error::Error for E {}

impl<T> S<T> {
    pub fn do_thing()
    where
        for<'a> &'a T: 'static,
    {
        let (_sender, rx) = channel::<T>();
        let _ = rx.recv().map_err(|_| E);
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/59311.rs:24:35
   |
24 |         let _ = rx.recv().map_err(|_| E);
   |                                   ^^^^^

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/59311.rs:24:35
   |
24 |         let _ = rx.recv().map_err(|_| E);
   |                                   ^^^^^

error: aborting due to previous error

==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue has been fixed, I assume.

@JohnTitor JohnTitor merged commit 015ad36 into master Jul 28, 2020
@JohnTitor JohnTitor deleted the autofix/ices/59311.rs branch July 28, 2020 12:18
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