Skip to content

implement carryless_mul#152132

Open
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:carryless-mul
Open

implement carryless_mul#152132
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:carryless-mul

Conversation

@folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Feb 4, 2026

tracking issue: #152080
ACP: rust-lang/libs-team#738

This defers to LLVM's llvm.clmul when available, and otherwise falls back to a method from the polyval crate (link).

Some things are missing, which I think we can defer:

  • the ACP has some discussion about additional methods, but I'm not sure exactly what is wanted or how to implement it efficiently
  • the SIMD intrinsic is not yet const (I think I ran into a bootstrapping issue). That is fine for now, I think in stdarch we can't really use this intrinsic at the moment, we'd only want the scalar version to replace some riscv intrinsics.
  • the SIMD intrinsic is not implemented for the gcc and cranelift backends. That should be reasonably straightforward once we have a const eval implementation though.

@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

⚠️ #[miri::intrinsic_fallback_is_spec] must only be used if the function actively checks for all UB cases,
and explores the possible non-determinism of the intrinsic.

cc @rust-lang/miri

Some changes occurred to the platform-builtins intrinsics. Make sure the
LLVM backend as well as portable-simd gets adapted for the changes.

cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 4, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

use crate::num::Wrapping;

// i.e. 0b100010001...0001 in binary.
const MASK: u128 = 0x1111_1111_1111_1111_1111_1111_1111_1111;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const MASK: u128 = 0x1111_1111_1111_1111_1111_1111_1111_1111;
const MASK: u128 = !0 / 0xF;

seems easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it? When I look at that expression I'd have to trust the comment that it does what it says. The 0x1111 literal is long but to me it's clearer.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/asm/aarch64/may_unwind.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
test [ui] tests/ui/asm/cfg-parse-error.rs ... ok
test [ui] tests/ui/asm/cfg.rs#reva ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat2 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/windows-tcb-trash-13259.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
---
test [ui] tests/ui/imports/ambiguous-9.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-module.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
---
[TIMING:end] tool::Rustdoc { target_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false } } -- 0.000
##[group]Testing stage2 with compiletest suite=rustdoc-html mode=rustdoc-html (aarch64-unknown-linux-gnu)

