-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #112853 - GuillaumeGomez:type_alias_type, r=oli-obk
Add `lazy_type_alias` feature gate Add the `type_alias_type` to be able to have the weak alias used without restrictions. Part of #112792. cc `@compiler-errors` r? `@oli-obk`
- Loading branch information
Showing
8 changed files
with
68 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// aux-build:alias-reexport.rs | ||
// aux-build:alias-reexport2.rs | ||
|
||
#![crate_name = "foo"] | ||
#![feature(lazy_type_alias)] | ||
|
||
extern crate alias_reexport2; | ||
|
||
// @has 'foo/reexport/fn.foo.html' | ||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported' | ||
// @has 'foo/reexport/fn.foo2.html' | ||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>' | ||
// @has 'foo/reexport/type.Reexported.html' | ||
// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;' | ||
#[doc(inline)] | ||
pub use alias_reexport2 as reexport; |
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 @@ | ||
// gate-test-lazy_type_alias | ||
// aux-build:alias-reexport.rs | ||
|
||
#![crate_name = "foo"] | ||
#![feature(lazy_type_alias)] | ||
|
||
extern crate alias_reexport; | ||
|
||
use alias_reexport::Reexported; | ||
|
||
// @has 'foo/fn.foo.html' | ||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported' | ||
pub fn foo() -> Reexported { 0 } | ||
// @has 'foo/fn.foo2.html' | ||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>' | ||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) } |
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,3 @@ | ||
#![feature(lazy_type_alias)] | ||
|
||
pub type Reexported = u8; |
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 @@ | ||
#![feature(lazy_type_alias)] | ||
|
||
extern crate alias_reexport; | ||
|
||
pub use alias_reexport::Reexported; | ||
|
||
// @has 'foo/fn.foo.html' | ||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported' | ||
pub fn foo() -> Reexported { 0 } | ||
// @has 'foo/fn.foo2.html' | ||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>' | ||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) } |