Skip to content

core::vec is missing methods for mutable slices #5984

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
brson opened this issue Apr 21, 2013 · 4 comments
Closed

core::vec is missing methods for mutable slices #5984

brson opened this issue Apr 21, 2013 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Apr 21, 2013

There just aren't any implementations on &mut [T] at all. mut_slice is an obvious one. also swap. I could also use a method for copying elements from one &[T] to an &mut [T].

@ntrel
Copy link

ntrel commented Apr 26, 2013

@brson
Copy link
Contributor Author

brson commented May 10, 2013

@ntrel that's a function though, so must be used like vec::mut_slice(foo, ...), when I would prefer to use it like foo.mut_slice(...)

@brson
Copy link
Contributor Author

brson commented May 12, 2013

Nominating backward compat

@graydon
Copy link
Contributor

graydon commented May 16, 2013

accepted for backwards-compatible milestone

bors added a commit that referenced this issue May 29, 2013
Fix #5984.
Resolve the problem which exists in #6780.
@bors bors closed this as completed in e0d6486 Jun 13, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 10, 2020
or_fn_call: ignore nullary associated const fns

The fix in rust-lang#5889 was missing associated functions.

changelog: Ignore also `const fn` methods in [`or_fun_call`]

Fixes rust-lang#5693
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 9, 2020
…thiaskrgr

Revert: or_fun_call should lint calls to `const fn`s with no args

The changes in rust-lang#5889 and rust-lang#5984 were done under the incorrect assumption that a `const fn` with no args was guaranteed to be evaluated at compile time.  A `const fn` is only guaranteed to be evaluated at compile time if it's inside a const context (the initializer of a `const` or a `static`).

See this [zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Common.20misconception.3A.20.60const.20fn.60.20and.20its.20effect.20on.20codegen/near/208059113) for more details on this common misconception.

Given that none of the linted methods by `or_fun_call` can be called in const contexts, the lint should make no exceptions.

changelog: [`or_fun_call`] lints again calls to `const fn` with no args
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 9, 2020
Add changelog for 1.48 beta

[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_1_48/CHANGELOG.md)

I've not added the PRs fixing `same_item_push` because those were backported, namely:
* [rust-lang#5908](rust-lang/rust-clippy#5908)
* [rust-lang#5997](rust-lang/rust-clippy#5997)
* [rust-lang#6016](rust-lang/rust-clippy#6016)

The following PR was reverted, so I've ignored it too:
* [rust-lang#5984](rust-lang/rust-clippy#5984)

~~Also, I took the liberty of adding a "Thanks" section, naming all the contributors to this release. I think they deserve visibility in the changelog. Please tell me if we want to add this or maybe it's redundant given we link to the PRs?~~

changelog: none

r? `@flip1995`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants