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

Fix for bad get unwrap suggestion #3178

Merged
merged 2 commits into from
Sep 28, 2018
Merged

Conversation

ms2300
Copy link
Contributor

@ms2300 ms2300 commented Sep 13, 2018

Fix for issue outlined in #3006, get() returns either a reference or a slice and therefore "&" should only be added when get is returning a reference ( ie .get(1) instead of .get(0..1) )

@ms2300
Copy link
Contributor Author

ms2300 commented Sep 16, 2018

Access denied in dogfood test?

@flip1995
Copy link
Member

flip1995 commented Sep 16, 2018

That is unrelated: #3118

But it seems this PR produces ICEs in cargo, rls and hyper. Could you look into this? If you have any questions feel free to ask, we're happy to help!

@ms2300 ms2300 force-pushed the bad_unwrap branch 2 times, most recently from ff46c48 to 39cd2b2 Compare September 17, 2018 04:05
@ms2300
Copy link
Contributor Author

ms2300 commented Sep 17, 2018

I should have that issue fixed ... thanks for pointing that out

Edit: I rebased and am now failing tests on different part of code?

@mati865
Copy link
Contributor

mati865 commented Sep 17, 2018

Master fails with the same error(outdated test):

diff of stderr:
 error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`)
   --> $DIR/cast_alignment.rs:15:5
    |
 15 |     (&1u8 as *const u8) as *const u16;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::cast-ptr-alignment` implied by `-D warnings`
 error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`)
   --> $DIR/cast_alignment.rs:16:5
    |
 16 |     (&mut 1u8 as *mut u8) as *mut u16;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: casting from `*const std::ffi::c_void` to a more-strictly-aligned pointer (`*const u32`)
+  --> $DIR/cast_alignment.rs:26:5
+   |
+26 |     (&1u32 as *const u32 as *const std::os::raw::c_void) as *const u32;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors

@flip1995
Copy link
Member

Fixed in #3194. You can rebase again and then travis should pass.

@phansch phansch merged commit 8e80866 into rust-lang:master Sep 28, 2018
@phansch
Copy link
Member

phansch commented Sep 28, 2018

thanks!

@flip1995
Copy link
Member

Could you leave the requested comment in #3230 ?

@Manishearth
Copy link
Member

Ping @ms2300 could you look at #3230 and leave the requested relicensing comment?

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.

5 participants