-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from dtolnay/impl
Explicitly requesting an instantiation
- Loading branch information
Showing
17 changed files
with
176 additions
and
17 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
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
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
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
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
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
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
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
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
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,10 @@ | ||
#[cxx::bridge] | ||
mod ffi { | ||
struct S { | ||
x: u8, | ||
} | ||
|
||
impl fn() -> &S {} | ||
} | ||
|
||
fn main() {} |
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,5 @@ | ||
error: unsupported Self type of explicit impl | ||
--> $DIR/bad_explicit_impl.rs:7:5 | ||
| | ||
7 | impl fn() -> &S {} | ||
| ^^^^^^^^^^^^^^^^^^ |
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,10 @@ | ||
#[cxx::bridge] | ||
mod ffi { | ||
struct S { | ||
x: u8, | ||
} | ||
|
||
impl UniquePtrTarget for S {} | ||
} | ||
|
||
fn main() {} |
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,5 @@ | ||
error: unexpected impl, expected something like `impl UniquePtr<T> {}` | ||
--> $DIR/impl_trait_for_type.rs:7:10 | ||
| | ||
7 | impl UniquePtrTarget for S {} | ||
| ^^^^^^^^^^^^^^^^^^^^^ |
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,12 @@ | ||
#[cxx::bridge] | ||
mod ffi { | ||
struct S { | ||
x: u8, | ||
} | ||
|
||
impl UniquePtr<S> { | ||
fn new() -> Self; | ||
} | ||
} | ||
|
||
fn main() {} |
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,8 @@ | ||
error: expected an empty impl block | ||
--> $DIR/nonempty_impl_block.rs:7:23 | ||
| | ||
7 | impl UniquePtr<S> { | ||
| _______________________^ | ||
8 | | fn new() -> Self; | ||
9 | | } | ||
| |_____^ |
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,19 @@ | ||
#[cxx::bridge] | ||
mod here { | ||
extern "C" { | ||
type C; | ||
} | ||
|
||
impl UniquePtr<C> {} | ||
} | ||
|
||
#[cxx::bridge] | ||
mod there { | ||
extern "C" { | ||
type C = crate::here::C; | ||
} | ||
|
||
impl UniquePtr<C> {} | ||
} | ||
|
||
fn main() {} |
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,10 @@ | ||
error[E0119]: conflicting implementations of trait `cxx::private::UniquePtrTarget` for type `here::C`: | ||
--> $DIR/unique_ptr_twice.rs:10:1 | ||
| | ||
1 | #[cxx::bridge] | ||
| -------------- first implementation here | ||
... | ||
10 | #[cxx::bridge] | ||
| ^^^^^^^^^^^^^^ conflicting implementation for `here::C` | ||
| | ||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) |