Skip to content

Add example for misaligned elements in subslice_range - #164937

Open
asquared31415 wants to merge 1 commit into
rust-lang:mainfrom
asquared31415:slice_subslice_range_docs
Open

asquared31415 wants to merge 1 commit into
rust-lang:mainfrom
asquared31415:slice_subslice_range_docs

Conversation

@asquared31415

Copy link
Copy Markdown
Contributor

It confused me how it would be possible for subslice to be not aligned to self, because I was only thinking about the alignment of the type T, not whether the resulting indexes would be aligned (which actually depends on the size). Suggested in Zulip.

The related function element_offset has a similar example.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 25, 2026
@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

rustbot has assigned @clarfonthey.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 37 candidates
  • Random selection from 7 candidates

@rust-log-analyzer

This comment has been minimized.

@teor2345

Copy link
Copy Markdown
Member

gcc seems to have failed for unrelated reasons, I restarted the jobs.

@teor2345 teor2345 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

View changes since this review

Comment thread library/core/src/slice/mod.rs Resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 29, 2026
@rustbot

rustbot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the slice_subslice_range_docs branch from 085334c to c075e5e Compare October 29, 2026 17:50
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the slice_subslice_range_docs branch from c075e5e to 747933f Compare October 29, 2026 17:51
@clarfonthey

Copy link
Copy Markdown
Contributor

Thank you!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 747933f has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants