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

ices/79224.rs: fixed with errors #1165

Merged
merged 1 commit into from
Mar 9, 2022
Merged

ices/79224.rs: fixed with errors #1165

merged 1 commit into from
Mar 9, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2022

Issue: rust-lang/rust#79224

#![feature(min_specialization)]
use std::fmt::{self, Display};

pub enum Cow<'a, B: ?Sized + 'a, O = <B as ToOwned>::Owned>
where
    B: ToOwned,
{
    Borrowed(&'a B),
    Owned(O),
}


impl ToString for Cow<'_, str> {
    fn to_string(&self) -> String {
        panic!()
    }
}

impl<B: ?Sized> Display for Cow<'_, B> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        panic!()
    }
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `79224`
  --> /home/runner/work/glacier/glacier/ices/79224.rs:23:2
   |
23 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/79224.rs`

error[E0277]: the trait bound `B: Clone` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/79224.rs:19:17
   |
19 | impl<B: ?Sized> Display for Cow<'_, B> {
   |                 ^^^^^^^ the trait `Clone` is not implemented for `B`
   |
   = note: required because of the requirements on the impl of `ToOwned` for `B`
help: consider further restricting this bound
   |
19 | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
   |                +++++++++++++++++++

error[E0277]: the trait bound `B: Clone` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/79224.rs:20:5
   |
20 | /     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 | |         panic!()
22 | |     }
   | |_____^ the trait `Clone` is not implemented for `B`
   |
   = note: required because of the requirements on the impl of `ToOwned` for `B`
help: consider further restricting this bound
   |
19 | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
   |                +++++++++++++++++++

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `79224`
  --> /home/runner/work/glacier/glacier/ices/79224.rs:23:2
   |
23 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/79224.rs`

error[E0277]: the trait bound `B: Clone` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/79224.rs:19:17
   |
19 | impl<B: ?Sized> Display for Cow<'_, B> {
   |                 ^^^^^^^ the trait `Clone` is not implemented for `B`
   |
   = note: required because of the requirements on the impl of `ToOwned` for `B`
help: consider further restricting this bound
   |
19 | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
   |                +++++++++++++++++++

error[E0277]: the trait bound `B: Clone` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/79224.rs:20:5
   |
20 | /     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 | |         panic!()
22 | |     }
   | |_____^ the trait `Clone` is not implemented for `B`
   |
   = note: required because of the requirements on the impl of `ToOwned` for `B`
help: consider further restricting this bound
   |
19 | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
   |                +++++++++++++++++++

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit bf0a035 into master Mar 9, 2022
@Alexendoo Alexendoo deleted the autofix/ices/79224.rs branch March 9, 2022 12:19
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