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

rename std::vec -> std::slice #12772

Merged
merged 1 commit into from
Mar 20, 2014
Merged

rename std::vec -> std::slice #12772

merged 1 commit into from
Mar 20, 2014

Conversation

thestinger
Copy link
Contributor

Closes #12702

@alexcrichton
Copy link
Member

I'd like to discuss this before merging so we can ensure that this is the direction that we want to go in.

@huonw
Copy link
Member

huonw commented Mar 9, 2014

I'm in favour of this. Have std::slice specific to the slices &[T] and &mut [T] and have other vector-like types (e.g. Vec) in their own modules.

@alexcrichton
Copy link
Member

I would imagine that an import from std::slice would almost never be necessary, especially functions like slice::from_fn and friends (which need to be removed).

@nikomatsakis
Copy link
Contributor

At first I expected the module this PR calls slice to be called array, but I think strcat convinced me that slice is a good name for any kind of "pointer, length" pair.

@emberian
Copy link
Member

👍

bors added a commit that referenced this pull request Mar 20, 2014
@bors bors closed this Mar 20, 2014
@bors bors merged commit ce62032 into rust-lang:master Mar 20, 2014
@thestinger thestinger deleted the slice branch March 20, 2014 10:53
Kroisse added a commit to Kroisse/rust-http that referenced this pull request Mar 22, 2014
related issues of mozilla/rust:
- rust-lang/rust#12772  rename std::vec -> std::slice
- rust-lang/rust#13028  rename std::vec_ng -> std::vec
- rust-lang/rust@0305ed5d22e4  std: Add Vec to the prelude
- rust-lang/rust#12907  std: Rename {push,read}_bytes to {push,read}_exact
Kroisse added a commit to Kroisse/rust-http that referenced this pull request Mar 22, 2014
related issues of mozilla/rust:
- rust-lang/rust#12772  rename std::vec -> std::slice
- rust-lang/rust#13028  rename std::vec_ng -> std::vec
- rust-lang/rust@0305ed5d22e4  std: Add Vec to the prelude
- rust-lang/rust#12907  std: Rename {push,read}_bytes to {push,read}_exact
Kroisse added a commit to Kroisse/rust-mustache that referenced this pull request Mar 22, 2014
related issues of mozilla/rust:
- rust-lang/rust#12772  rename std::vec -> std::slice
- rust-lang/rust#13028  rename std::vec_ng -> std::vec
- rust-lang/rust@0305ed5  std: Add Vec to the prelude
- rust-lang/rust#12935  Disallow trailing parentheses for nullary enum variants
Kroisse added a commit to Kroisse/rust-http that referenced this pull request Mar 30, 2014
related issues of mozilla/rust:
- rust-lang/rust@0305ed5d22e4  std: Add Vec to the prelude

already fixed in chris-morgan#69:
- rust-lang/rust#12772  rename std::vec -> std::slice
- rust-lang/rust#13028  rename std::vec_ng -> std::vec
- rust-lang/rust#12907  std: Rename {push,read}_bytes to {push,read}_exact
am0d pushed a commit to am0d/rust-http that referenced this pull request Apr 4, 2014
related issues of mozilla/rust:
- rust-lang/rust@0305ed5d22e4  std: Add Vec to the prelude

already fixed in chris-morgan#69:
- rust-lang/rust#12772  rename std::vec -> std::slice
- rust-lang/rust#13028  rename std::vec_ng -> std::vec
- rust-lang/rust#12907  std: Rename {push,read}_bytes to {push,read}_exact
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
internal: Remove allocation in DefCollector::reseed_with_unresolved_attribute
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 25, 2024
…, r=y21

add lint for recreation of an entire struct

This lint makes Clippy warn about situations where an owned struct is
essentially recreated by moving all its fields into a new instance of
the struct. The lint is not machine-applicable because the source
struct may have been partially moved.

This lint originated in something I spotted during peer review. While
working on their branch a colleague ended up with a commit where a
function returned a struct that 1:1 replicated one of its owned inputs
from its members. Initially I suspected they hadn’t run their code
through Clippy but AFAICS there is no lint for this situation yet.

changelog: new lint: [`redundant_owned_struct_recreation`]

### New lint checklist

- \[+] Followed [lint naming conventions][lint_naming]
- \[+] Added passing UI tests (including committed `.stderr` file)
- \[+] `cargo test` passes locally
- \[+] Executed `cargo dev update_lints`
- \[+] Added lint documentation
- \[+] Run `cargo dev fmt`
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.

rename std::vec -> std::slice
6 participants