Skip to content

Impl ImplicitClone on bool, usize and isize#9

Merged
ranile merged 2 commits into
yewstack:mainfrom
cecton:cecton-impl-implicit-clone-on-bool
Nov 30, 2022
Merged

Impl ImplicitClone on bool, usize and isize#9
ranile merged 2 commits into
yewstack:mainfrom
cecton:cecton-impl-implicit-clone-on-bool

Conversation

@cecton
Copy link
Copy Markdown
Contributor

@cecton cecton commented Jul 28, 2022

Related to yewstack/yew#2792

@cecton cecton changed the title Impl ImplicitClone on bool Impl ImplicitClone on bool, usize and isize Jul 28, 2022
@ranile
Copy link
Copy Markdown
Member

ranile commented Jul 28, 2022

We should add a blanket impl for Copy types. Those are always cheap to clone

@cecton
Copy link
Copy Markdown
Contributor Author

cecton commented Jul 28, 2022

Would have been nice but it doesn't accept it

error[E0119]: conflicting implementations of trait `ImplicitClone` for type `std::sync::Arc<_>`
  --> src/lib.rs:51:1
   |
51 | impl<T: Copy> ImplicitClone for T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::sync::Arc<_>`
   |
  ::: src/sync.rs:11:1
   |
11 | impl<T: ?Sized> ImplicitClone for Rc<T> {}
   | --------------------------------------- first implementation here
   |
   = note: upstream crates may add a new impl of trait `std::marker::Copy` for type `std::sync::Arc<_>` in future versions

@cecton
Copy link
Copy Markdown
Contributor Author

cecton commented Nov 30, 2022

@hamza1311 yup I checked again and I think it's not possible. If it's okay for you can we merge this? It's kind of a pain that some primitives are missing like that

@ranile ranile merged commit 866637b into yewstack:main Nov 30, 2022
@cecton cecton deleted the cecton-impl-implicit-clone-on-bool branch November 30, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants