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

ices/99662.sh: fixed with errors #1399

Merged
merged 1 commit into from
Aug 24, 2022
Merged

ices/99662.sh: fixed with errors #1399

merged 1 commit into from
Aug 24, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#99662

#!/bin/bash

rustc "-Zcrate-attr=feature(with_negative_coherence)" - <<'EOF'

#![feature(negative_impls)]

// FIXME: this should compile

trait MyPredicate<'a> {}
impl<'a, T> !MyPredicate<'a> for &T where T: 'a {}
trait MyTrait<'a> {}
impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
impl<'a, T> MyTrait<'a> for &'a T {}
//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`

fn main() {}

EOF

=== stdout ===
=== stderr ===
error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_`
  --> <anon>:10:1
   |
9  | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
   | ---------------------------------------------- first implementation here
10 | impl<'a, T> MyTrait<'a> for &'a T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_`
  --> <anon>:10:1
   |
9  | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
   | ---------------------------------------------- first implementation here
10 | impl<'a, T> MyTrait<'a> for &'a T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0119`.
==============
@Alexendoo Alexendoo merged commit ed7d622 into master Aug 24, 2022
@Alexendoo Alexendoo deleted the autofix/ices/99662.sh branch August 24, 2022 12:10
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