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

Document a few undocumented methos in Vector #9381

Merged
merged 1 commit into from
Sep 21, 2013
Merged

Conversation

luisbg
Copy link
Contributor

@luisbg luisbg commented Sep 21, 2013

Closes #9379

@@ -1988,11 +1992,13 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
}

#[inline]
/// Returns an unsafe mutable pointer to the element in index
unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T {
Copy link
Member

Choose a reason for hiding this comment

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

I prefer the name raw pointer, but anyway, the point of this function is to index the vector without boundary checking, and that's the unsafe part of it.

bors added a commit that referenced this pull request Sep 21, 2013
@bors bors closed this Sep 21, 2013
@bors bors merged commit e98bd9b into rust-lang:master Sep 21, 2013
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 29, 2022
Don't lint `needless_return` if `return` has attrs

Fixes rust-lang#9361

The lint used to have a mechanic to allow `cfg`-attrs on naked `return`-statements. This was well-intentioned, yet we can have any kind of attribute, e.g. `allow`, `expect` or even custom `derive`. So the mechanic was simply removed. We now never lint on a naked `return`-statement that has attributes on it.

Turns out that the ui-test had a Catch22 in it: In `check_expect()` the `#[expect(clippy::needless_return)]` is an attribute on the `return` statement that can and will be rustfixed away without side effects. But any other attribute would also have been removed, which is what rust-lang#9361 is about. The test proved the wrong thing. Removed the test, the body is tested elsewhere as well.

changelog: Ignore [`needless_return`] on `return`s with attrs
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.

std::vec::ImmutableVector needs documentation
4 participants