slice_ops 1.0.7

A selection of useful slice operations.
Documentation
Build #2716042 2025-12-08 05:45:04

Build failed. If you want to re-trigger a documentation build, you can do it here. You can find more information on docs.rs builds documentation on the builds page.

# rustc version rustc 1.94.0-nightly (ba2142a19 2025-12-07)

# docs.rs version docsrs 0.6.0 (b6b97409 2025-12-07 )

# build log [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/slice_ops-1.0.7/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/slice_ops-1.0.7/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:94a0c148923f5b2b52a63ef0eeb1882ad339ab61bce784c8077cbe41c61feb6c" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20251207-1.94.0-nightly-ba2142a19\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] [stdout] a80a671ccb7ac9d9265b9f8b9d306a89cc45a19501e4cd8d992d26d96d8bdd03 [INFO] running `Command { std: "docker" "start" "-a" "a80a671ccb7ac9d9265b9f8b9d306a89cc45a19501e4cd8d992d26d96d8bdd03", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Checking slice_trait v0.1.9 [INFO] [stderr] error: `[const]` is not allowed here [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:7:27 [INFO] [stderr] | [INFO] [stderr] 7 | pub trait IntoBoxedSlice: ~const AsSlice + Sized [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: this trait is not `const`, so it cannot have `[const]` trait bounds [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:7:1 [INFO] [stderr] | [INFO] [stderr] 7 | / pub trait IntoBoxedSlice: ~const AsSlice + Sized [INFO] [stderr] 8 | | { [INFO] [stderr] 9 | | /// Yields boxed slice from generic [INFO] [stderr] 10 | | fn into_boxed_slice(self) -> Box<[Self::Item]>; [INFO] [stderr] 11 | | } [INFO] [stderr] | |_^ [INFO] [stderr] [INFO] [stderr] error: `[const]` is not allowed here [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/slice.rs:5:74 [INFO] [stderr] | [INFO] [stderr] 5 | pub trait Slice: private::Slice + SlicePrereq<<Self as AsSlice>::Item> + ~const AsSlice [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: this trait is not `const`, so it cannot have `[const]` trait bounds [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/slice.rs:5:1 [INFO] [stderr] | [INFO] [stderr] 5 | / pub trait Slice: private::Slice + SlicePrereq<<Self as AsSlice>::Item> + ~const AsSlice [INFO] [stderr] ... | [INFO] [stderr] 8 | | } [INFO] [stderr] | |_^ [INFO] [stderr] [INFO] [stderr] error: `[const]` is not allowed here [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/boxed_slice.rs:7:89 [INFO] [stderr] | [INFO] [stderr] 7 | pub trait BoxedSlice: private::BoxedSlice + BoxedSlicePrereq<<Self as AsSlice>::Item> + ~const IntoBoxedSlice [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: this trait is not `const`, so it cannot have `[const]` trait bounds [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/boxed_slice.rs:7:1 [INFO] [stderr] | [INFO] [stderr] 7 | / pub trait BoxedSlice: private::BoxedSlice + BoxedSlicePrereq<<Self as AsSlice>::Item> + ~const IntoBoxedSlice [INFO] [stderr] ... | [INFO] [stderr] 10 | | } [INFO] [stderr] | |_^ [INFO] [stderr] [INFO] [stderr] error: cannot find attribute `const_trait` in this scope [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:2:3 [INFO] [stderr] | [INFO] [stderr] 2 | #[const_trait] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: cannot find attribute `const_trait` in this scope [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:6:3 [INFO] [stderr] | [INFO] [stderr] 6 | #[const_trait] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: cannot find attribute `const_trait` in this scope [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/slice.rs:4:3 [INFO] [stderr] | [INFO] [stderr] 4 | #[const_trait] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: cannot find attribute `const_trait` in this scope [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/boxed_slice.rs:6:3 [INFO] [stderr] | [INFO] [stderr] 6 | #[const_trait] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: relaxed bounds are not permitted in trait alias bounds [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/prereq.rs:4:28 [INFO] [stderr] | [INFO] [stderr] 4 | pub trait SlicePrereq<T> = ?Sized [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: trait aliases are not implicitly bounded by `Sized`, so there is nothing to relax [INFO] [stderr] [INFO] [stderr] error[E0635]: unknown feature `const_deref` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/lib.rs:4:12 [INFO] [stderr] | [INFO] [stderr] 4 | #![feature(const_deref)] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `AsSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:14:15 [INFO] [stderr] | [INFO] [stderr] 14 | impl<T> const AsSlice for [T] [INFO] [stderr] | ^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `AsSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:29:31 [INFO] [stderr] | [INFO] [stderr] 29 | impl<T, const N: usize> const AsSlice for [T; N] [INFO] [stderr] | ^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `AsSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:45:18 [INFO] [stderr] | [INFO] [stderr] 45 | impl<T, A> const AsSlice for alloc::vec::Vec<T, A> [INFO] [stderr] | ^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `AsSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:63:18 [INFO] [stderr] | [INFO] [stderr] 63 | impl<T, A> const AsSlice for alloc::boxed::Box<T, A> [INFO] [stderr] | ^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: `[const]` can only be applied to `const` traits [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:66:8 [INFO] [stderr] | [INFO] [stderr] 66 | T: ~const AsSlice + ?Sized [INFO] [stderr] | ^^^^^^ can't be applied to `as_slice::AsSlice` [INFO] [stderr] | [INFO] [stderr] help: mark `as_slice::AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: `[const]` can only be applied to `const` traits [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:7:27 [INFO] [stderr] | [INFO] [stderr] 7 | pub trait IntoBoxedSlice: ~const AsSlice + Sized [INFO] [stderr] | ^^^^^^ can't be applied to `as_slice::AsSlice` [INFO] [stderr] | [INFO] [stderr] help: mark `as_slice::AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:3:5 [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `IntoBoxedSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:26:15 [INFO] [stderr] | [INFO] [stderr] 26 | impl<T> const IntoBoxedSlice for Box<[T]> [INFO] [stderr] | ^^^^^^^^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `IntoBoxedSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 7 | pub const trait IntoBoxedSlice: ~const AsSlice + Sized [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: `[const]` can only be applied to `const` traits [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/slice.rs:5:74 [INFO] [stderr] | [INFO] [stderr] 5 | pub trait Slice: private::Slice + SlicePrereq<<Self as AsSlice>::Item> + ~const AsSlice [INFO] [stderr] | ^^^^^^ can't be applied to `as_slice::AsSlice` [INFO] [stderr] | [INFO] [stderr] help: mark `as_slice::AsSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:3:5 [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `Slice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/slice.rs:10:15 [INFO] [stderr] | [INFO] [stderr] 10 | impl<T> const Slice for [T] [INFO] [stderr] | ^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `Slice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 5 | pub const trait Slice: private::Slice + SlicePrereq<<Self as AsSlice>::Item> + ~const AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: `[const]` can only be applied to `const` traits [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/boxed_slice.rs:7:89 [INFO] [stderr] | [INFO] [stderr] 7 | pub trait BoxedSlice: private::BoxedSlice + BoxedSlicePrereq<<Self as AsSlice>::Item> + ~const IntoBoxedSlice [INFO] [stderr] | ^^^^^^ can't be applied to `into_boxed_slice::IntoBoxedSlice` [INFO] [stderr] | [INFO] [stderr] help: mark `into_boxed_slice::IntoBoxedSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/into_boxed_slice.rs:7:5 [INFO] [stderr] | [INFO] [stderr] 7 | pub const trait IntoBoxedSlice: ~const AsSlice + Sized [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error: const `impl` for trait `BoxedSlice` which is not `const` [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/boxed_slice.rs:12:15 [INFO] [stderr] | [INFO] [stderr] 12 | impl<T> const BoxedSlice for Box<[T]> [INFO] [stderr] | ^^^^^^^^^^ this trait is not `const` [INFO] [stderr] | [INFO] [stderr] = note: marking a trait with `const` ensures all default method bodies are `const` [INFO] [stderr] = note: adding a non-const method body in the future would be a breaking change [INFO] [stderr] help: mark `BoxedSlice` as `const` to allow it to have `const` implementations [INFO] [stderr] | [INFO] [stderr] 7 | pub const trait BoxedSlice: private::BoxedSlice + BoxedSlicePrereq<<Self as AsSlice>::Item> + ~const IntoBoxedSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error[E0015]: cannot call non-const method `<T as as_slice::AsSlice>::as_slice` in constant functions [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:72:18 [INFO] [stderr] | [INFO] [stderr] 72 | (**self).as_slice() [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: method `as_slice` is not const because trait `AsSlice` is not const [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:3:1 [INFO] [stderr] | [INFO] [stderr] 3 | pub trait AsSlice [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ this trait is not const [INFO] [stderr] ... [INFO] [stderr] 8 | fn as_slice(&self) -> &[Self::Item]; [INFO] [stderr] | ------------------------------------ this method is not const [INFO] [stderr] = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants [INFO] [stderr] help: consider making trait `AsSlice` const [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] error[E0015]: cannot call non-const method `<T as as_slice::AsSlice>::as_mut_slice` in constant functions [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:77:18 [INFO] [stderr] | [INFO] [stderr] 77 | (**self).as_mut_slice() [INFO] [stderr] | ^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: method `as_mut_slice` is not const because trait `AsSlice` is not const [INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/slice_trait-0.1.9/src/as_slice.rs:3:1 [INFO] [stderr] | [INFO] [stderr] 3 | pub trait AsSlice [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ this trait is not const [INFO] [stderr] ... [INFO] [stderr] 11 | fn as_mut_slice(&mut self) -> &mut [Self::Item]; [INFO] [stderr] | ------------------------------------------------ this method is not const [INFO] [stderr] = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants [INFO] [stderr] help: consider making trait `AsSlice` const [INFO] [stderr] | [INFO] [stderr] 3 | pub const trait AsSlice [INFO] [stderr] | +++++ [INFO] [stderr] [INFO] [stderr] Some errors have detailed explanations: E0015, E0635. [INFO] [stderr] For more information about an error, try `rustc --explain E0015`. [INFO] [stderr] error: could not compile `slice_trait` (lib) due to 22 previous errors [INFO] running `Command { std: "docker" "inspect" "a80a671ccb7ac9d9265b9f8b9d306a89cc45a19501e4cd8d992d26d96d8bdd03", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a80a671ccb7ac9d9265b9f8b9d306a89cc45a19501e4cd8d992d26d96d8bdd03", kill_on_drop: false }` [INFO] [stdout] a80a671ccb7ac9d9265b9f8b9d306a89cc45a19501e4cd8d992d26d96d8bdd03