Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Coherence should allow fundamental types to impl traits
- Loading branch information
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![feature(fundamental)] | ||
#![feature(re_rebalance_coherence)] | ||
|
||
// compile-flags:--crate-name=test | ||
// aux-build:coherence_lib.rs | ||
// check-pass | ||
|
||
extern crate coherence_lib as lib; | ||
use lib::*; | ||
|
||
#[fundamental] | ||
struct Local; | ||
|
||
impl Remote for Local {} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![feature(fundamental)] | ||
#![feature(re_rebalance_coherence)] | ||
|
||
// compile-flags:--crate-name=test | ||
// aux-build:coherence_lib.rs | ||
// check-pass | ||
|
||
extern crate coherence_lib as lib; | ||
use lib::*; | ||
|
||
#[fundamental] | ||
struct MyBox<T>(T); | ||
|
||
impl<T> Remote for MyBox<T> {} | ||
|
||
fn main() {} |