sway/docs/reference
João Matos 92ecf7f4a3
Implement associated consts for traits (#4301)
## Description

This is the last step to getting associated consts to work.

First it refactors the existing const support to use a newly-introduced
`ConstantExpression` instead of relying on `VariableExpression` like
we've been doing previously.

Then it adds IR generation for associated constants and enables the
relevant tests.

[Add ConstantExpression and IR generation
support.](3d2e62598f)

[Update ConstantExpression constant before IR
generation.](4ec7ebe807)

[Add IR generation for associated
consts.](67386a874e)

Then there also some commits adding some new documentation:

[Add traits documentation to the
reference.](afda9026a0)

[Add some documentation about associated consts to the
book.](6845ddc166)

Closes https://github.com/FuelLabs/sway/issues/3797.

## 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).
- [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.
2023-04-05 13:20:17 +00:00
..
src Implement associated consts for traits (#4301) 2023-04-05 13:20:17 +00:00
theme doc: Adding annotations support on highlight.js (#4186) 2023-03-10 15:24:50 +00:00
.gitignore Introduce the Sway reference, a more technical Sway source of documentation. (#2562) 2022-12-08 21:53:09 +00:00
book.toml Introduce the Sway reference, a more technical Sway source of documentation. (#2562) 2022-12-08 21:53:09 +00:00
README.md Introduce the Sway reference, a more technical Sway source of documentation. (#2562) 2022-12-08 21:53:09 +00:00

The Sway Reference

Setup

If you wish contribute to this reference:

  1. Install Rust if it's not installed.

  2. Install mdbook.

    cargo install mdbook
    
  3. To build the book, ensure you are in /sway/sway-book and run:

    mdbook build
    
  4. To serve a hot-reloading instance of the book in your browser, run:

    mdbook serve --open