running 776 tests
test [rustdoc-html] tests/rustdoc-html/anchors/anchor-id-trait-method-15169.rs ... ok
test [rustdoc-html] tests/rustdoc-html/all.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/anchor-id-duplicate-method-name-25001.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/anchor-id-trait-tymethod-28478.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/disambiguate-anchors-32890.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/anchors.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/disambiguate-anchors-header-29449.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/method-anchor-in-blanket-impl-86620.rs ... ok
test [rustdoc-html] tests/rustdoc-html/array-links.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anchors/trait-impl-items-links-and-anchors.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anonymous-lifetime.rs ... ok
test [rustdoc-html] tests/rustdoc-html/anon-fn-params.rs ... ok
test [rustdoc-html] tests/rustdoc-html/asm-foreign.rs ... ok
test [rustdoc-html] tests/rustdoc-html/asm-foreign2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/asref-for-and-of-local-82465.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/assoc-fns.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/assoc-item-cast.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/assoc-type-bindings-20646.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/assoc-types.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/cross-crate-hidden-assoc-trait-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/doc-assoc-item.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-deref.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/inline-assoc-type-20727-bindings.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-index.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds.rs ... ok
test [rustdoc-html] tests/rustdoc-html/async/async-move-doctest.rs ... ok
test [rustdoc-html] tests/rustdoc-html/async/async-fn-opaque-item.rs ... ok
test [rustdoc-html] tests/rustdoc-html/async/async-fn.rs ... ok
test [rustdoc-html] tests/rustdoc-html/async/async-trait-sig.rs ... ok
test [rustdoc-html] tests/rustdoc-html/attributes-2021-edition.rs ... ok
test [rustdoc-html] tests/rustdoc-html/async/async-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/assoc/normalize-assoc-item.rs ... ok
test [rustdoc-html] tests/rustdoc-html/attributes-inlining-108281.rs ... ok
test [rustdoc-html] tests/rustdoc-html/attributes-re-export-2021-edition.rs ... ok
test [rustdoc-html] tests/rustdoc-html/attributes-re-export.rs ... ok
test [rustdoc-html] tests/rustdoc-html/attributes.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-impl-for-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-trait-bounds-by-associated-type-50159.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-trait-bounds-inference-variables-54705.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-impl-primitive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-trait-bounds-where-51236.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-trait-negative-impl-55321.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-trait-not-send.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto-traits.rs ... ok
test [rustdoc-html] tests/rustdoc-html/auto/auto_aliases.rs ... ok
test [rustdoc-html] tests/rustdoc-html/bad-codeblock-syntax.rs ... ok
test [rustdoc-html] tests/rustdoc-html/blank-line-in-doc-block-47197.rs ... ok
test [rustdoc-html] tests/rustdoc-html/bold-tag-101743.rs ... ok
test [rustdoc-html] tests/rustdoc-html/bounds.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cap-lints.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cfg-bool.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cfg-doctest.rs ... ok
test [rustdoc-html] tests/rustdoc-html/comment-in-doctest.rs ... ok
test [rustdoc-html] tests/rustdoc-html/check-styled-link.rs ... ok
test [rustdoc-html] tests/rustdoc-html/check.rs ... ok
test [rustdoc-html] tests/rustdoc-html/codeblock-title.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-fn-76501.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-fn-effects.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-fn.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/add-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/const-generic-defaults.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/const-generic-slice.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/const-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/const-generics-docs.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/const-param-type-references-generics.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/generic_const_exprs.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/lazy_normalization_consts/const-equate-pred.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-generics/type-alias.rs ... ok
test [rustdoc-html] tests/rustdoc-html/const-intrinsic.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/assoc-const-has-projection-ty.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/assoc-consts-underscore.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/assoc-consts-version.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/assoc-consts.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/associated-consts.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-display.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-doc.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-effect-param.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-trait-and-impl-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-value-display.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const-underscore.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/const.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/document-item-with-associated-const-in-where-clause.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/generic-const-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/generic_const_exprs.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/glob-shadowing-const.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/hide-complex-unevaluated-const-arguments.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/hide-complex-unevaluated-consts.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/ice-associated-const-equality-105952.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/legacy-const-generic.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/link-assoc-const.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/redirect-const.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/rfc-2632-const-trait-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constant/show-const-contents.rs ... ok
test [rustdoc-html] tests/rustdoc-html/constructor-imports.rs ... ok
test [rustdoc-html] tests/rustdoc-html/crate-doc-hidden-109695.rs ... ok
test [rustdoc-html] tests/rustdoc-html/crate-version-escape.rs ... ok
test [rustdoc-html] tests/rustdoc-html/crate-version-extra.rs ... ok
test [rustdoc-html] tests/rustdoc-html/crate-version.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/cargo-two-no-index/e.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/cargo-two/e.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/s.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/cargo-transitive/s.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/single-crate-no-index/q.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/single-crate-baseline/q.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/index-on-last/e.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/working-dir-examples/q.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/two/e.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/write-docs-somewhere-else/e.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/transitive/s.rs ... ok
test [rustdoc-html] tests/rustdoc-html/custom_code_classes.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-links.rs ... ok
test [rustdoc-html] tests/rustdoc-html/decl-trailing-whitespace.rs ... ok
test [rustdoc-html] tests/rustdoc-html/decl-line-wrapping-empty-arg-list.rs ... ok
test [rustdoc-html] tests/rustdoc-html/default-theme.rs ... ok
test [rustdoc-html] tests/rustdoc-html/default-trait-method-link.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deep-structures.rs ... ok
test [rustdoc-html] tests/rustdoc-html/demo-allocator-54478.rs ... ok
test [rustdoc-html] tests/rustdoc-html/default-trait-method.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deprecated-future-staged-api.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deprecated-future.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deprecated.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref-methods-19190-foreign-type.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref-methods-19190-inline.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref-methods-19190.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref-mut-35169-2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref-mut-35169.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-const-fn.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-methods-24686-target.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-multiple-impl-blocks.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-mut-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/cross-crate-info/kitchen-sink/i.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-recursive-pathbuf.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-recursive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-slice-core.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-to-primitive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/deref-typedef.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/escape-deref-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/recursive-deref-sidebar.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/recursive-deref.rs ... ok
test [rustdoc-html] tests/rustdoc-html/deref/sidebar-links-deref-100679.rs ... ok
test [rustdoc-html] tests/rustdoc-html/description.rs ... ok
test [rustdoc-html] tests/rustdoc-html/description_default.rs ... ok
test [rustdoc-html] tests/rustdoc-html/display-hidden-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-attr-comment-mix-42760.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-attribute.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-auto-cfg-public-in-private.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-auto-cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-hide.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-implicit-gate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-target-feature.rs ... ignored, only executed when the architecture is x86_64
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-implicit.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-inherit-from-module-79201.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-simplification.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg-traits.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/doc-cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-cfg/duplicate-cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-test-attr-18199.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-hidden-method-13698.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-on-keyword.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-cfg-feature-30252.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-crate-attributes-38129.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc_auto_cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc_auto_cfg_reexports.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-hide-empty-line-23106.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-include-43153.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-macro-38219.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-manual-crate-name.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doc-hidden-crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-escape-boring-41783.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-markdown-inline-parse-23744.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-markdown-trailing-docblock-48377.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-ignore-32556.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-multi-line-string-literal-25944.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/doctest-runtool.rs ... ok
test [rustdoc-html] tests/rustdoc-html/doctest/ignore-sometimes.rs ... ok
test [rustdoc-html] tests/rustdoc-html/document-hidden-items-15347.rs ... ok
test [rustdoc-html] tests/rustdoc-html/double-hyphen-to-dash.rs ... ok
test [rustdoc-html] tests/rustdoc-html/double-quote-escape.rs ... ok
test [rustdoc-html] tests/rustdoc-html/duplicate-flags.rs ... ok
test [rustdoc-html] tests/rustdoc-html/duplicate_impls/impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/duplicate_impls/sidebar-links-duplicate-impls-33054.rs ... ok
test [rustdoc-html] tests/rustdoc-html/edition-flag.rs ... ok
test [rustdoc-html] tests/rustdoc-html/edition-doctest.rs ... ok
test [rustdoc-html] tests/rustdoc-html/dyn-compatibility.rs ... ok
test [rustdoc-html] tests/rustdoc-html/early-unindent.rs ... ok
test [rustdoc-html] tests/rustdoc-html/empty-doc-comment.rs ... ok
test [rustdoc-html] tests/rustdoc-html/elided-lifetime.rs ... ok
test [rustdoc-html] tests/rustdoc-html/empty-mod-public.rs ... ok
test [rustdoc-html] tests/rustdoc-html/empty-section.rs ... ok
test [rustdoc-html] tests/rustdoc-html/empty-tuple-struct-118180.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-headings.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-non-exhaustive-108925.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-variant-doc-hidden-field-88600.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-variant-fields-heading.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-variant-non_exhaustive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/enum-variant-value.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/strip-enum-variant.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/duplicate-reexports-section-150211.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-default-method.rs ... ok
test [rustdoc-html] tests/rustdoc-html/enum/render-enum-variant-structlike-32395.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-fn-22038.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-html-alias.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-html-root-url-precedence.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-html-fallback.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-html-root-url.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-links.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/external-cross.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/extern-method.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/external-doc.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/hidden-extern-34025.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/pub-extern-crate-150176.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/link-extern-crate-title-33178.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/link-extern-crate-item-30109.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/unsafe-extern-blocks.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/pub-extern-crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/link-extern-crate-33178.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extern/unused-extern-crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/file-creation-111249.rs ... ok
test [rustdoc-html] tests/rustdoc-html/extremely_long_typename.rs ... ok
test [rustdoc-html] tests/rustdoc-html/feature-gate-doc_auto_cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/ffi.rs ... ok
test [rustdoc-html] tests/rustdoc-html/files-creation-hidden.rs ... ok
test [rustdoc-html] tests/rustdoc-html/fn-bound.rs ... ok
test [rustdoc-html] tests/rustdoc-html/fn-pointer-arg-name.rs ... ok
test [rustdoc-html] tests/rustdoc-html/fn-sidebar.rs ... ok
test [rustdoc-html] tests/rustdoc-html/fn-type.rs ... ok
test [rustdoc-html] tests/rustdoc-html/footnote-definition-without-blank-line-100638.rs ... ok
test [rustdoc-html] tests/rustdoc-html/footnote-ids.rs ... ok
test [rustdoc-html] tests/rustdoc-html/force-target-feature.rs ... ignored, only executed when the architecture is x86_64
test [rustdoc-html] tests/rustdoc-html/footnote-reference-ids.rs ... ok
test [rustdoc-html] tests/rustdoc-html/footnote-in-summary.rs ... ok
test [rustdoc-html] tests/rustdoc-html/footnote-reference-in-footnote-def.rs ... ok
test [rustdoc-html] tests/rustdoc-html/force-unstable-if-unmarked-106421-not-internal.rs ... ok
test [rustdoc-html] tests/rustdoc-html/foreigntype.rs ... ok
test [rustdoc-html] tests/rustdoc-html/force-unstable-if-unmarked-106421.rs ... ok
test [rustdoc-html] tests/rustdoc-html/generic-associated-types/gat-elided-lifetime-94683.rs ... ok
test [rustdoc-html] tests/rustdoc-html/generic-associated-types/gat-linkification-109488.rs ... ok
test [rustdoc-html] tests/rustdoc-html/generic-associated-types/gats.rs ... ok
test [rustdoc-html] tests/rustdoc-html/glob-shadowing.rs ... ok
test [rustdoc-html] tests/rustdoc-html/heading-levels-89309.rs ... ok
test [rustdoc-html] tests/rustdoc-html/heterogeneous-concat.rs ... ok
test [rustdoc-html] tests/rustdoc-html/hidden-line.rs ... ok
test [rustdoc-html] tests/rustdoc-html/hidden-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/hidden-trait-methods-with-document-hidden-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/hidden-trait-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/ice-type-error-19181.rs ... ok
test [rustdoc-html] tests/rustdoc-html/hide-unstable-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/higher-ranked-trait-bounds.rs ... ok
test [rustdoc-html] tests/rustdoc-html/highlight-invalid-rust-12834.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/blanket-impl-29503.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/blanket-impl-78673.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/deduplicate-glob-import-impl-21474.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/cross-crate-hidden-impl-parameter.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/deduplicate-trait-impl-22025.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/default-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/deprecated-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/doc-hidden-trait-implementors-33069.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/doc_auto_cfg_nested_impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/duplicated_impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/empty-impl-block.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/empty-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/extern-impl-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/extern-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/generic-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/foreign-implementors-js-43701.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/hidden-implementors-90781.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/hidden-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/hidden-trait-struct-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/hide-mut-methods-if-no-derefmut-impl-74083.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-alias-substituted.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-assoc-type-21092.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-associated-items-sidebar.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-associated-items-order.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-blanket-53689.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-box.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-everywhere.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-disambiguation.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-in-const-block.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-on-ty-alias-issue-119015.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-parts.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-parts-crosscrate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-ref-20175.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-trait-43869.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-trait-alias.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-trait-precise-capturing.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/impl-type-parameter-33592.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/implementor-stable-version.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/implementors-unstable-75588.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/manual_impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/method-link-foreign-trait-impl-17476.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/module-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/inline-impl-through-glob-import-100204.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/must_implement_one_of.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/negative-impl-no-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/negative-impl-sidebar.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/negative-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/return-impl-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/same-crate-hidden-impl-parameter.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/sidebar-trait-impl-disambiguate-78701.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/struct-implementations-title.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/underscore-type-in-trait-impl-96381.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/rustc-incoherent-impls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/trait-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/trait-implementations-duplicate-self-45584.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/universal-impl-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impl/unneeded-trait-implementations-title.rs ... ok
test [rustdoc-html] tests/rustdoc-html/include_str_cut.rs ... ok
test [rustdoc-html] tests/rustdoc-html/impossible-default.rs ... ok
test [rustdoc-html] tests/rustdoc-html/import-remapped-paths.rs ... ok
test [rustdoc-html] tests/rustdoc-html/infinite-redirection-16265-1.rs ... ok
test [rustdoc-html] tests/rustdoc-html/infinite-redirection-16265-2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/infinite-redirection.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inherent-projections.rs ... ok
test [rustdoc-html] tests/rustdoc-html/index-page.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline-default-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline-rename-34473.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/add-docs.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/assoc-const-equality.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/async-fn.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/attributes.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/assoc-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/const-effect-param.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/const-eval-46727.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/const-fn-27362.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/deduplicate-inlined-items-23207.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/default-generic-args.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/default-trait-method.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/cross-glob.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-auto-cfg.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-hidden-extern-trait-impl-29584.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-hidden-broken-link-28480.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-1.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/dyn_trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/doc-reachability-impl-31948.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/early-late-bound-lifetime-params.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/fn-ptr-ty.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/generic-const-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/ice-import-crate-57180.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/hidden-use.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/impl-dyn-trait-32881.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/impl-inline-without-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/impl-sized.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/impl-ref-33113.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/impl_trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/implementors-js.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/inline_hidden.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/macro-vis.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/macros.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/non_lifetime_binders.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/reexport-with-anonymous-lifetime-98697.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/qpath-self-85454.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/proc_macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/renamed-via-module.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/ret-pos-impl-trait-in-trait.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/rustc-private-76736-1.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/rustc-private-76736-2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/rustc-private-76736-3.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/rustc-private-76736-4.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/self-sized-bounds-24183.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/sugar-closure-crate-21801.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/trait-vis.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/blanket-impl-reexported-trait-94183.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/doc-no-inline-32343.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/enum-variant-reexport-46766.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/fully-stable-path-is-better.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/glob-extern-document-private-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/glob-extern.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/glob-private-document-private-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/glob-private.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_cross/use_crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/hidden-use.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/macro_by_example.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/parent-path-is-better.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/please_inline.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141-2.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/private-reexport-in-public-api-hidden-81141.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/private-reexport-in-public-api-generics-81141.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/private-reexport-in-public-api-private-81141.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/pub-re-export-28537.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/staged-inline.rs ... ok
test [rustdoc-html] tests/rustdoc-html/inline_local/trait-vis.rs ... ok
test [rustdoc-html] tests/rustdoc-html/internal.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/adt-through-alias.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/anchors.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/assoc-reexport-super.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc-crate/self.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/associated-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/associated-defaults.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/basic.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/builtin-macros.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/crate-relative-assoc.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/crate-relative.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/additional_doc.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/basic.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/hidden.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/submodule-outer.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/module.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/submodule-inner.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/deprecated.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/deps.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/cross-crate/traits.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/disambiguators-removed.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/email-address.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/enum-self-82209.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/enum-struct-field.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-builtin-type-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-crate.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-inherent-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-reference-link.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-type.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/external-traits.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/field.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/filter-out-private.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/generic-params.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/generic-trait-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/ice-deprecated-note-on-reexport.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/extern-crate-only-used-in-link.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/ice-intra-doc-links-107995.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/in-bodies.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/inherent-associated-types.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/intra-doc-link-method-trait-impl-72340.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/link-in-footnotes-132208.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/link-same-name-different-disambiguator-108459.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/macro-caching-144965.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/link-to-proc-macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/macros-disambiguators.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/mod-ambiguity.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/mod-relative.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/no-doc-primitive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/module-scope-name-resolution-55364.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/nested-use.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/non-path-primitives.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-methods-external-core.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-methods-local.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-assoc.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-associated-traits.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-self.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-methods.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/prim-precedence.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/primitive-disambiguators.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/primitive-non-default-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/private-failures-ignored.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/private.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/pub-use.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/raw-ident-self.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/proc-macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/same-name-different-crates-66159.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/reexport-additional-docs.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/self-cache.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/self.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/libstd-re-export.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/trait-impl.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/trait-item.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/true-false.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/type-alias-primitive.rs ... ok
test [rustdoc-html] tests/rustdoc-html/intra-doc/type-alias.rs ... ok
test [rustdoc-html] tests/rustdoc-html/invalid$crate$name.rs ... ok
test [rustdoc-html] tests/rustdoc-html/item-desc-list-at-start.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/assoc-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/assoc-types.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/derive-macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/doc-links-calls.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/doc-links.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/no-body-items.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/non-local-method.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/patterns.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/prelude-types.rs ... ok
test [rustdoc-html] tests/rustdoc-html/jump-to-def/shebang.rs ... ok
test [rustdoc-html] tests/rustdoc-html/keyword.rs ... ok
test [rustdoc-html] tests/rustdoc-html/lifetime-name.rs ... ok
test [rustdoc-html] tests/rustdoc-html/line-breaks.rs ... ok
test [rustdoc-html] tests/rustdoc-html/link-on-path-with-generics.rs ... ok
test [rustdoc-html] tests/rustdoc-html/link-title-escape.rs ... ok
test [rustdoc-html] tests/rustdoc-html/links-in-headings.rs ... ok
test [rustdoc-html] tests/rustdoc-html/logo-class-default.rs ... ok
test [rustdoc-html] tests/rustdoc-html/logo-class-rust.rs ... ok
test [rustdoc-html] tests/rustdoc-html/logo-class.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro-expansion/field-followed-by-exclamation.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro-expansion/type-macro-expansion.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/const-rendering-macros-33302.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/decl_macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/decl_macro_priv.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/doc-proc-macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-const-display-115295.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-doc-comment-23812.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-export-crate-root-108231.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-generated-macro.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-higher-kinded-function.rs ... ok
test [rustdoc-html] tests/rustdoc-html/macro/macro-ice-16019.rs ... ok
---
thread 'rustc' (251069) panicked at compiler/rustc_codegen_llvm/src/intrinsic.rs:471:26:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx> as rustc_codegen_ssa::traits::intrinsic::IntrinsicCallBuilderMethods>::codegen_intrinsic_call
   7: <rustc_codegen_ssa::mir::FunctionCx<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>>::codegen_intrinsic_call
   8: <rustc_codegen_ssa::mir::FunctionCx<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>>::codegen_call_terminator
   9: <rustc_codegen_ssa::mir::FunctionCx<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>>::codegen_terminator
  10: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
  11: rustc_codegen_ssa::base::codegen_instance::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
  12: <rustc_middle::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
  13: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  14: rustc_codegen_llvm::base::compile_codegen_unit
  15: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  16: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  17: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  18: rustc_interface::passes::start_codegen
  19: <rustc_interface::queries::Linker>::codegen_and_build_linker
  20: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  21: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  22: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  23: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  24: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  25: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  26: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

