Merged
Conversation
Contributor
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
scottmcm
reviewed
Aug 17, 2017
src/libcore/intrinsics.rs
Outdated
Member
There was a problem hiding this comment.
nit: Should this be unsafe, for consistency with the real intrinsic?
src/libcore/intrinsics.rs
Outdated
Member
There was a problem hiding this comment.
Consider adding an # Examples doctest to demo a few simple cases.
kennytm
reviewed
Aug 18, 2017
src/libcore/intrinsics.rs
Outdated
Member
There was a problem hiding this comment.
doc test failed.
[00:56:48] failures:
[00:56:48]
[00:56:48] ---- intrinsics.rs - intrinsics::align_offset (line 1361) stdout ----
[00:56:48] error: use of unstable library feature 'core_intrinsics': intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library (see issue #0)
[00:56:48] --> intrinsics.rs:9:14
[00:56:48] |
[00:56:48] 9 | let offset = align_offset(ptr as *const (), align_of::<u16>());
[00:56:48] | ^^^^^^^^^^^^
[00:56:48] |
[00:56:48] = help: add #![feature(core_intrinsics)] to the crate attributes to enable
[00:56:48]
[00:56:48] error: use of unstable library feature 'core_intrinsics': intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library (see issue #0)
[00:56:48] --> intrinsics.rs:5:5
[00:56:48] |
[00:56:48] 5 | use std::intrinsics::align_offset;
[00:56:48] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:56:48] |
[00:56:48] = help: add #![feature(core_intrinsics)] to the crate attributes to enable
[00:56:48]
[00:56:48] error[E0308]: mismatched types
[00:56:48] --> intrinsics.rs:11:30
[00:56:48] |
[00:56:48] 11 | let u16_ptr = ptr.offset(offset) as *const u16;
[00:56:48] | ^^^^^^ expected isize, found usize
[00:56:48]
[00:56:48] thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:280:12
[00:56:48] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:56:48]
[00:56:48]
[00:56:48] failures:
[00:56:48] intrinsics.rs - intrinsics::align_offset (line 1361)
[00:56:48]
[00:56:48] test result: FAILED. 1231 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out
[00:56:48]
[00:56:48] error: test failed, to rerun pass '--doc'see rust-lang/rfcs#2043 for details
Contributor
Author
|
ping @aturon |
Contributor
|
@bors: r+ |
Collaborator
|
📌 Commit be96ad2 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Aug 30, 2017
Add align_offset intrinsic see rust-lang/rfcs#2043 for details and the plan towards stabilization (reexport in `core::mem` via various convenience functions) as per @scottmcm 's [comment](rust-lang/rfcs#2043 (comment)), this is just the intrinsic (which is obviously unstable).
Collaborator
|
☀️ Test successful - status-appveyor, status-travis |
4 tasks
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Dec 18, 2017
…trochenkov Fix the wrong subtraction in align_offset intrinsic. Given how the stage0 implementation in rust-lang#43903 is written, as well as that in the RFC, I suppose the current implementation has a typo. cc rust-lang#44488, cc @oli-obk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see rust-lang/rfcs#2043 for details and the plan towards stabilization (reexport in
core::memvia various convenience functions)as per @scottmcm 's comment, this is just the intrinsic (which is obviously unstable).