@@ -159,12 +159,35 @@ pub trait BuilderMethods<'a, 'tcx>:
159159 /// must be interpreted as unsigned and can be assumed to be less than the size of the left
160160 /// operand.
161161 fn ashr ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
162- fn unchecked_sadd ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
163- fn unchecked_uadd ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
164- fn unchecked_ssub ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
165- fn unchecked_usub ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
166- fn unchecked_smul ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
167- fn unchecked_umul ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
162+ fn unchecked_sadd ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
163+ self . add ( lhs, rhs)
164+ }
165+ fn unchecked_uadd ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
166+ self . add ( lhs, rhs)
167+ }
168+ fn unchecked_suadd ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
169+ self . unchecked_sadd ( lhs, rhs)
170+ }
171+ fn unchecked_ssub ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
172+ self . sub ( lhs, rhs)
173+ }
174+ fn unchecked_usub ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
175+ self . sub ( lhs, rhs)
176+ }
177+ fn unchecked_susub ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
178+ self . unchecked_ssub ( lhs, rhs)
179+ }
180+ fn unchecked_smul ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
181+ self . mul ( lhs, rhs)
182+ }
183+ fn unchecked_umul ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
184+ self . mul ( lhs, rhs)
185+ }
186+ fn unchecked_sumul ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value {
187+ // Which to default to is a fairly arbitrary choice,
188+ // but this is what slice layout was using before.
189+ self . unchecked_smul ( lhs, rhs)
190+ }
168191 fn and ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
169192 fn or ( & mut self , lhs : Self :: Value , rhs : Self :: Value ) -> Self :: Value ;
170193 /// Defaults to [`Self::or`], but guarantees `(lhs & rhs) == 0` so some backends
0 commit comments