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

ices/52843.rs: fixed with errors #487

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#52843

#![feature(type_alias_impl_trait)]

type Foo<T> = impl Default;

#[allow(unused)]
fn foo<T: Default>(t: T) -> Foo<T> {
    t
}

struct NotDefault;

fn main() {
    let _ = Foo::<NotDefault>::default();
}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `T: Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/52843.rs:3:15
  |
3 | type Foo<T> = impl Default;
  |               ^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
  |
help: consider restricting type parameter `T`
  |
3 | type Foo<T: Default> = impl Default;
  |           ^^^^^^^^^

error: aborting due to previous error

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

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

error: aborting due to previous error

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