pub fn target() -> u32 {
1
}
pub fn take(x: u32) -> u32 {
x
}
pub fn c01_direct() {
target(); }
pub fn c02_argument() {
take(target()); }
pub fn c03_binding() {
let _x = target(); }
pub fn c04_closure() {
let _ = Some(1).map(|_| target()); }
pub fn c05_method_chain() {
let _ = Some(target()).map(|x| x + 1).unwrap_or(0); }
pub fn c06_condition() {
if target() > 0 {} }
pub fn c07_match() {
match target() { _ => {}
}
}
pub fn c08_return() -> u32 {
return target(); }
pub fn c09_binary() -> u32 {
take(1) + target() }
pub fn c10_println() {
println!("{}", target()); }
pub fn c11_format() {
let _ = format!("{}", target()); }
pub fn c12_assert_eq() {
assert_eq!(target(), 1); }
pub fn c13_vec() {
let _ = vec![target()]; }
pub fn c14_matches() {
let _ = matches!(target(), 1); }
pub fn c15_function_as_value() {
let _f: fn() -> u32 = target; }
pub trait Tr {
fn tm(&self) -> u32;
}
pub struct Impl0;
impl Tr for Impl0 {
fn tm(&self) -> u32 {
1
}
}
pub fn c16_trait_path(s: &Impl0) -> u32 {
Tr::tm(s) }
pub fn c17_generic_receiver<T: Tr>(s: &T) -> u32 {
T::tm(s) }
pub fn c18_qualified_path(s: &Impl0) -> u32 {
<Impl0 as Tr>::tm(s) }
pub const C19_CONST: u32 = 1 + helper_for_const();
pub fn helper_for_const() -> u32 {
2
}
pub struct ParamType;
pub fn c20_parameter_type(p: &ParamType) -> u32 { let _ = p;
0
}