-
Notifications
You must be signed in to change notification settings - Fork 882
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the
default
keyword (#1025)
Adds support for Defaultness on impl methods. Fixes #945
- Loading branch information
1 parent
d19844d
commit b626373
Showing
4 changed files
with
41 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
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,5 @@ | ||
impl Bar { default const unsafe fn foo() { "hi" } } | ||
|
||
impl Baz { default unsafe extern "C" fn foo() { "hi" } } | ||
|
||
impl Foo for Bar { default fn foo() { "hi" } } |
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,17 @@ | ||
impl Bar { | ||
default const unsafe fn foo() { | ||
"hi" | ||
} | ||
} | ||
|
||
impl Baz { | ||
default unsafe extern "C" fn foo() { | ||
"hi" | ||
} | ||
} | ||
|
||
impl Foo for Bar { | ||
default fn foo() { | ||
"hi" | ||
} | ||
} |