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

Array and indexing grammar #133

Merged
merged 2 commits into from
Dec 1, 2017
Merged

Conversation

brauliobz
Copy link
Contributor

@brauliobz brauliobz commented Oct 14, 2017

Also, add the information that the indexing expressions can be made available in other types by implementing Index and IndexMut.

Part of #84.

Copy link
Contributor

@Havvy Havvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing, but otherwise looks good.

@@ -50,4 +61,14 @@ let y = (["a", "b"])[n]; // panics

let arr = ["a", "b"];
arr[10]; // panics

# let b = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we show that arr[10] panics, we should probably show this array being defined or else somebody may wonder why b[1][2] doesn't panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also moved it up so it isn't grouped alongside the panic examples.

@Havvy Havvy merged commit 11d7dae into rust-lang:master Dec 1, 2017
@Havvy
Copy link
Contributor

Havvy commented Dec 1, 2017

💟 Thanks!

@brauliobz brauliobz deleted the grammar_expr_array branch March 10, 2018 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants