Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard and core library inline documentation #4830

Merged
merged 42 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ba81361
Vec.sw documentation (#4816)
SwayStar123 Jul 19, 2023
01c693b
Merge branch 'master' into standard-documentation
SwayStar123 Jul 19, 2023
c9aa943
U256 documentation (#4831)
SwayStar123 Jul 19, 2023
ac96b56
U128 documentation (#4833)
SwayStar123 Jul 19, 2023
1b0f4c2
Update all storage inline docs to follow SRC-2 standard (#4836)
bitzoic Jul 20, 2023
b62d604
Token library documentation (#4834)
SwayStar123 Jul 20, 2023
7b8ca4b
Update memory manipulation libs to meet SRC-2 inline docs standard (#…
bitzoic Jul 22, 2023
6520b42
Update assertion and results to meet SRC-2 inline docs standard (#4846)
bitzoic Jul 22, 2023
8a51f03
string documentation (#4835)
SwayStar123 Jul 24, 2023
165c1b6
A-B library documentation (#4848)
SwayStar123 Jul 24, 2023
2dd2072
Updates to storage docs to meet SRC-2 inline docs standard (#4864)
bitzoic Jul 27, 2023
2a4f6fb
Update inline docs of address, contract id, and identity to meet SRC-…
bitzoic Jul 27, 2023
ad23dea
Std-lib external, call_frames, and context inline docs updates to mee…
bitzoic Jul 27, 2023
48cd9dd
copied rust docs to sway (#4880)
SwayStar123 Jul 29, 2023
4ddf194
Input intrinsics (#4891)
SwayStar123 Aug 3, 2023
15abfb4
Update flags and constants docs (#4881)
SwayStar123 Aug 4, 2023
4b86d73
Merge branch 'master' into standard-documentation
bitzoic Aug 4, 2023
03c69a9
Fix merge errors
bitzoic Aug 4, 2023
6e6aa94
tx docs (#4914)
SwayStar123 Aug 4, 2023
43e71cb
Llc outputs error_signals (#4906)
SwayStar123 Aug 5, 2023
3462264
Update std-lib cryptographic functions to meet SRC-2 inline docs stan…
bitzoic Aug 5, 2023
33f17e7
Update sway-lib-core to meet SRC-2 inline docs standard (#4882)
bitzoic Aug 5, 2023
0bcc0f0
Update registers.sw to meet SRC-2 inline docs standard (#4920)
bitzoic Aug 7, 2023
918674d
Merge branch 'master' into standard-documentation
SwayStar123 Aug 7, 2023
feed00e
Update sway-lib-std/src/option.sw
SwayStar123 Aug 8, 2023
a6a86d4
Merge branch 'master' into standard-documentation
SwayStar123 Aug 8, 2023
e905f34
add back doc line
SwayStar123 Aug 8, 2023
17d6cf8
change panic to revert
SwayStar123 Aug 10, 2023
bfa4346
Merge branch 'master' into standard-documentation
SwayStar123 Aug 10, 2023
b6501c3
Updates to sway-lib-core based on PR review comments
bitzoic Aug 14, 2023
15a9494
More core changes
bitzoic Aug 14, 2023
c089291
Update sway-lib-core based on PR review comments
bitzoic Aug 14, 2023
47b8185
Merge branch 'master' into standard-documentation
bitzoic Aug 15, 2023
38d3ebf
Fix LSP CI
bitzoic Aug 15, 2023
2e2a4a2
Fix LSP CI 2
bitzoic Aug 15, 2023
b07a4c7
Fix LSP CI 3
bitzoic Aug 15, 2023
d97f650
Final PR review comments
bitzoic Aug 16, 2023
1cc37fb
Merge branch 'master' into standard-documentation
bitzoic Aug 16, 2023
28e7464
Merge branch 'master' into standard-documentation
SwayStar123 Aug 16, 2023
5108a4e
Merge branch 'master' into standard-documentation
JoshuaBatty Aug 21, 2023
124c184
Merge branch 'master' into standard-documentation
bitzoic Aug 21, 2023
582b764
Merge branch 'master' into standard-documentation
JoshuaBatty Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions sway-lib-core/src/never.sw
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ use ::ops::{Eq, Not, Ord};

/// `Never` represents the type of computations which never resolve to any value at all.
///
/// # Additional Information
///
/// `break`, `continue` and `return` expressions also have type `Never`. For example we are allowed to
/// write:
///
/// ```
/// ```sway
/// let x: Never = {
/// return 123
/// };
Expand All @@ -20,7 +22,7 @@ use ::ops::{Eq, Not, Ord};
///
/// A more realistic usage of `Never` is in this code:
///
/// ```
/// ```sway
/// let num: u32 = match get_a_number() {
/// Some(num) => num,
/// None => break,
Expand All @@ -33,13 +35,24 @@ use ::ops::{Eq, Not, Ord};
///
/// Note that `Never` type coerces into any other type, another example of this would be:
///
/// ```
/// ```sway
/// let x: u32 = {
/// return 123
/// };
/// ```
///
/// Regardless of the type of `x`, the return block of type `Never` will always coerce into `x` type.
///
/// # Examples
///
/// ```sway
/// fn foo() {
/// let num: u64 = match Option::None::<u64> {
/// Some(num) => num,
/// None => return,
/// };
bitzoic marked this conversation as resolved.
Show resolved Hide resolved
/// }
/// ```
pub enum Never {}

impl Not for Never {
Expand Down
Loading