Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upopt-in built-in bounds traits RFC tracker (optin_builtin_traits) #13231
Comments
flaper87
self-assigned this
Mar 31, 2014
flaper87
changed the title
opt-in built-in trait bounds RFC tracker
opt-in built-in bounds traits RFC tracker
Mar 31, 2014
flaper87
added
B-RFC-approved
labels
Mar 31, 2014
This comment has been minimized.
This comment has been minimized.
|
Marking 1.0, P-backcompat-lang. |
pnkfelix
added
P-backcompat-lang
and removed
I-nominated
labels
Apr 3, 2014
pnkfelix
added this to the 1.0 milestone
Apr 3, 2014
alexcrichton
added
A-traits
labels
Apr 4, 2014
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
I'm actively working on this. Unfortunately, I've moved quite slowly because of other bugs I had to fix. I hope to be able to submit a PR this week. |
added a commit
to flaper87/rust
that referenced
this issue
Apr 28, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 28, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 28, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 28, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
flaper87
referenced this issue
Apr 29, 2014
Closed
De-@ `ty::TypeParameterDef`'s bounds field #13838
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 29, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 30, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 30, 2014
flaper87
referenced this issue
Apr 30, 2014
Merged
Allow built-in traits implementation and add support for deriving #13868
added a commit
to flaper87/rust
that referenced
this issue
Apr 30, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 30, 2014
added a commit
to flaper87/rust
that referenced
this issue
Apr 30, 2014
This comment has been minimized.
This comment has been minimized.
|
@dylanede hmm, sorry I failed to answer your question before. I'm sorry to say this, but your code snippet is not expected to work. In particular, the way to think about it is that, by adding a negative impl for Note that the behavior for your example is inconsistent already. For example, while your code compiles, this similar snippet does not. I had to dig a bit into the code to see why your example worked at all: the answer is that the "first pass" test which tries to unify with various impls fails to unify for types like |
nrc
added
the
B-RFC-implemented
label
Aug 29, 2016
This comment has been minimized.
This comment has been minimized.
|
This is… beyond me. Someday maybe. But I'm trying to document all the things, so: can someone take a gander at the reference and the book and give me a reasonable summary of the extent to which this is or isn't documented? |
This comment has been minimized.
This comment has been minimized.
|
I just wanted to note that if we add immovable types in it's current form, default traits would have to be declared with |
mbrubeck
changed the title
opt-in built-in bounds traits RFC tracker
opt-in built-in bounds traits RFC tracker (optin_builtin_traits)
May 1, 2017
Ms2ger
referenced this issue
May 1, 2017
Open
Tracking: Unstable Rust feature gates used by Servo #5286
tomaka
referenced this issue
Jul 7, 2017
Open
About buffer content in descriptor sets and signalling NaNs #608
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 20, 2017
Mark-Simulacrum
removed
C-enhancement
C-feature-request
labels
Jul 27, 2017
added a commit
that referenced
this issue
Nov 1, 2017
added a commit
that referenced
this issue
Nov 1, 2017
added a commit
that referenced
this issue
Nov 2, 2017
added a commit
that referenced
this issue
Nov 2, 2017
added a commit
that referenced
this issue
Nov 3, 2017
This comment has been minimized.
This comment has been minimized.
|
Resuming the bikeshed which I had previously missed, not quite sold on the new In #45247 an alternative of |
qnighy
referenced this issue
Dec 20, 2017
Open
Negative impls of Auto Traits (OIBIT) don't take into account Trait Bounds #46813
This comment has been minimized.
This comment has been minimized.
|
Random thing I noticed is that OIBIT (hackily) allows checking for type equality (and hence type inequality): // sealed for good measure
mod private {
pub auto trait NotSame {}
impl<T> !NotSame for (T, T) {}
}
use NotSame;
trait ReqDifferent<T> where (T, Self): NotSame {}
trait ReqSame<T> where (T, Self): !NotSame {}I assume that this is not desired. |
This comment has been minimized.
This comment has been minimized.
|
No, it's not. This behaviour is a bug, See the responses to #13231 (comment) |
This comment has been minimized.
This comment has been minimized.
|
Wow, I completely missed that comment. Appears that this has already been discussed |
dtolnay
referenced this issue
Jun 7, 2018
Closed
Use auto traits to improve compile-time checking of internally tagged newtype variants #1308
This comment has been minimized.
This comment has been minimized.
|
I ran into this issue when trying to implement |
pushed a commit
to dlrobertson/rust
that referenced
this issue
Nov 29, 2018
This comment has been minimized.
This comment has been minimized.
|
Added #56934 |
flaper87 commentedMar 31, 2014
•
edited by arielb1
Checklist
Here is a check-list of code to write and tricky scenarios to be sure we handle:
impl !Pod for ..should not be legal #28475impl Foo for ..#23225impl Foo for ..Send/Syncto use new infrastructure internallyunsafe impl Send for ../unsafe impl Sync for ..constituent_typesOriginal text
This is a tracking issue for the approved RFC opt-in-builtin-traits
Nominating