-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91e5c3f
commit ca68cf0
Showing
16 changed files
with
140 additions
and
73 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
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,15 @@ | ||
error[E0277]: the trait bound `dyn NotObject: NotObject` is not satisfied | ||
--> $DIR/deny-builtin-object-impl.rs:18:23 | ||
| | ||
LL | test_not_object::<dyn NotObject>(); | ||
| ^^^^^^^^^^^^^ the trait `NotObject` is not implemented for `dyn NotObject` | ||
| | ||
note: required by a bound in `test_not_object` | ||
--> $DIR/deny-builtin-object-impl.rs:14:23 | ||
| | ||
LL | fn test_not_object<T: NotObject + ?Sized>() {} | ||
| ^^^^^^^^^ required by this bound in `test_not_object` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,15 @@ | ||
error[E0277]: the trait bound `dyn NotObject: NotObject` is not satisfied | ||
--> $DIR/deny-builtin-object-impl.rs:18:23 | ||
| | ||
LL | test_not_object::<dyn NotObject>(); | ||
| ^^^^^^^^^^^^^ the trait `NotObject` is not implemented for `dyn NotObject` | ||
| | ||
note: required by a bound in `test_not_object` | ||
--> $DIR/deny-builtin-object-impl.rs:14:23 | ||
| | ||
LL | fn test_not_object<T: NotObject + ?Sized>() {} | ||
| ^^^^^^^^^ required by this bound in `test_not_object` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,20 @@ | ||
// revisions: current next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
|
||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_deny_explicit_impl(implement_via_object = true)] | ||
trait YesObject {} | ||
|
||
#[rustc_deny_explicit_impl(implement_via_object = false)] | ||
trait NotObject {} | ||
|
||
fn test_yes_object<T: YesObject + ?Sized>() {} | ||
|
||
fn test_not_object<T: NotObject + ?Sized>() {} | ||
|
||
fn main() { | ||
test_yes_object::<dyn YesObject>(); | ||
test_not_object::<dyn NotObject>(); | ||
//~^ ERROR the trait bound `dyn NotObject: NotObject` is not satisfied | ||
} |