[INFO] cloning repository https://github.com/alycege/learn-simulation [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/alycege/learn-simulation" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Falycege%2Flearn-simulation", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Falycege%2Flearn-simulation'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] b8ee55e0bb71c8364eac0c714518849dd3dfd9c3 [INFO] checking alycege/learn-simulation/b8ee55e0bb71c8364eac0c714518849dd3dfd9c3 against master#f609b7e0586f81fefb3523e3e17adf779ac416be for pr-129466-2 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Falycege%2Flearn-simulation" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/alycege/learn-simulation on toolchain f609b7e0586f81fefb3523e3e17adf779ac416be [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/alycege/learn-simulation [INFO] finished tweaking git repo https://github.com/alycege/learn-simulation [INFO] tweaked toml for git repo https://github.com/alycege/learn-simulation written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/alycege/learn-simulation already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded structopt-derive v0.4.12 [INFO] [stderr] Downloaded structopt v0.3.19 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:ceb6ea022f8a89cebbe621bb4987e73a935bd40dfbb726f832cfff4742a5b95a" "/opt/rustwide/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] d1e81ea365b87a90cefd907ef3843cbb1ad69950c423b025273c1311038859c1 [INFO] running `Command { std: "docker" "start" "-a" "d1e81ea365b87a90cefd907ef3843cbb1ad69950c423b025273c1311038859c1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d1e81ea365b87a90cefd907ef3843cbb1ad69950c423b025273c1311038859c1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d1e81ea365b87a90cefd907ef3843cbb1ad69950c423b025273c1311038859c1", kill_on_drop: false }` [INFO] [stdout] d1e81ea365b87a90cefd907ef3843cbb1ad69950c423b025273c1311038859c1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:ceb6ea022f8a89cebbe621bb4987e73a935bd40dfbb726f832cfff4742a5b95a" "/opt/rustwide/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c65d90fb7d52ea00c486d730b0e8c05243efaa7169a46b2eabbceb961562518c [INFO] running `Command { std: "docker" "start" "-a" "c65d90fb7d52ea00c486d730b0e8c05243efaa7169a46b2eabbceb961562518c", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.77 [INFO] [stderr] Compiling version_check v0.9.2 [INFO] [stderr] Compiling proc-macro2 v1.0.24 [INFO] [stderr] Compiling unicode-xid v0.2.1 [INFO] [stderr] Compiling getrandom v0.1.15 [INFO] [stderr] Compiling syn v1.0.44 [INFO] [stderr] Checking cfg-if v0.1.10 [INFO] [stderr] Compiling bitflags v1.2.1 [INFO] [stderr] Compiling libm v0.2.1 [INFO] [stderr] Compiling autocfg v1.0.1 [INFO] [stderr] Checking ppv-lite86 v0.2.9 [INFO] [stderr] Compiling unicode-segmentation v1.6.0 [INFO] [stderr] Checking unicode-width v0.1.8 [INFO] [stderr] Checking textwrap v0.11.0 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling num-traits v0.2.12 [INFO] [stderr] Checking vec_map v0.8.2 [INFO] [stderr] Compiling heck v0.3.1 [INFO] [stderr] Checking strsim v0.8.0 [INFO] [stderr] Checking ansi_term v0.11.0 [INFO] [stderr] Checking lazy_static v1.4.0 [INFO] [stderr] Compiling quote v1.0.7 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking clap v2.33.3 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking rand_distr v0.3.0 [INFO] [stderr] Compiling structopt-derive v0.4.12 [INFO] [stderr] Checking structopt v0.3.19 [INFO] [stderr] Checking coral_reef v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::cmp::max` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cmp::max; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `structopt::StructOpt` [INFO] [stdout] --> src/main.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use structopt::StructOpt; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::max` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cmp::max; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:40:56 [INFO] [stdout] | [INFO] [stdout] 40 | (BarrierDirection::Up, BarrierType::In) => (underlying_price > self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 40 - (BarrierDirection::Up, BarrierType::In) => (underlying_price > self.barrier_price), [INFO] [stdout] 40 + (BarrierDirection::Up, BarrierType::In) => underlying_price > self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `structopt::StructOpt` [INFO] [stdout] --> src/main.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use structopt::StructOpt; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:41:57 [INFO] [stdout] | [INFO] [stdout] 41 | (BarrierDirection::Up, BarrierType::Out) => (underlying_price < self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 41 - (BarrierDirection::Up, BarrierType::Out) => (underlying_price < self.barrier_price), [INFO] [stdout] 41 + (BarrierDirection::Up, BarrierType::Out) => underlying_price < self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:40:56 [INFO] [stdout] | [INFO] [stdout] 40 | (BarrierDirection::Up, BarrierType::In) => (underlying_price > self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 40 - (BarrierDirection::Up, BarrierType::In) => (underlying_price > self.barrier_price), [INFO] [stdout] 40 + (BarrierDirection::Up, BarrierType::In) => underlying_price > self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:41:57 [INFO] [stdout] | [INFO] [stdout] 41 | (BarrierDirection::Up, BarrierType::Out) => (underlying_price < self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 41 - (BarrierDirection::Up, BarrierType::Out) => (underlying_price < self.barrier_price), [INFO] [stdout] 41 + (BarrierDirection::Up, BarrierType::Out) => underlying_price < self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:42:58 [INFO] [stdout] | [INFO] [stdout] 42 | (BarrierDirection::Down, BarrierType::In) => (underlying_price < self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 42 - (BarrierDirection::Down, BarrierType::In) => (underlying_price < self.barrier_price), [INFO] [stdout] 42 + (BarrierDirection::Down, BarrierType::In) => underlying_price < self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:42:58 [INFO] [stdout] | [INFO] [stdout] 42 | (BarrierDirection::Down, BarrierType::In) => (underlying_price < self.barrier_price), [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 42 - (BarrierDirection::Down, BarrierType::In) => (underlying_price < self.barrier_price), [INFO] [stdout] 42 + (BarrierDirection::Down, BarrierType::In) => underlying_price < self.barrier_price, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:43:59 [INFO] [stdout] | [INFO] [stdout] 43 | (BarrierDirection::Down, BarrierType::Out) => (underlying_price > self.barrier_price) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 43 - (BarrierDirection::Down, BarrierType::Out) => (underlying_price > self.barrier_price) [INFO] [stdout] 43 + (BarrierDirection::Down, BarrierType::Out) => underlying_price > self.barrier_price [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around match arm expression [INFO] [stdout] --> src/main.rs:43:59 [INFO] [stdout] | [INFO] [stdout] 43 | (BarrierDirection::Down, BarrierType::Out) => (underlying_price > self.barrier_price) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 43 - (BarrierDirection::Down, BarrierType::Out) => (underlying_price > self.barrier_price) [INFO] [stdout] 43 + (BarrierDirection::Down, BarrierType::Out) => underlying_price > self.barrier_price [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:1:41 [INFO] [stdout] | [INFO] [stdout] 1 | use rand::distributions::{Distribution, StandardNormal}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated unit struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:1:41 [INFO] [stdout] | [INFO] [stdout] 1 | use rand::distributions::{Distribution, StandardNormal}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated unit struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:45:23 [INFO] [stdout] | [INFO] [stdout] 45 | let v: Vec = StandardNormal.sample_iter(rng).take(n).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:1:41 [INFO] [stdout] | [INFO] [stdout] 1 | use rand::distributions::{Distribution, StandardNormal}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated unit struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:1:41 [INFO] [stdout] | [INFO] [stdout] 1 | use rand::distributions::{Distribution, StandardNormal}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated unit struct `rand::distributions::StandardNormal`: moved to rand_distr crate [INFO] [stdout] --> src/bin/secretary_problem.rs:45:23 [INFO] [stdout] | [INFO] [stdout] 45 | let v: Vec = StandardNormal.sample_iter(rng).take(n).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0061]: this function takes 6 arguments but 7 arguments were supplied [INFO] [stdout] --> src/main.rs:49:24 [INFO] [stdout] | [INFO] [stdout] 49 | let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, 140.0, 145.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ ----- ----- unexpected argument #7 of type `{float}` [INFO] [stdout] | | [INFO] [stdout] | expected `BarrierOption`, found floating-point number [INFO] [stdout] | [INFO] [stdout] note: function defined here [INFO] [stdout] --> src/main.rs:89:4 [INFO] [stdout] | [INFO] [stdout] 89 | fn simulate_option_price(num_iterations: usize, init_price: f64, n_steps: usize, mu: f64, sigma_sq: f64, barrier: BarrierOption) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ --------------------- --------------- -------------- ------- ------------- ---------------------- [INFO] [stdout] help: remove the extra argument [INFO] [stdout] | [INFO] [stdout] 49 - let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, 140.0, 145.0); [INFO] [stdout] 49 + let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, /* BarrierOption */); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0061]: this function takes 6 arguments but 7 arguments were supplied [INFO] [stdout] --> src/main.rs:49:24 [INFO] [stdout] | [INFO] [stdout] 49 | let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, 140.0, 145.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ ----- ----- unexpected argument #7 of type `{float}` [INFO] [stdout] | | [INFO] [stdout] | expected `BarrierOption`, found floating-point number [INFO] [stdout] | [INFO] [stdout] note: function defined here [INFO] [stdout] --> src/main.rs:89:4 [INFO] [stdout] | [INFO] [stdout] 89 | fn simulate_option_price(num_iterations: usize, init_price: f64, n_steps: usize, mu: f64, sigma_sq: f64, barrier: BarrierOption) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ --------------------- --------------- -------------- ------- ------------- ---------------------- [INFO] [stdout] help: remove the extra argument [INFO] [stdout] | [INFO] [stdout] 49 - let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, 140.0, 145.0); [INFO] [stdout] 49 + let option_price = simulate_option_price(1000, 100.0, 10, 0.25, 5.0, /* BarrierOption */); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/main.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 33 | In => false, [INFO] [stdout] | -- matches any value [INFO] [stdout] 34 | Out => true [INFO] [stdout] | ^^^ no value can reach this [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `In` [INFO] [stdout] --> src/main.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | In => false, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_In` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `Out` [INFO] [stdout] --> src/main.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 34 | Out => true [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_Out` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_direction` which is behind a shared reference [INFO] [stdout] --> src/main.rs:32:15 [INFO] [stdout] | [INFO] [stdout] 32 | match self.barrier_direction { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 33 | In => false, [INFO] [stdout] | -- data moved here [INFO] [stdout] 34 | Out => true [INFO] [stdout] | --- ...and here [INFO] [stdout] | [INFO] [stdout] = note: move occurs because these variables have types that don't implement the `Copy` trait [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 32 | match &self.barrier_direction { [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_direction` which is behind a shared reference [INFO] [stdout] --> src/main.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.barrier_direction` has type `BarrierDirection`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] note: if `BarrierDirection` implemented `Clone`, you could clone the value [INFO] [stdout] --> src/main.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | enum BarrierDirection{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type [INFO] [stdout] ... [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ---------------------- you could clone this value [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_type` which is behind a shared reference [INFO] [stdout] --> src/main.rs:39:40 [INFO] [stdout] | [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ move occurs because `self.barrier_type` has type `BarrierType`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] note: if `BarrierType` implemented `Clone`, you could clone the value [INFO] [stdout] --> src/main.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | enum BarrierType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type [INFO] [stdout] ... [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ----------------- you could clone this value [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/main.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 33 | In => false, [INFO] [stdout] | -- matches any value [INFO] [stdout] 34 | Out => true [INFO] [stdout] | ^^^ no value can reach this [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `In` [INFO] [stdout] --> src/main.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | In => false, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_In` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `Out` [INFO] [stdout] --> src/main.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 34 | Out => true [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_Out` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_direction` which is behind a shared reference [INFO] [stdout] --> src/main.rs:32:15 [INFO] [stdout] | [INFO] [stdout] 32 | match self.barrier_direction { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 33 | In => false, [INFO] [stdout] | -- data moved here [INFO] [stdout] 34 | Out => true [INFO] [stdout] | --- ...and here [INFO] [stdout] | [INFO] [stdout] = note: move occurs because these variables have types that don't implement the `Copy` trait [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 32 | match &self.barrier_direction { [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_direction` which is behind a shared reference [INFO] [stdout] --> src/main.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.barrier_direction` has type `BarrierDirection`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] note: if `BarrierDirection` implemented `Clone`, you could clone the value [INFO] [stdout] --> src/main.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | enum BarrierDirection{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type [INFO] [stdout] ... [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ---------------------- you could clone this value [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: use of moved value: `barrier` [INFO] [stdout] --> src/main.rs:96:88 [INFO] [stdout] | [INFO] [stdout] 89 | fn simulate_option_price(num_iterations: usize, init_price: f64, n_steps: usize, mu: f64, sigma_sq: f64, barrier: BarrierOption) -> f64 { [INFO] [stdout] | ------- move occurs because `barrier` has type `BarrierOption`, which does not implement the `Copy` trait [INFO] [stdout] ... [INFO] [stdout] 92 | for _i in 0..num_iterations { [INFO] [stdout] | --------------------------- inside of this loop [INFO] [stdout] ... [INFO] [stdout] 96 | let price_terminal = option_price_terminal(price_vec, underlying_price_expiry, barrier); [INFO] [stdout] | ^^^^^^^ value moved here, in previous iteration of loop [INFO] [stdout] | [INFO] [stdout] note: consider changing this parameter type in function `option_price_terminal` to borrow instead if owning the value isn't necessary [INFO] [stdout] --> src/main.rs:60:84 [INFO] [stdout] | [INFO] [stdout] 60 | fn option_price_terminal(price_vec: std::vec::Vec, final_price: f64, barrier: BarrierOption) -> BarrierResult { [INFO] [stdout] | --------------------- in this function ^^^^^^^^^^^^^ this parameter takes ownership of the value [INFO] [stdout] help: consider moving the expression out of the loop so it is only moved once [INFO] [stdout] | [INFO] [stdout] 92 ~ let mut value = option_price_terminal(price_vec, underlying_price_expiry, barrier); [INFO] [stdout] 93 ~ for _i in 0..num_iterations { [INFO] [stdout] 94 | let (underlying_price_expiry, price_vec) = generate_underlying_price(init_price, n_steps, mu, sigma_sq); [INFO] [stdout] 95 | [INFO] [stdout] 96 | // Call option [INFO] [stdout] 97 ~ let price_terminal = value; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0507]: cannot move out of `self.barrier_type` which is behind a shared reference [INFO] [stdout] --> src/main.rs:39:40 [INFO] [stdout] | [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ move occurs because `self.barrier_type` has type `BarrierType`, which does not implement the `Copy` trait [INFO] [stdout] | [INFO] [stdout] note: if `BarrierType` implemented `Clone`, you could clone the value [INFO] [stdout] --> src/main.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | enum BarrierType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type [INFO] [stdout] ... [INFO] [stdout] 39 | match (self.barrier_direction, self.barrier_type) { [INFO] [stdout] | ----------------- you could clone this value [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 5 previous errors; 9 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0061, E0382, E0507. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0061`. [INFO] [stdout] [INFO] [stdout] error[E0382]: use of moved value: `barrier` [INFO] [stdout] --> src/main.rs:96:88 [INFO] [stdout] | [INFO] [stdout] 89 | fn simulate_option_price(num_iterations: usize, init_price: f64, n_steps: usize, mu: f64, sigma_sq: f64, barrier: BarrierOption) -> f64 { [INFO] [stdout] | ------- move occurs because `barrier` has type `BarrierOption`, which does not implement the `Copy` trait [INFO] [stdout] ... [INFO] [stdout] 92 | for _i in 0..num_iterations { [INFO] [stdout] | --------------------------- inside of this loop [INFO] [stdout] ... [INFO] [stdout] 96 | let price_terminal = option_price_terminal(price_vec, underlying_price_expiry, barrier); [INFO] [stdout] | ^^^^^^^ value moved here, in previous iteration of loop [INFO] [stdout] | [INFO] [stdout] note: consider changing this parameter type in function `option_price_terminal` to borrow instead if owning the value isn't necessary [INFO] [stdout] --> src/main.rs:60:84 [INFO] [stdout] | [INFO] [stdout] 60 | fn option_price_terminal(price_vec: std::vec::Vec, final_price: f64, barrier: BarrierOption) -> BarrierResult { [INFO] [stdout] | --------------------- in this function ^^^^^^^^^^^^^ this parameter takes ownership of the value [INFO] [stdout] help: consider moving the expression out of the loop so it is only moved once [INFO] [stdout] | [INFO] [stdout] 92 ~ let mut value = option_price_terminal(price_vec, underlying_price_expiry, barrier); [INFO] [stdout] 93 ~ for _i in 0..num_iterations { [INFO] [stdout] 94 | let (underlying_price_expiry, price_vec) = generate_underlying_price(init_price, n_steps, mu, sigma_sq); [INFO] [stdout] 95 | [INFO] [stdout] 96 | // Call option [INFO] [stdout] 97 ~ let price_terminal = value; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 5 previous errors; 9 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0061, E0382, E0507. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0061`. [INFO] [stdout] [INFO] [stderr] error: could not compile `coral_reef` (bin "coral_reef") due to 6 previous errors; 9 warnings emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] warning: function `number_generator` is never used [INFO] [stdout] --> src/bin/secretary_problem.rs:43:4 [INFO] [stdout] | [INFO] [stdout] 43 | fn number_generator(n: usize) -> std::vec::Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `number_generator` is never used [INFO] [stdout] --> src/bin/secretary_problem.rs:43:4 [INFO] [stdout] | [INFO] [stdout] 43 | fn number_generator(n: usize) -> std::vec::Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `coral_reef` (bin "coral_reef" test) due to 6 previous errors; 9 warnings emitted [INFO] [stdout] warning: 4 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 4 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "c65d90fb7d52ea00c486d730b0e8c05243efaa7169a46b2eabbceb961562518c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c65d90fb7d52ea00c486d730b0e8c05243efaa7169a46b2eabbceb961562518c", kill_on_drop: false }` [INFO] [stdout] c65d90fb7d52ea00c486d730b0e8c05243efaa7169a46b2eabbceb961562518c