warning: the ICE couldn't be written to `/checkout/rustc-ice-2026-02-04T21_09_56-251054.txt`: Read-only file system (os error 30)

note: rustc 1.95.0-nightly (263fce627 2026-02-04) running on aarch64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C embed-bitcode=yes -Z unstable-options -C force-frame-pointers=non-leaf -C debug-assertions=on -Z annotate-moves -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z inline-mir -Z inline-mir-preserve-debug -Z mir_strip_debuginfo=locals-in-tiny-functions -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
[RUSTC-TIMING] coretests test:true 69.465
error: could not compile `coretests` (test "coretests")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name coretests --edition=2024 library/coretests/tests/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 --warn=unexpected_cfgs --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' -Cembed-bitcode=yes -Zunstable-options -Cforce-frame-pointers=non-leaf -C debug-assertions=on --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=db21fdd9b6fd8ddd -C extra-filename=-a05bf8c1d1374b74 --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/dist/deps --extern coretests=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/libcoretests-d659d4e24f18bddd.rlib --extern coretests=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/libcoretests-d659d4e24f18bddd.rmeta --extern rand=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/librand-90c2f84d7817f723.rlib --extern rand=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/librand-90c2f84d7817f723.rmeta --extern rand_xorshift=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/librand_xorshift-a6cb69292a698368.rlib --extern rand_xorshift=/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-std/aarch64-unknown-linux-gnu/dist/deps/librand_xorshift-a6cb69292a698368.rmeta -Zannotate-moves -Zrandomize-layout '--check-cfg=cfg(feature,values(any()))' -Zunstable-options -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 --cfg=randomized_layouts -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] std test:false 22.995
[RUSTC-TIMING] alloctests test:true 83.698
[RUSTC-TIMING] alloctests test:true 60.554
Bootstrap failed while executing `--stage 2 test --skip compiler --skip src`

