forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#59978 - ollie27:rustdoc_default, r=QuietMis…
…dreavus rustdoc: Remove default keyword from re-exported trait methods Fixes rust-lang#59977 r? @QuietMisdreavus As this fixes a stable to beta regression, could it be backported?
- Loading branch information
Showing
5 changed files
with
67 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#![feature(specialization)] | ||
|
||
// @has default_trait_method/trait.Item.html | ||
// @has - '//*[@id="tymethod.foo"]' 'fn foo()' | ||
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' | ||
// @has - '//*[@id="tymethod.bar"]' 'fn bar()' | ||
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' | ||
// @has - '//*[@id="method.baz"]' 'fn baz()' | ||
// @!has - '//*[@id="method.baz"]' 'default fn baz()' | ||
pub trait Item { | ||
fn foo(); | ||
fn bar(); | ||
fn baz() {} | ||
} | ||
|
||
// @has default_trait_method/struct.Foo.html | ||
// @has - '//*[@id="method.foo"]' 'default fn foo()' | ||
// @has - '//*[@id="method.bar"]' 'fn bar()' | ||
// @!has - '//*[@id="method.bar"]' 'default fn bar()' | ||
// @has - '//*[@id="method.baz"]' 'fn baz()' | ||
// @!has - '//*[@id="method.baz"]' 'default fn baz()' | ||
pub struct Foo; | ||
impl Item for Foo { | ||
default fn foo() {} | ||
fn bar() {} | ||
} |
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/test/rustdoc/inline_cross/auxiliary/default-trait-method.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(specialization)] | ||
|
||
#![crate_name = "foo"] | ||
|
||
pub trait Item { | ||
fn foo(); | ||
fn bar(); | ||
fn baz() {} | ||
} | ||
|
||
pub struct Foo; | ||
|
||
impl Item for Foo { | ||
default fn foo() {} | ||
fn bar() {} | ||
} |
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 @@ | ||
// aux-build:default-trait-method.rs | ||
|
||
extern crate foo; | ||
|
||
// @has default_trait_method/trait.Item.html | ||
// @has - '//*[@id="tymethod.foo"]' 'fn foo()' | ||
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' | ||
// @has - '//*[@id="tymethod.bar"]' 'fn bar()' | ||
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' | ||
// @has - '//*[@id="method.baz"]' 'fn baz()' | ||
// @!has - '//*[@id="method.baz"]' 'default fn baz()' | ||
pub use foo::Item; | ||
|
||
// @has default_trait_method/struct.Foo.html | ||
// @has - '//*[@id="method.foo"]' 'default fn foo()' | ||
// @has - '//*[@id="method.bar"]' 'fn bar()' | ||
// @!has - '//*[@id="method.bar"]' 'default fn bar()' | ||
// @has - '//*[@id="method.baz"]' 'fn baz()' | ||
// @!has - '//*[@id="method.baz"]' 'default fn baz()' | ||
pub use foo::Foo; |