Решение на (Floating) Points and Vectors от Християн Захариев

Обратно към всички решения

Към профила на Християн Захариев

Резултати

  • 0 точки от тестове
  • 0 бонус точки
  • 0 точки общо
  • 0 успешни тест(а)
  • 0 неуспешни тест(а)

Код

use std::ops::Add;
use std::ops::Sub;
use std::ops::Mul;
// WORST CODE EU :(:(:(:(:(
#[derive(Debug, Clone, Copy)]
pub struct Point {
x: f64,
y: f64,
z: f64
}
impl Point {
pub fn new(x: f64, y: f64, z: f64) -> Self {
Point { x, y, z}
}
}
impl Add<Vector> for Point {
type Output = Point;
fn add(self, other: Vector) -> Self::Output {
Point {x: self.x + other.x, y: self.y + other.y, z: self.z + other.z}
}
}
impl PartialEq for Point {
fn eq(&self, other: &Point) -> bool {
(self.x - other.x).abs() < std::f64::EPSILON &&
(self.y - other.y).abs() < std::f64::EPSILON &&
(self.z - other.z).abs() < std::f64::EPSILON
}
}
impl Eq for Point {}
impl Sub for Point {
type Output = Vector;
fn sub(self, other: Point) -> Vector {
Vector {x: self.x - other.x, y: self.y - other.y, z: self.z - other.z}
}
}
#[derive(Debug, Clone, Copy)]
pub struct Vector {
x: f64,
y: f64,
z: f64
}
impl Vector {
pub fn new(x: f64, y: f64, z: f64) -> Self {
Vector {x, y, z}
}
}
impl Add for Vector {
type Output = Vector;
fn add(self, other: Vector) -> Self::Output {
Vector {x: self.x + other.x, y: self.y + other.y, z: self.z + other.z}
}
}
impl Mul<Vector> for f64 {
type Output = Vector;
fn mul(self, rhs: Vector) -> Vector {
Vector {x: self * rhs.x, y: self * rhs.y, z: self * rhs.y}
}
}
impl Mul<f64> for Vector {
type Output = Vector;
fn mul(self, rhs: f64) -> Self {
Vector {x: self.x * rhs, y: self.y * rhs, z: self.z * rhs}
}
}
impl Mul<Vector> for Vector {
type Output = f64;
fn mul(self, rhs: Vector) -> f64 {
return self.x * rhs.x + self.y * rhs.y + self.z * rhs.z
}
}
impl PartialEq for Vector {
fn eq(&self, other: &Vector) -> bool {
(self.x - other.x).abs() < std::f64::EPSILON &&
(self.y - other.y).abs() < std::f64::EPSILON &&
(self.z - other.z).abs() < std::f64::EPSILON
}
}
impl Eq for Vector {}
pub struct Line {
x: f64,
y: f64,
z: f64
}
impl Line {
/// Конструиране на линия през две точки, които минават през нея. Две различни точки са
/// достатъчни, за да дефинират еднозначно линия.
///
/// Можете да получите точка и вектор, като извадите едната от другата точка.
///
/// Ако точките са една и съща, очакваме да върнете None.
///
pub fn from_pp(p1: Point, p2: Point) -> Option<Self> {
unimplemented!()
}
/// Конструиране на линия през точка за начало, и вектор, който определя посоката. Стига
/// вектора да е ненулев, това е достатъчно, за да дефинира еднозначно линия.
///
/// Може да получите две точки, като съберете дадената с вектора.
///
/// Ако вектора е нулев, очакваме да върнете None.
///
pub fn from_pv(p: Point, v: Vector) -> Option<Self> {
unimplemented!()
}
}
fn main() {
let v1 = Vector::new(1.0, 1.0, 1.0);
let v2 = Vector::new(2.0, 2.0, 2.0);
let p1 = Point::new(1.0, 1.0, 1.0);
let p2 = Point::new(2.0, 2.0, 2.0);
assert_eq!(p1 + v1, p2);
assert_eq!(p2 - p1, v1);
assert_eq!(v1 + v1, v2);
assert_eq!(2.0 * v1, v2);
assert_eq!(v1 * v2, 6.0);
}

Лог от изпълнението

Compiling solution v0.1.0 (/tmp/d20190123-22631-xvo02q/solution)
warning: unused variable: `p1`
   --> src/lib.rs:116:20
    |
