-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Fixes #6673. The module visibility check has been broken for some time. In some cases, like the one described in #6673, this has resulted in modules being mistakenly regarded as inaccessible, even though they ought to be accessible. In other cases, private modules were mistakenly regarded as accessible. For examples see the updated tests in the PR. The check has now been fixed, and all tests have been updated accordingly. This bugfix can be regarded as a breaking change, because some modules that were deemed accessible before may now be deemed inaccessible and will require the addition of a `pub` keyword in front of the module declaration. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Joshua Batty <[email protected]> Co-authored-by: IGI-111 <[email protected]>
- Loading branch information
1 parent
3b07f49
commit 2b6fd7a
Showing
26 changed files
with
140 additions
and
121 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
24 changes: 12 additions & 12 deletions
24
test/src/e2e_vm_tests/test_programs/should_fail/language/reexport/aliases/src/main.sw
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
6 changes: 3 additions & 3 deletions
6
...test_programs/should_fail/language/reexport/multiple_imports_of_same_reexport/src/main.sw
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
24 changes: 12 additions & 12 deletions
24
...s/test_programs/should_fail/language/reexport/shadowing_in_reexporting_module/src/main.sw
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
8 changes: 4 additions & 4 deletions
8
...c/e2e_vm_tests/test_programs/should_fail/language/reexport/simple_glob_import/src/main.sw
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
10 changes: 6 additions & 4 deletions
10
...c/e2e_vm_tests/test_programs/should_fail/language/reexport/simple_item_import/src/main.sw
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
2 changes: 1 addition & 1 deletion
2
test/src/e2e_vm_tests/test_programs/should_pass/dca/unused_enum/src/main.sw
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
script; | ||
|
||
mod r#enum; | ||
pub mod r#enum; | ||
mod utils; | ||
|
||
fn main() { | ||
|
2 changes: 1 addition & 1 deletion
2
test/src/e2e_vm_tests/test_programs/should_pass/dca/unused_trait/src/main.sw
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
script; | ||
|
||
mod r#trait; | ||
pub mod r#trait; | ||
mod utils; | ||
|
||
use r#trait::Trait; | ||
|
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
2 changes: 1 addition & 1 deletion
2
...e2e_vm_tests/test_programs/should_pass/language/import_method_from_other_file/src/main.sw
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
script; | ||
|
||
mod context; | ||
mod asset; | ||
pub mod asset; | ||
mod utils; | ||
|
||
use context::Context; | ||
|
2 changes: 1 addition & 1 deletion
2
...e_vm_tests/test_programs/should_pass/language/import_with_different_callpaths/src/main.sw
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
script; | ||
|
||
mod data_structures; | ||
pub mod data_structures; | ||
mod eq_impls; | ||
|
||
use eq_impls::*; | ||
|
2 changes: 1 addition & 1 deletion
2
...c/e2e_vm_tests/test_programs/should_pass/language/match_expressions_constants/src/main.sw
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
script; | ||
|
||
mod lib; | ||
pub mod lib; | ||
mod top_level; | ||
mod in_structs; | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
test/src/e2e_vm_tests/test_programs/should_pass/language/module_dep/src/lib.sw
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
library; | ||
|
||
mod a; | ||
mod b; | ||
pub mod a; | ||
pub mod b; | ||
|
||
fn main() -> u32 { | ||
1 | ||
|
4 changes: 2 additions & 2 deletions
4
test/src/e2e_vm_tests/test_programs/should_pass/language/module_dep_multiple/src/lib.sw
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
library; | ||
|
||
mod c; | ||
mod a; | ||
mod b; | ||
pub mod a; | ||
pub mod b; | ||
|
||
fn main() -> u32 { | ||
1 | ||
|
20 changes: 10 additions & 10 deletions
20
test/src/e2e_vm_tests/test_programs/should_pass/language/reexport/aliases/src/main.sw
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
24 changes: 12 additions & 12 deletions
24
...test_programs/should_pass/language/reexport/multiple_imports_of_same_reexport/src/main.sw
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
20 changes: 10 additions & 10 deletions
20
test/src/e2e_vm_tests/test_programs/should_pass/language/reexport/reexport_paths/src/main.sw
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
24 changes: 12 additions & 12 deletions
24
...s/test_programs/should_pass/language/reexport/shadowing_in_reexporting_module/src/main.sw
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
8 changes: 4 additions & 4 deletions
8
...c/e2e_vm_tests/test_programs/should_pass/language/reexport/simple_glob_import/src/main.sw
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
8 changes: 4 additions & 4 deletions
8
...c/e2e_vm_tests/test_programs/should_pass/language/reexport/simple_item_import/src/main.sw
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
12 changes: 6 additions & 6 deletions
12
test/src/e2e_vm_tests/test_programs/should_pass/language/reexport/visibility/src/main.sw
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.