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

ices/68656.sh: fixed with errors #411

Merged
merged 1 commit into from
Jun 22, 2020
Merged

ices/68656.sh: fixed with errors #411

merged 1 commit into from
Jun 22, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#68656

#!/bin/bash

rustc -C debuginfo=2 - << END
#![feature(generic_associated_types)]

trait UnsafeCopy<T: Copy>  {
    type Item<'a>: std::ops::Deref<Target = T>;

    fn bug<'a>(item: &Self::Item<'a>) -> () {
        let x: T = **item;
    }
}

impl <T: Copy> UnsafeCopy<T> for T {
    type Item<'a> = T;
}

fn main() {
    <&'static str>::bug(&"");
}

END
=== stdout ===
=== stderr ===
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <anon>:1:12
  |
1 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information

error[E0277]: the trait bound `T: std::ops::Deref` is not satisfied
  --> <anon>:12:5
   |
4  |     type Item<'a>: std::ops::Deref<Target = T>;
   |     ------------------------------------------- required by `UnsafeCopy::Item`
...
12 |     type Item<'a> = T;
   |     ^^^^^^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `T`
   |
help: consider further restricting this bound
   |
11 | impl <T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
   |               ^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <anon>:1:12
  |
1 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44265 <rust-lang/rust#44265> for more information

error[E0277]: the trait bound `T: std::ops::Deref` is not satisfied
  --> <anon>:12:5
   |
4  |     type Item<'a>: std::ops::Deref<Target = T>;
   |     ------------------------------------------- required by `UnsafeCopy::Item`
...
12 |     type Item<'a> = T;
   |     ^^^^^^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `T`
   |
help: consider further restricting this bound
   |
11 | impl <T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
   |               ^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit f196df6 into master Jun 22, 2020
@JohnTitor JohnTitor deleted the autofix/ices/68656.sh branch June 22, 2020 12:18
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