forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#61293 - varkor:rustdoc-print-const-generic,…
… r=GuillaumeGomez Print const generics properly in rustdoc Now that rust-lang#59276 is merged, we can print consts properly in rustdoc. Fixes rust-lang#60737. Fixes rust-lang#61257. r? @GuillaumeGomez
- Loading branch information
Showing
3 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ignore-tidy-linelength | ||
|
||
#![feature(const_generics)] | ||
|
||
#![crate_name = "foo"] | ||
|
||
use std::ops::Add; | ||
|
||
// @has foo/struct.Simd.html '//pre[@class="rust struct"]' 'pub struct Simd<T, const WIDTH: usize>' | ||
pub struct Simd<T, const WIDTH: usize> { | ||
inner: T, | ||
} | ||
|
||
// @has foo/struct.Simd.html '//div[@id="implementations-list"]/h3/code' 'impl Add<Simd<u8, 16>> for Simd<u8, 16>' | ||
impl Add for Simd<u8, 16> { | ||
type Output = Self; | ||
|
||
fn add(self, rhs: Self) -> Self::Output { | ||
Self { inner: 0 } | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
src/test/rustdoc/generic-const.rs → ...test/rustdoc/const-generics/const-impl.rs
This file contains 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