Skip to content

Document the behavior of creating empty subslice at end of slice #60783

New issue

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

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

Already on GitHub? # to your account

Closed
sunfishcode opened this issue May 13, 2019 · 0 comments · Fixed by #131383
Closed

Document the behavior of creating empty subslice at end of slice #60783

sunfishcode opened this issue May 13, 2019 · 0 comments · Fixed by #131383
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@sunfishcode
Copy link
Member

sunfishcode commented May 13, 2019

Creating an empty subslice at the end of a slice succeeds: &slice[slice.len()..], however this doesn't appear to be documented in the slice documentation.

From some searching, I found efforts to document this behavior, including #32183, however this documentation doesn't seem to appear in slice's doc page or the index function's doc page.

The place I originally looked was on slice's get function.

This might be related to rustdoc omitting some documentation, however #31821 (comment) says to file specific issues, so here's a specific issue :-).

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels May 13, 2019
@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 29, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 9, 2024
…_slice_slicing_at_ends, r=cuviper

Add docs about slicing slices at the ends

Closes rust-lang#60783
@bors bors closed this as completed in cb267b4 Oct 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 10, 2024
Rollup merge of rust-lang#131383 - AngelicosPhosphoros:better_doc_for_slice_slicing_at_ends, r=cuviper

Add docs about slicing slices at the ends

Closes rust-lang#60783
rust-cloud-vms bot pushed a commit to liwagu/rust that referenced this issue Oct 10, 2024
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Oct 17, 2024
…icing_at_ends, r=cuviper

Add docs about slicing slices at the ends

Closes rust-lang/rust#60783
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants