-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow trait-less impls on primitive types when in the corresponding libcore module for each type #6065
Comments
Still relevant. I thought a potential solution was to move the builtin types to std::unstable, and do like |
This would be incredibly nice to have, in order to clear out a bunch of useless one use traits. |
I would rather have the compiler provide the type, but it could be "owned" by the crate which defines it. #[lang="char"] struct char;
// `char` is now a type defined in the same crate,
// but behaves just like the current built-in type.
impl char {...} |
This issue has been moved to the RFCs repo: rust-lang/rfcs#286 |
…-macro, r=Manishearth Forbid redundant_pattern_matching triggering in macros fixes rust-lang#6065 changelog: forbid redundant_pattern_matching triggering in macros
I filed #6045 before I realized that you have to make useless traits to implement methods on primitives. However, we already use lang items to identify
core::char
as the "canonical" char module, yes? Is it possible then to allow impls directly uponchar
from withincore::char
, since we know that it won't have anonymous impls anywhere else? This is what I'd like to be able to do:without having to make a useless trait first:
This is somewhat more pertinent now that #3048 is WONTFIX.
The text was updated successfully, but these errors were encountered: