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

ices/73035.rs: fixed with errors #499

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 7, 2020

Issue: rust-lang/rust#73035

#![feature(type_alias_impl_trait)]

type X<T> = impl Clone;

fn f<T: Clone>(t: T) -> X<T> {
    t
}

fn g<T>(o : Option<X<T>>) -> Option<X<T>> {
    o.clone()
}

fn main() {
    g(None::<X<&mut ()>>);
}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `T: Clone` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/73035.rs:3:13
  |
3 | type X<T> = impl Clone;
  |             ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
  |
help: consider restricting type parameter `T`
  |
3 | type X<T: Clone> = impl Clone;
  |         ^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0277]: the trait bound `T: Clone` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/73035.rs:3:13
  |
3 | type X<T> = impl Clone;
  |             ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
  |
help: consider restricting type parameter `T`
  |
3 | type X<T: Clone> = impl Clone;
  |         ^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit b885c34 into master Oct 7, 2020
@JohnTitor JohnTitor deleted the autofix/ices/73035.rs branch October 7, 2020 12:40
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