Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from SamWilsn/derive-with-module
- Loading branch information
Showing
11 changed files
with
469 additions
and
14 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
compatibility-tests/compile-fail/tests/ui/module-visibility.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,19 @@ | ||
mod inside { | ||
use snafu::prelude::*; | ||
|
||
#[derive(Debug, Snafu)] | ||
#[snafu(module)] | ||
enum Error { | ||
Variant, | ||
} | ||
|
||
fn can_access_in_same_module() { | ||
let _ = error::VariantSnafu; | ||
} | ||
} | ||
|
||
fn cant_access_outside_of_module() { | ||
let _ = inside::error::VariantSnafu; | ||
} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
compatibility-tests/compile-fail/tests/ui/module-visibility.stderr
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 @@ | ||
error[E0603]: module `error` is private | ||
--> $DIR/module-visibility.rs:16:21 | ||
| | ||
16 | let _ = inside::error::VariantSnafu; | ||
| ^^^^^ private module | ||
| | ||
note: the module `error` is defined here | ||
--> $DIR/module-visibility.rs:4:21 | ||
| | ||
4 | #[derive(Debug, Snafu)] | ||
| ^^^^^ | ||
= note: this error originates in the derive macro `Snafu` (in Nightly builds, run with -Z macro-backtrace for more info) |
2 changes: 1 addition & 1 deletion
2
compatibility-tests/compile-fail/tests/ui/structs/attribute-misuse.stderr
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
Oops, something went wrong.