diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-22 13:05:43 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-22 13:05:43 +0000 |
| commit | e6a22aa48e088ef7c975d20d51e938b6b3205569 (patch) | |
| tree | 1601e687e6bb66ced46b760597f311a4fe1e4ee5 /book | |
| parent | fecbe85381d45f813e464b3e3a7ae86244936f7e (diff) | |
| parent | cfc97488db01ad09ebb62ab5ed4ea9b8b6f35912 (diff) | |
Merge #479
479: book: detail import resolving for 0.6 migration r=korken89 a=tmplt
That is, answering the question of why imports are no longer resolving during compilation.
Co-authored-by: Viktor Sonesten <v@tmplt.dev>
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/migration/migration_v5.md | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/book/en/src/migration/migration_v5.md b/book/en/src/migration/migration_v5.md index 04cb20e..505a8b6 100644 --- a/book/en/src/migration/migration_v5.md +++ b/book/en/src/migration/migration_v5.md @@ -30,7 +30,46 @@ mod app { Now that a regular Rust module is used it means it is possible to have custom user code within that module. -Additionally, it means that `use`-statements for resources etc may be required. +Additionally, it means that `use`-statements for resources used in user +code must be moved inside `mod app`, or be referred to with `super`. For +example, change: + +```rust +use some_crate::some_func; + +#[rtic::app(/* .. */)] +const APP: () = { + fn func() { + some_crate::some_func(); + } +}; +``` + +into + +```rust +#[rtic::app(/* .. */)] +mod app { + use some_crate::some_func; + + fn func() { + some_crate::some_func(); + } +} +``` + +or + +```rust +use some_crate::some_func; + +#[rtic::app(/* .. */)] +mod app { + fn func() { + super::some_crate::some_func(); + } +}; +``` ## Move Dispatchers from `extern "C"` to app arguments. |
