MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / main

Function main

tests/binary/modules/src/main.rs:240–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238 RootPair { first, second }
239 }
240
241 fn flip(self) -> RootPair<U, T> {
242 RootPair {
243 first: self.second,
244 second: self.first,
245 }
246 }
247}
248
249struct RootMeter {
250 value: i32,
251}
252
253trait RootMeasure {
254 fn read(&self) -> i32;
255 fn add(&mut self, value: i32);
256}
257
258impl RootMeasure for RootMeter {
259 fn read(&self) -> i32 {
260 self.value
261 }
262
263 fn add(&mut self, value: i32) {
264 self.value += value;
265 }
266}
267
268fn root_identity<T>(value: T) -> T {
269 value
270}
271
272fn root_swap<T, U>(left: T, right: U) -> (U, T) {
273 (right, left)
274}
275
276fn root_add(left: i32, right: i32) -> i32 {
277 left + right
278}
279
280fn root_skew(left: i32, right: i32) -> i32 {
281 left * 3 - right
282}
283
284fn root_choose_op(addition: bool) -> fn(i32, i32) -> i32 {
285 if addition { root_add } else { root_skew }
286}
287
288fn root_read_metric(metric: &dyn RootMeasure) -> i32 {
289 metric.read()
290}
291
292fn root_add_metric(metric: &mut dyn RootMeasure, value: i32) -> i32 {
293 metric.add(value);
294 metric.read()
295}
296
297fn root_closure_value(seed: i32) -> i32 {

Callers

nothing calls this directly

Calls 11

shapeFunction · 0.85
labelFunction · 0.85
familyFunction · 0.85
atomFunction · 0.85
make_bondFunction · 0.85
bond_scoreFunction · 0.85
atom_offsetFunction · 0.85
pointFunction · 0.85
translatedMethod · 0.80
doubledMethod · 0.80
as_mathMethod · 0.80

Tested by

no test coverage detected