From 8f988bd92cf7d6d3e9be5310c18e472ba297e247 Mon Sep 17 00:00:00 2001 From: Ohad Ravid Date: Wed, 23 Oct 2019 22:22:13 +0200 Subject: Coherence should allow fundamental types to impl traits --- .../impl-foreign-for-locally-defined-fundamental.rs | 16 ++++++++++++++++ ...l-foreign-for-locally-defined-fundamental[foreign].rs | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs create mode 100644 src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs (limited to 'src/test/ui/coherence') diff --git a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs new file mode 100644 index 00000000000..d461b5abd60 --- /dev/null +++ b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs @@ -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() {} diff --git a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs new file mode 100644 index 00000000000..0a3d9e2e0e8 --- /dev/null +++ b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs @@ -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); + +impl Remote for MyBox {} + +fn main() {} -- cgit 1.4.1-3-g733a5