File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -189,3 +189,25 @@ pub use bar::P;
189189//@ has - '//*[@id="variant.A"]/h3' 'A(u32)'
190190//@ matches - '//*[@id="variant.B"]/h3' '^B$'
191191pub use bar:: Q ;
192+
193+ // Ensure signed implicit discriminants are rendered correctly after a negative explicit value.
194+ //@ has 'foo/enum.R.html'
195+ //@ has - '//*[@class="rust item-decl"]/code' 'A = -2,'
196+ //@ has - '//*[@class="rust item-decl"]/code' 'B = -1,'
197+ //@ matches - '//*[@id="variant.A"]/h3' '^A = -2$'
198+ //@ matches - '//*[@id="variant.B"]/h3' '^B = -1$'
199+ pub enum R {
200+ A = -2 ,
201+ B ,
202+ }
203+
204+ // Also check that incrementing -1 yields 0 for the next implicit variant.
205+ //@ has 'foo/enum.S.html'
206+ //@ has - '//*[@class="rust item-decl"]/code' 'A = -1,'
207+ //@ has - '//*[@class="rust item-decl"]/code' 'B = 0,'
208+ //@ matches - '//*[@id="variant.A"]/h3' '^A = -1$'
209+ //@ matches - '//*[@id="variant.B"]/h3' '^B = 0$'
210+ pub enum S {
211+ A = -1 ,
212+ B ,
213+ }
You can’t perform that action at this time.
0 commit comments