Skip to content

Commit 6dcda6f

Browse files
committed
Fix tests
1 parent 765274b commit 6dcda6f

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

tests/run/array.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ impl Sub for i16 {
205205
}
206206
}
207207

208+
#[track_caller]
209+
#[lang = "panic_const_add_overflow"]
210+
pub fn panic_const_add_overflow() -> ! {
211+
panic("attempt to add with overflow");
212+
}
213+
214+
#[track_caller]
215+
#[lang = "panic_const_sub_overflow"]
216+
pub fn panic_const_sub_overflow() -> ! {
217+
panic("attempt to subtract with overflow");
218+
}
208219

209220
/*
210221
* Code

tests/run/assign.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ impl Add for isize {
120120
}
121121
}
122122

123+
#[track_caller]
124+
#[lang = "panic_const_add_overflow"]
125+
pub fn panic_const_add_overflow() -> ! {
126+
panic("attempt to add with overflow");
127+
}
128+
123129
/*
124130
* Code
125131
*/

tests/run/closure.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ pub fn panic(_msg: &'static str) -> ! {
189189
}
190190
}
191191

192+
#[track_caller]
193+
#[lang = "panic_const_add_overflow"]
194+
pub fn panic_const_add_overflow() -> ! {
195+
panic("attempt to add with overflow");
196+
}
197+
192198
/*
193199
* Code
194200
*/

tests/run/mut_ref.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ impl Add for isize {
122122
}
123123
}
124124

125+
#[track_caller]
126+
#[lang = "panic_const_add_overflow"]
127+
pub fn panic_const_add_overflow() -> ! {
128+
panic("attempt to add with overflow");
129+
}
130+
125131
/*
126132
* Code
127133
*/

tests/run/operations.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,24 @@ impl Mul for isize {
207207
}
208208
}
209209

210+
#[track_caller]
211+
#[lang = "panic_const_add_overflow"]
212+
pub fn panic_const_add_overflow() -> ! {
213+
panic("attempt to add with overflow");
214+
}
215+
216+
#[track_caller]
217+
#[lang = "panic_const_sub_overflow"]
218+
pub fn panic_const_sub_overflow() -> ! {
219+
panic("attempt to subtract with overflow");
220+
}
221+
222+
#[track_caller]
223+
#[lang = "panic_const_mul_overflow"]
224+
pub fn panic_const_mul_overflow() -> ! {
225+
panic("attempt to multiply with overflow");
226+
}
227+
210228
/*
211229
* Code
212230
*/

0 commit comments

Comments
 (0)