Created
March 24, 2022 13:56
-
-
Save m0rphed/8891921cfd389c1a4276d6fd9e4b5176 to your computer and use it in GitHub Desktop.
Test: evcxr (rust in jupyter) assigning array slice to variable with confusing message
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"ename": "Error", | |
"evalue": "failed to resolve: use of undeclared type `Index`", | |
"output_type": "error", | |
"traceback": [ | |
"failed to resolve: use of undeclared type `Index`" | |
] | |
} | |
], | |
"source": [ | |
"let an_array = [0, 1, 2, 3, 4];\n", | |
"let mid = &an_array[1..4]; // A slice of a: just the elements 1, 2, and 3" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[1, 2, 3]" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"let an_array = [0, 1, 2, 3, 4];\n", | |
"&an_array[1..4]" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Rust", | |
"language": "rust", | |
"name": "rust" | |
}, | |
"language_info": { | |
"codemirror_mode": "rust", | |
"file_extension": ".rs", | |
"mimetype": "text/rust", | |
"name": "Rust", | |
"pygment_lexer": "rust", | |
"version": "" | |
}, | |
"orig_nbformat": 4 | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The second cell is fine though
![image](https://user-images.githubusercontent.com/35064145/159931959-7ac5d81c-554d-4117-bd75-25ac378b98fa.png)