Skip to content

Commit 3e1a293

Browse files
Add regression test for rust-lang#107283
1 parent 3c48a6c commit 3e1a293

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<code>pub trait Fixed<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;Self: <a class="trait" href="{{channel}}/core/default/trait.Default.html" title="trait core::default::Default">Default</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.LowerExp.html" title="trait core::fmt::LowerExp">LowerExp</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.UpperExp.html" title="trait core::fmt::UpperExp">UpperExp</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.Binary.html" title="trait core::fmt::Binary">Binary</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.Octal.html" title="trait core::fmt::Octal">Octal</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.LowerHex.html" title="trait core::fmt::LowerHex">LowerHex</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/fmt/trait.UpperHex.html" title="trait core::fmt::UpperHex">UpperHex</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.MulAssign.html" title="trait core::ops::arith::MulAssign">MulAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.DivAssign.html" title="trait core::ops::arith::DivAssign">DivAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Rem.html" title="trait core::ops::arith::Rem">Rem</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.RemAssign.html" title="trait core::ops::arith::RemAssign">RemAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.MulAssign.html" title="trait core::ops::arith::MulAssign">MulAssign</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.DivAssign.html" title="trait core::ops::arith::DivAssign">DivAssign</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Rem.html" title="trait core::ops::arith::Rem">Rem</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.RemAssign.html" title="trait core::ops::arith::RemAssign">RemAssign</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.Rem.html" title="trait core::ops::arith::Rem">Rem</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.NonZeroBits" title="type foo::Fixed::NonZeroBits">NonZeroBits</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/arith/trait.RemAssign.html" title="trait core::ops::arith::RemAssign">RemAssign</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.NonZeroBits" title="type foo::Fixed::NonZeroBits">NonZeroBits</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.Not.html" title="trait core::ops::bit::Not">Not</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitAnd.html" title="trait core::ops::bit::BitAnd">BitAnd</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitAndAssign.html" title="trait core::ops::bit::BitAndAssign">BitAndAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitOr.html" title="trait core::ops::bit::BitOr">BitOr</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitOrAssign.html" title="trait core::ops::bit::BitOrAssign">BitOrAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitXor.html" title="trait core::ops::bit::BitXor">BitXor</a>&lt;Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.BitXorAssign.html" title="trait core::ops::bit::BitXorAssign">BitXorAssign</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.Shl.html" title="trait core::ops::bit::Shl">Shl</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.ShlAssign.html" title="trait core::ops::bit::ShlAssign">ShlAssign</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.Shr.html" title="trait core::ops::bit::Shr">Shr</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>, Output = Self&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/ops/bit/trait.ShrAssign.html" title="trait core::ops::bit::ShrAssign">ShrAssign</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/iter/traits/accum/trait.Product.html" title="trait core::iter::traits::accum::Product">Product</a><br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.i8.html">i8</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.i16.html">i16</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.i64.html">i64</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.i128.html">i128</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.isize.html">isize</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u8.html">u8</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u16.html">u16</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u64.html">u64</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.u128.html">u128</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.f32.html">f32</a>&gt;<br />&#160;&#160;&#160;&#160; + <a class="trait" href="{{channel}}/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.f64.html">f64</a>&gt;,</span>{
2+
type <a href="#associatedtype.Bits" class="associatedtype">Bits</a>: <a class="trait" href="{{channel}}/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.NonZeroBits" title="type foo::Fixed::NonZeroBits">NonZeroBits</a>&gt;;
3+
type <a href="#associatedtype.NonZeroBits" class="associatedtype">NonZeroBits</a>: <a class="trait" href="{{channel}}/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;Self::<a class="associatedtype" href="trait.Fixed.html#associatedtype.Bits" title="type foo::Fixed::Bits">Bits</a>, Error = <a class="struct" href="{{channel}}/core/num/error/struct.TryFromIntError.html" title="struct core::num::error::TryFromIntError">TryFromIntError</a>&gt;;
4+
}</code>

tests/rustdoc/lot-of-bounds.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// This is a regression test for <https://github.com/rust-lang/rust/issues/107283>.
2+
3+
#![crate_name = "foo"]
4+
5+
use std::convert::TryFrom;
6+
use std::iter::{Product, Sum};
7+
use std::num::TryFromIntError;
8+
use std::ops::{Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign, Mul, MulAssign, Not, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign};
9+
use std::fmt::{Binary, Debug, Display, LowerExp, LowerHex, Octal, UpperExp, UpperHex};
10+
use std::hash::Hash;
11+
12+
// @has 'foo/trait.Fixed.html'
13+
// @snapshot bounds - '//*[@class="item-decl"]//code'
14+
pub trait Fixed
15+
where
16+
Self: Default + Hash + Ord,
17+
Self: Debug + Display + LowerExp + UpperExp,
18+
Self: Binary + Octal + LowerHex + UpperHex,
19+
Self: Add<Output = Self> + AddAssign,
20+
Self: Sub<Output = Self> + SubAssign,
21+
Self: Mul<Output = Self> + MulAssign,
22+
Self: Div<Output = Self> + DivAssign,
23+
Self: Rem<Output = Self> + RemAssign,
24+
Self: Mul<<Self as Fixed>::Bits, Output = Self> + MulAssign<<Self as Fixed>::Bits>,
25+
Self: Div<<Self as Fixed>::Bits, Output = Self> + DivAssign<<Self as Fixed>::Bits>,
26+
Self: Rem<<Self as Fixed>::Bits, Output = Self> + RemAssign<<Self as Fixed>::Bits>,
27+
Self: Rem<<Self as Fixed>::NonZeroBits, Output = Self>,
28+
Self: RemAssign<<Self as Fixed>::NonZeroBits>,
29+
Self: Not<Output = Self>,
30+
Self: BitAnd<Output = Self> + BitAndAssign,
31+
Self: BitOr<Output = Self> + BitOrAssign,
32+
Self: BitXor<Output = Self> + BitXorAssign,
33+
Self: Shl<u32, Output = Self> + ShlAssign<u32>,
34+
Self: Shr<u32, Output = Self> + ShrAssign<u32>,
35+
Self: Sum + Product,
36+
Self: PartialOrd<i8> + PartialOrd<i16> + PartialOrd<i32>,
37+
Self: PartialOrd<i64> + PartialOrd<i128> + PartialOrd<isize>,
38+
Self: PartialOrd<u8> + PartialOrd<u16> + PartialOrd<u32>,
39+
Self: PartialOrd<u64> + PartialOrd<u128> + PartialOrd<usize>,
40+
Self: PartialOrd<f32> + PartialOrd<f64>,
41+
{
42+
type Bits: From<Self::NonZeroBits>;
43+
type NonZeroBits: TryFrom<Self::Bits, Error = TryFromIntError>;
44+
}

0 commit comments

Comments
 (0)