mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Add transmutability test to cover for superseded PR
This commit is contained in:
19
tests/ui/transmutability/coherence.next.stderr
Normal file
19
tests/ui/transmutability/coherence.next.stderr
Normal file
@@ -0,0 +1,19 @@
|
||||
error[E0747]: type provided when a constant was expected
|
||||
--> $DIR/coherence.rs:10:37
|
||||
|
|
||||
LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
|
||||
| ^^
|
||||
|
||||
error[E0119]: conflicting implementations of trait `OpaqueTrait` for type `&_`
|
||||
--> $DIR/coherence.rs:13:1
|
||||
|
|
||||
LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
|
||||
| ---------------------------------------------------------- first implementation here
|
||||
...
|
||||
LL | impl<T> OpaqueTrait for &T where T: OpaqueTrait {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0119, E0747.
|
||||
For more information about an error, try `rustc --explain E0119`.
|
||||
19
tests/ui/transmutability/coherence.old.stderr
Normal file
19
tests/ui/transmutability/coherence.old.stderr
Normal file
@@ -0,0 +1,19 @@
|
||||
error[E0747]: type provided when a constant was expected
|
||||
--> $DIR/coherence.rs:10:37
|
||||
|
|
||||
LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
|
||||
| ^^
|
||||
|
||||
error[E0119]: conflicting implementations of trait `OpaqueTrait` for type `&_`
|
||||
--> $DIR/coherence.rs:13:1
|
||||
|
|
||||
LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
|
||||
| ---------------------------------------------------------- first implementation here
|
||||
...
|
||||
LL | impl<T> OpaqueTrait for &T where T: OpaqueTrait {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0119, E0747.
|
||||
For more information about an error, try `rustc --explain E0119`.
|
||||
16
tests/ui/transmutability/coherence.rs
Normal file
16
tests/ui/transmutability/coherence.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
//! Regression test for <https://github.com/rust-lang/rust/pull/149228>
|
||||
|
||||
//@ revisions: old next
|
||||
//@ ignore-compare-mode-next-solver (explicit revisions)
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
|
||||
#![feature(transmutability)]
|
||||
trait OpaqueTrait {}
|
||||
|
||||
impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
|
||||
//~^ ERROR: type provided when a constant was expected
|
||||
|
||||
impl<T> OpaqueTrait for &T where T: OpaqueTrait {}
|
||||
//~^ ERROR: conflicting implementations of trait `OpaqueTrait` for type `&_`
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user