-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add use statements support to #[project] attribute
- Loading branch information
Showing
7 changed files
with
165 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[pin_project] | ||
struct A { | ||
field: u8, | ||
} | ||
|
||
pub mod b { | ||
use pin_project::project; | ||
|
||
#[project] | ||
pub use crate::A; | ||
} | ||
|
||
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,11 @@ | ||
error[E0365]: `__AProjection` is private, and cannot be re-exported | ||
--> $DIR/use-public.rs:14:13 | ||
| | ||
14 | pub use crate::A; | ||
| ^^^^^^^^ re-export of private `__AProjection` | ||
| | ||
= note: consider declaring type or module `__AProjection` with `pub` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0365`. |
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 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[pin_project] | ||
struct A { | ||
field: u8, | ||
} | ||
|
||
mod b { | ||
use pin_project::project; | ||
|
||
#[project] | ||
use crate::A as B; //~ ERROR #[project] attribute may not be used on renamed imports | ||
#[project] | ||
use crate::*; //~ ERROR #[project] attribute may not be used on glob imports | ||
} | ||
|
||
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,14 @@ | ||
error: #[project] attribute may not be used on renamed imports | ||
--> $DIR/use.rs:14:16 | ||
| | ||
14 | use crate::A as B; //~ ERROR #[project] attribute may not be used on renamed imports | ||
| ^^^^^^ | ||
|
||
error: #[project] attribute may not be used on glob imports | ||
--> $DIR/use.rs:16:16 | ||
| | ||
16 | use crate::*; //~ ERROR #[project] attribute may not be used on glob imports | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|