initial commit
This commit is contained in:
4
exercises/04_traits/02_orphan_rule/Cargo.toml
Normal file
4
exercises/04_traits/02_orphan_rule/Cargo.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
[package]
|
||||
name = "orphan"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
11
exercises/04_traits/02_orphan_rule/src/lib.rs
Normal file
11
exercises/04_traits/02_orphan_rule/src/lib.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
// TODO: this is an example of an orphan rule violation.
|
||||
// We're implementing a foreign trait (`PartialEq`, from `std`) on
|
||||
// a foreign type (`u32`, from `std`).
|
||||
// Look at the compiler error to get familiar with what it looks like.
|
||||
// Then delete the code below and move on to the next exercise.
|
||||
|
||||
impl PartialEq for u32 {
|
||||
fn eq(&self, _other: &Self) -> bool {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user