Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new tests for re_rebalance_coherence #64414

Merged
merged 2 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![feature(re_rebalance_coherence)]

// check-pass
// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs

extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;

struct Local;
impl<T> Remote2<Rc<T>, Local> for usize { }

fn main() {}
21 changes: 21 additions & 0 deletions src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#![feature(re_rebalance_coherence)]

// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs
// check-pass

extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;

struct Local;

impl<T> Remote1<Local> for Box<T> {
// FIXME(#64412) -- this is expected to error
}

impl<T> Remote1<Local> for &T {
// FIXME(#64412) -- this is expected to error
}

fn main() {}
16 changes: 16 additions & 0 deletions src/test/ui/coherence/impl[t]-foreign[local]-for-t.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![feature(re_rebalance_coherence)]

// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs

extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;

struct Local;

impl<T> Remote1<Local> for T {
//~^ ERROR type parameter `T` must be used as the type parameter for some local type
}

fn main() {}
11 changes: 11 additions & 0 deletions src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-t.rs:12:1
|
LL | impl<T> Remote1<Local> for T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to previous error

For more information about this error, try `rustc --explain E0210`.
14 changes: 0 additions & 14 deletions src/test/ui/coherence/re-rebalance-coherence-rpass.rs

This file was deleted.