@okaneco
Copy link
Contributor

okaneco commented Feb 4, 2026

the ACP has some discussion about additional methods, but I'm not sure exactly what is wanted or how to implement it efficiently

My understanding was that widening_carryless_mul was accepted. It produces a result with the low and high order bits in the next widest integer, with a signature of fn(u<n>, u<n>) -> u<2*n> based on this comment rust-lang/libs-team#738 (comment):

...we would like the widening method to return a larger integer size and not be available on u128.

The tuple returning method is a possible future expansion, not intended to be currently implemented.


I don't know the best way to implement the widening operation, but we can get the high-order bits using clmul as a primitive. In LLVM's arbitrary precision integer library, clmulr (reversed) and clmulh (high-order bits) are defined in terms of clmul like this.

clmulr(a, b) = bitreverse(clmul(bitreverse(a), bitreverse(b)))
clmulh(a, b) = clmulr(a, b) >> 1

https://github.com/llvm/llvm-project/blob/66ba9c9475c7628893f387f1b9d9d3056b05d995/llvm/include/llvm/ADT/APInt.h#L2457-L2476
https://github.com/llvm/llvm-project/blob/66ba9c9475c7628893f387f1b9d9d3056b05d995/llvm/lib/Support/APInt.cpp#L3202-L3220

