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

ices/43037.rs: fixed with errors #1370

Merged
merged 1 commit into from
Aug 5, 2022
Merged

ices/43037.rs: fixed with errors #1370

merged 1 commit into from
Aug 5, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 5, 2022

Issue: rust-lang/rust#43037

#![crate_type = "lib"]
#![feature(specialization)] // comment this line to get the expected behavior
trait X {}
trait Y: X {}
trait Z { type Assoc: Y; }
struct A<T>(T);

impl<T> Y for T where T: X {}
impl<T: X> Z for A<T> { type Assoc = T; }

// this impl is invalid, but causes an ICE anyway
impl<T> From<<A<T> as Z>::Assoc> for T {}

fn main() {}
=== stdout ===
=== stderr ===
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/43037.rs:2:12
  |
2 | #![feature(specialization)] // comment this line to get the expected behavior
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
  = help: consider using `min_specialization` instead, which is more stable and complete

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
  --> /home/runner/work/glacier/glacier/ices/43037.rs:12:6
   |
12 | impl<T> From<<A<T> as Z>::Assoc> for T {}
   |      ^ type parameter `T` must be used as the type parameter for some local type
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/43037.rs:2:12
  |
2 | #![feature(specialization)] // comment this line to get the expected behavior
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #31844 <rust-lang/rust#31844> for more information
  = help: consider using `min_specialization` instead, which is more stable and complete

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
  --> /home/runner/work/glacier/glacier/ices/43037.rs:12:6
   |
12 | impl<T> From<<A<T> as Z>::Assoc> for T {}
   |      ^ type parameter `T` must be used as the type parameter for some local type
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0210`.
==============
@JohnTitor JohnTitor merged commit 4bc3361 into master Aug 5, 2022
@JohnTitor JohnTitor deleted the autofix/ices/43037.rs branch August 5, 2022 21:37
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