116 |     pub fn from_pp(p1: Point, p2: Point) -> Option<Self> {
    |                    ^^ help: consider using `_p1` instead
    |
    = note: #[warn(unused_variables)] on by default

warning: unused variable: `p2`
   --> src/lib.rs:116:31
    |
116 |     pub fn from_pp(p1: Point, p2: Point) -> Option<Self> {
    |                               ^^ help: consider using `_p2` instead

warning: unused variable: `p`
   --> src/lib.rs:127:20
    |
127 |     pub fn from_pv(p: Point, v: Vector) -> Option<Self> {
    |                    ^ help: consider using `_p` instead

warning: unused variable: `v`
   --> src/lib.rs:127:30
    |
127 |     pub fn from_pv(p: Point, v: Vector) -> Option<Self> {
    |                              ^ help: consider using `_v` instead

warning: field is never used: `x`
   --> src/lib.rs:103:5
    |
103 |     x: f64,
    |     ^^^^^^
    |
    = note: #[warn(dead_code)] on by default

warning: field is never used: `y`
   --> src/lib.rs:104:5
    |
104 |     y: f64,
    |     ^^^^^^

warning: field is never used: `z`
   --> src/lib.rs:105:5
    |
105 |     z: f64
    |     ^^^^^^

warning: function is never used: `main`
   --> src/lib.rs:133:1
    |
133 | fn main() {
    | ^^^^^^^^^

warning: unused variable: `p1`
   --> src/lib.rs:116:20
    |
116 |     pub fn from_pp(p1: Point, p2: Point) -> Option<Self> {
    |                    ^^ help: consider using `_p1` instead
    |
    = note: #[warn(unused_variables)] on by default

warning: unused variable: `p2`
   --> src/lib.rs:116:31
    |
116 |     pub fn from_pp(p1: Point, p2: Point) -> Option<Self> {
    |                               ^^ help: consider using `_p2` instead

warning: unused variable: `p`
   --> src/lib.rs:127:20
    |
127 |     pub fn from_pv(p: Point, v: Vector) -> Option<Self> {
    |                    ^ help: consider using `_p` instead

warning: unused variable: `v`
   --> src/lib.rs:127:30
    |
127 |     pub fn from_pv(p: Point, v: Vector) -> Option<Self> {
    |                              ^ help: consider using `_v` instead

warning: field is never used: `x`
   --> src/lib.rs:103:5
    |
103 |     x: f64,
    |     ^^^^^^
    |
    = note: #[warn(dead_code)] on by default

warning: field is never used: `y`
   --> src/lib.rs:104:5
    |
104 |     y: f64,
    |     ^^^^^^

warning: field is never used: `z`
   --> src/lib.rs:105:5
    |
105 |     z: f64
    |     ^^^^^^

error[E0369]: binary operation `^` cannot be applied to type `solution::Vector`
   --> tests/solution_test.rs:131:16
    |
131 |     assert_eq!(v!(1.0, -1.0, 0.0) ^ v!(-1.0, 1.0, 0.0), v!(0.0, 0.0, 0.0));
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `solution::Vector`

error[E0369]: binary operation `^` cannot be applied to type `solution::Vector`
   --> tests/solution_test.rs:133:16
    |
133 |     assert_eq!(v!(1.0, -1.0, 0.0) ^ v!(2.0, -2.0, 0.0), v!(0.0, 0.0, 0.0));
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `solution::Vector`

error[E0369]: binary operation `^` cannot be applied to type `solution::Vector`
   --> tests/solution_test.rs:136:16
    |
136 |     assert_eq!(v!(1.0, 2.0, 3.0) ^ v!(3.0, 2.0, 1.0), v!(-4.0, 8.0, -4.0));
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `solution::Vector`

error[E0369]: binary operation `^` cannot be applied to type `solution::Vector`
   --> tests/solution_test.rs:137:16
    |
137 |     assert_eq!(v!(1.0, 1.0, 0.0) ^ v!(1.0, 2.0, 0.0), v!(0.0, 0.0, 1.0));
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `solution::Vector`

error[E0369]: binary operation `^` cannot be applied to type `solution::Vector`
   --> tests/solution_test.rs:138:16
    |
138 |     assert_eq!(v!(-1.0, 1.0, 0.0) ^ v!(-1.0, 2.0, 0.0), v!(0.0, 0.0, -1.0));
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `solution::Vector`

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:164:5
    |
164 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:164:5
    |
164 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:164:5
    |
164 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:165:5
    |
165 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:165:5
    |
165 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:165:5
    |
165 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:171:5
    |
171 |     assert_eq!(Line::from_pv(p, v1), Line::from_pv(p, v1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:171:5
    |
171 |     assert_eq!(Line::from_pv(p, v1), Line::from_pv(p, v1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:171:5
    |
171 |     assert_eq!(Line::from_pv(p, v1), Line::from_pv(p, v1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:172:5
    |
172 |     assert_ne!(Line::from_pv(p, v1), Line::from_pv(p, v2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:172:5
    |
172 |     assert_ne!(Line::from_pv(p, v1), Line::from_pv(p, v2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:172:5
    |
172 |     assert_ne!(Line::from_pv(p, v1), Line::from_pv(p, v2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0599]: no method named `distance` found for type `solution::Line` in the current scope
   --> tests/solution_test.rs:183:19
    |
183 |     assert!((line.distance(p1) - 2.0_f64.sqrt()/2.0).abs() < EPS * 1000.0);
    |                   ^^^^^^^^

error[E0599]: no method named `distance` found for type `solution::Line` in the current scope
   --> tests/solution_test.rs:184:18
    |
184 |     assert!(line.distance(p4) < EPS * 1000.0);
    |                  ^^^^^^^^

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:206:5
    |
206 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p2, p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:206:5
    |
206 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p2, p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:206:5
    |
206 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p2, p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:209:5
    |
209 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:209:5
    |
209 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:209:5
    |
209 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:212:5
    |
212 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:212:5
    |
212 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:212:5
    |
212 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pp(p1 + offset, p2 + offset));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:215:5
    |
215 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:215:5
    |
215 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:215:5
    |
215 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:216:5
    |
216 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:216:5
    |
216 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:216:5
    |
216 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:217:5
    |
217 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:217:5
    |
217 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:217:5
    |
217 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pp(p1 + shift, p2 + shift));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:226:5
    |
226 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, 2.0 * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:226:5
    |
226 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, 2.0 * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:226:5
    |
226 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, 2.0 * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:227:5
    |
227 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, (1.0/3.0) * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:227:5
    |
227 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, (1.0/3.0) * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:227:5
    |
227 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, (1.0/3.0) * v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:229:5
    |
229 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:229:5
    |
229 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:229:5
    |
229 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:230:5
    |
230 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:230:5
    |
230 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:230:5
    |
230 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:231:5
    |
231 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:231:5
    |
231 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:231:5
    |
231 |     assert_eq!(Line::from_pv(p, v), Line::from_pv(p + small, v + small));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:233:5
    |
233 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p, v + v!(0.1, 0.0, 0.0)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:233:5
    |
233 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p, v + v!(0.1, 0.0, 0.0)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:233:5
    |
233 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p, v + v!(0.1, 0.0, 0.0)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:234:5
    |
234 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p + v!(0.1, 0.0, 0.0), v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:234:5
    |
234 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p + v!(0.1, 0.0, 0.0), v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:234:5
    |
234 |     assert_ne!(Line::from_pv(p, v), Line::from_pv(p + v!(0.1, 0.0, 0.0), v));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:243:5
    |
243 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p2 - p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:243:5
    |
243 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p2 - p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:243:5
    |
243 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p2 - p1));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:244:5
    |
244 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:244:5
    |
244 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:244:5
    |
244 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p2));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:245:5
    |
245 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, 2.0 * (p1 - p2)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:245:5
    |
245 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, 2.0 * (p1 - p2)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:245:5
    |
245 |     assert_eq!(Line::from_pp(p1, p2), Line::from_pv(p1, 2.0 * (p1 - p2)));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<solution::Line>`
   --> tests/solution_test.rs:246:5
    |
246 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<solution::Line>`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:246:5
    |
246 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: `solution::Line` doesn't implement `std::fmt::Debug`
   --> tests/solution_test.rs:246:5
    |
246 |     assert_ne!(Line::from_pp(p1, p2), Line::from_pv(p1, p1 - p3));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `solution::Line` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `solution::Line`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `std::option::Option<solution::Line>`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&std::option::Option<solution::Line>`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 70 previous errors

Some errors occurred: E0277, E0369, E0599.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `solution`.

To learn more, run the command again with --verbose.

История (1 версия и 2 коментара)

Християн качи първо решение на 26.11.2018 16:58 (преди почти 7 години)

Липсват ти доста неща compile-time, за нещастие. Оператора BitXor, и доста trait-ове на Line (Debug го derive-нахме и в условието, но вероятно си го изпуснал). Това, което има, изглежда сравнително разумно, но това бяха лесните неща. Другия път по-рано, домашните си искат време и внимателно четене на условия :).