Open
Description
I tried this code:
tests/rustdoc/issue-101743-bold-tag.rs
// Regression test for https://github.com/rust-lang/rust/issues/101743
#![crate_name="foo"]
pub type Word = usize;
pub struct Repr<const B: usize>([i32; B]);
pub struct IBig(usize);
pub const fn base_as_ibig<const B: Word>() -> IBig {
IBig(B)
}
impl<const B: Word> Repr<B> {
// If we change back to rendering the value of consts, check this doesn't add
// a <b> tag, but escapes correctly
// @has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '= _'
pub const BASE: IBig = base_as_ibig::<B>();
}
without `-Zcrate-attr=feature(lazy_type_alias)´: no warnings
with -Zcrate-attr=feature(lazy_type_alias)
:
error: `Word` is forbidden as the type of a const generic parameter
--> tests/rustdoc/issue-101743-bold-tag.rs:9:36
|
9 | pub const fn base_as_ibig<const B: Word>() -> IBig {
| ^^^^
|
= note: the only supported types are integers, `bool` and `char`
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Word` is forbidden as the type of a const generic parameter
--> tests/rustdoc/issue-101743-bold-tag.rs:13:15
|
13 | impl<const B: Word> Repr<B> {
| ^^^^
|
= note: the only supported types are integers, `bool` and `char`
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
rustc 1.73.0-nightly (04abc370b 2023-07-28)
binary: rustc
commit-hash: 04abc370b9f3855b28172b65a7f7d5a433f41412
commit-date: 2023-07-28
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Can Do