Folds exist for clmulr/clmulh ISD nodes
clmulh
clmulr

@folkertdev
Copy link
Contributor Author

Right, it's just the first widening function that would have that signature. If that is the plan then it's pretty simple: you just widen first and then do clmul on the widened type. That can never overflow.

For carrying_carryless_mul (also requested), there presumably is some way to get that carry bit more efficiently than performing the wide clmul. Like, not doing that is the whole point of that function.


This is running into CI sometimes using earlier LLVM releases without the new intrinsic. I asked in #t-compiler/llvm > Adding an LLVM 22 intrinsic how/if we can work around that.

@programmerjake
Copy link
Member

For carrying_carryless_mul (also requested), there presumably is some way to get that carry bit more efficiently than performing the wide clmul. Like, not doing that is the whole point of that function.

actually I expect you can probably just use clmul on LLVM's i256 type for u128 and then extract the high and low halves. That's what carrying_mul does:
https://rust.godbolt.org/z/K5578vEnn

; cleaned up slightly
define void @u128_carrying_mul(ptr sret([32 x i8]) align 16 %_0, i128 noundef %a, i128 noundef %b, i128 noundef %c) unnamed_addr #0 {
start:
  %0 = zext i128 %a to i256
  %1 = zext i128 %b to i256
  %2 = zext i128 %c to i256
  %3 = mul nuw i256 %1, %0
  %4 = add nuw i256 %3, %2
  %5 = trunc i256 %4 to i128
  %6 = lshr i256 %4, 128
  %7 = trunc nuw i256 %6 to i128
  store i128 %5, ptr %_0, align 16
  %_0.repack1 = getelementptr inbounds nuw i8, ptr %_0, i64 16
  store i128 %7, ptr %_0.repack1, align 16
  ret void
}

