Skip to content

Commit 612ef5f

Browse files
committed
add new tests for re_rebalance_coherence
1 parent eb48d6b commit 612ef5f

5 files changed

+62
-14
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(re_rebalance_coherence)]
2+
3+
// run-pass
4+
// compile-flags:--crate-name=test
5+
// aux-build:coherence_lib.rs
6+
7+
extern crate coherence_lib as lib;
8+
use lib::*;
9+
use std::rc::Rc;
10+
11+
struct Local;
12+
impl<T> Remote2<Rc<T>, Local> for usize { }
13+
14+
fn main() {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#![feature(re_rebalance_coherence)]
2+
3+
// compile-flags:--crate-name=test
4+
// aux-build:coherence_lib.rs
5+
// run-pass
6+
7+
extern crate coherence_lib as lib;
8+
use lib::*;
9+
use std::rc::Rc;
10+
11+
struct Local;
12+
13+
impl<T> Remote1<Local> for Box<T> {
14+
// FIXME(#64412) -- this is expected to error
15+
}
16+
17+
impl<T> Remote1<Local> for &T {
18+
// FIXME(#64412) -- this is expected to error
19+
}
20+
21+
fn main() {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(re_rebalance_coherence)]
2+
3+
// compile-flags:--crate-name=test
4+
// aux-build:coherence_lib.rs
5+
6+
extern crate coherence_lib as lib;
7+
use lib::*;
8+
use std::rc::Rc;
9+
10+
struct Local;
11+
12+
impl<T> Remote1<Local> for T {
13+
//~^ ERROR type parameter `T` must be used as the type parameter for some local type
14+
}
15+
16+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
2+
--> $DIR/impl[t]-foreign[local]-for-t.rs:12:1
3+
|
4+
LL | impl<T> Remote1<Local> for T {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
6+
|
7+
= note: only traits defined in the current crate can be implemented for a type parameter
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0210`.

src/test/ui/coherence/re-rebalance-coherence-rpass.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)