-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve: Always resolve visibilities on impl items
- Loading branch information
1 parent
90b957a
commit 914c9aa
Showing
3 changed files
with
46 additions
and
12 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,25 @@ | ||
// Visibilities on impl items expanded from macros are resolved (issue #64705). | ||
|
||
macro_rules! perftools_inline { | ||
($($item:tt)*) => ( | ||
$($item)* | ||
); | ||
} | ||
|
||
mod state { | ||
pub struct RawFloatState; | ||
impl RawFloatState { | ||
perftools_inline! { | ||
pub(super) fn new() {} // OK | ||
} | ||
} | ||
} | ||
|
||
pub struct RawFloatState; | ||
impl RawFloatState { | ||
perftools_inline! { | ||
pub(super) fn new() {} //~ ERROR failed to resolve: there are too many initial `super`s | ||
} | ||
} | ||
|
||
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,9 @@ | ||
error[E0433]: failed to resolve: there are too many initial `super`s. | ||
--> $DIR/impl-items-vis-unresolved.rs:21:13 | ||
| | ||
LL | pub(super) fn new() {} | ||
| ^^^^^ there are too many initial `super`s. | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. |