Comment on lines +231 to +233
/// This approach uses a bitmask of the form `0b100010001...0001` to avoid carry spilling.
/// When carries do occur, they wind up in a "hole" of zeros and are subsequently masked
/// out of the result.
Copy link
Contributor

Choose a reason for hiding this comment

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

This approach with 4-bit digits works up to integers with 4 * 15 = 60 bits. Past that, one digit can overflow to the next.

For u64, it does actually work for this "non-widening" operation, since the top digit may be computed as 16, but there is no next digit that would be affected. The wide result would be erroneous however. E.g. x.carryless_mul(x) with x = MASK as u64 as u128.

The impl for u128::carryless_mul is currently incorrect for that reason. You could probably extend the approach to use 5-bit digits, but it's likely better to just implement it in terms of u64::carryless_mul.

some tests against a naive impl: playground

@scottmcm

This comment was marked as resolved.

@rustbot rustbot assigned Mark-Simulacrum and unassigned scottmcm Feb 5, 2026
unsafe { a.unchecked_funnel_shr(b, shift) }
}

/// Carryless multiply.
Copy link
Member

Choose a reason for hiding this comment

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

Is this meant to be a self-contained description? To me these words mean nothing.^^

sym::bitreverse => {
self.call_intrinsic("llvm.bitreverse", &[llty], &[args[0].immediate()])
}
sym::carryless_mul if crate::llvm_util::get_version() >= (22, 0, 0) => {
Copy link
Member

Choose a reason for hiding this comment

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

Since the fallback body is non-trivial, maybe this should be added to the list from #150605 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That PR was merged but I can't find the implementation anywhere. Was is subsequently removed?

Copy link
Member

@RalfJung RalfJung Feb 5, 2026

Choose a reason for hiding this comment

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

Not that I know of -- you may have to rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, it was only merged yesterday. That makes sense then.

#[doc = concat!("let a = ", $clmul_lhs, stringify!($SelfT), ";")]
#[doc = concat!("let b = ", $clmul_rhs, stringify!($SelfT), ";")]
///
#[doc = concat!("assert_eq!(a.carryless_mul(b), ", $clmul_result, ");")]
Copy link
Member

Choose a reason for hiding this comment

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

The only example here uses huge numbers which means the example is entirely useless if one doesn't already know what this operation does. I for one still have no clue after reading all this.^^

Which carry is discarded? All the ones that show up when adding up the results of the first steps of long multiplication? Or also all the carries that occur within the long multiplication steps? This needs way more detail. Doesn't that mean the result depends on the base? No base is mentioed in the first 2 paragraphs, and even in the third paragraph it's only mentioned in an obscure way.

Copy link
Member

Choose a reason for hiding this comment

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

maybe describe it as equivalent to:

impl uN {
    pub fn carryless_mul(self, other: Self) -> Self {
        let mut retval = 0;
        for i in 0..Self::BITS {
            if (other >> i) & 1 != 0 {
                retval ^= self << i;
            }
        }
        retval
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good specification. I haven't really found/been able to come up with a good intuitive explanation, and even if you understand the mechanics, how/when to apply this function is still hard to see.


The only example here uses huge numbers

So in part that is to test that the implementation doesn't just mask off the upper bits. Because of how these functions are generated with a macro, getting examples to work with type inference and without overflowing literals is a bit finicky.

I'll try again to come up with something more insightful.

Copy link
Member

Choose a reason for hiding this comment

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

Regular long multiplication would be using += instead of ^=, right?

I have no idea why that would be called "carryless", but that does seem like a reasonable way to explain this, yeah. And maybe we should also do the const-eval/Miri implementation that way to avoid relying on the fallback impl that seems to want to be clever. We generally don't want to be clever for intrinsics in Miri.

Copy link
Contributor

@quaternic quaternic Feb 5, 2026

Choose a reason for hiding this comment

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

Regular long multiplication would be using += instead of ^=, right?

Exactly.

It is carryless in the sense that the sum of two bits (x,y) produces a carry bit = x & y and the wrapped sum = x ^ y, so using ^ instead of + is just throwing out all the carries of bitwise addition. That is, consider the equivalence x + y = (x ^ y) + ((x & y) << 1).

The connection to polynomial multiplication is that there you naturally don't carry between the coefficients: (x + 1)(x + 1) = x^2 + 2x + 1, and the 2x doesn't just turn into x^2. Rather, if you're computing the coefficients modulo 2, you get 2x = 0x. Indeed, 0b11.carryless_mul(0b11) == 0b101, where the polynomials are represented by their valuation at x = 2.

@programmerjake
Copy link
Member

programmerjake commented Feb 5, 2026

maybe look at the latest C++ proposal for a bunch of good examples: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3642r3.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants