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

ices/74298.rs: fixed with errors #465

Merged
merged 1 commit into from
Sep 21, 2020
Merged

ices/74298.rs: fixed with errors #465

merged 1 commit into from
Sep 21, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#74298

#![feature(type_alias_impl_trait)]

type X<T> = impl Sized;

fn f<T>() -> X<T> {}

trait Y {
    fn g(&self) {}
}

impl Y for X<()> {}
impl Y for X<i32> {}

fn main() {
    f::<()>().g();
}
=== stdout ===
=== stderr ===
error: cannot implement trait on type alias impl trait
  --> /home/runner/work/glacier/glacier/ices/74298.rs:11:1
   |
11 | impl Y for X<()> {}
   | ^^^^^^^^^^^^^^^^
   |
note: type alias impl trait defined here
  --> /home/runner/work/glacier/glacier/ices/74298.rs:3:13
   |
3  | type X<T> = impl Sized;
   |             ^^^^^^^^^^

error: cannot implement trait on type alias impl trait
  --> /home/runner/work/glacier/glacier/ices/74298.rs:12:1
   |
12 | impl Y for X<i32> {}
   | ^^^^^^^^^^^^^^^^^
   |
note: type alias impl trait defined here
  --> /home/runner/work/glacier/glacier/ices/74298.rs:3:13
   |
3  | type X<T> = impl Sized;
   |             ^^^^^^^^^^

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error: cannot implement trait on type alias impl trait
  --> /home/runner/work/glacier/glacier/ices/74298.rs:11:1
   |
11 | impl Y for X<()> {}
   | ^^^^^^^^^^^^^^^^
   |
note: type alias impl trait defined here
  --> /home/runner/work/glacier/glacier/ices/74298.rs:3:13
   |
3  | type X<T> = impl Sized;
   |             ^^^^^^^^^^

error: cannot implement trait on type alias impl trait
  --> /home/runner/work/glacier/glacier/ices/74298.rs:12:1
   |
12 | impl Y for X<i32> {}
   | ^^^^^^^^^^^^^^^^^
   |
note: type alias impl trait defined here
  --> /home/runner/work/glacier/glacier/ices/74298.rs:3:13
   |
3  | type X<T> = impl Sized;
   |             ^^^^^^^^^^

error: aborting due to 2 previous errors

==============
@Alexendoo Alexendoo merged commit d74b130 into master Sep 21, 2020
@Alexendoo Alexendoo deleted the autofix/ices/74298.rs branch September 21, 2020 12:24
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