-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
rust/src/libcore/slice/memchr.rs
Line 106 in 13e07a4
let end_align = (ptr as usize + len) & (usize_bytes - 1); |
error: a raw memory access tried to access part of a pointer value as raw bytes
error[E0080]: constant evaluation error
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/slice/memchr.rs:106:21
|
106 | let end_align = (ptr as usize + len) & (usize_bytes - 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
|
note: inside call to `core::slice::memchr::memrchr`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:53:9
|
53 | ::core::slice::memchr::memrchr(needle, haystack)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr::memrchr_specific`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/memchr.rs:56:5
|
56 | memrchr_specific(needle, haystack)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::sys::unix::memchr::memrchr`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/memchr.rs:55:5
|
55 | ::sys::memchr::memrchr(needle, haystack)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `std::memchr::memrchr`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/buffered.rs:905:23
|
905 | let i = match memchr::memrchr(b'/n', buf) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::LineWriter<W> as std::io::Write><std::io::stdio::Maybe<std::io::stdio::StdoutRaw>>::write`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/stdio.rs:465:9
|
465 | self.inner.borrow_mut().write(buf)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside call to `<std::io::StdoutLock<'a> as std::io::Write>::write`
--> /Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/io/mod.rs:1111:19
|
1111| match self.write(buf) {
| ^^^^^^^^^^^^^^^
[...]
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.