Skip to content

Commit a51be8e

Browse files
committed
Allow manual implementations of built-in traits
[RFC rust-lang#3] cc rust-lang#13231
1 parent a3f9f37 commit a51be8e

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

src/librustc/middle/typeck/collect.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,7 @@ pub fn convert(ccx: &CrateCtxt, it: &ast::Item) {
631631
parent_visibility);
632632

633633
for trait_ref in opt_trait_ref.iter() {
634-
let trait_ref = instantiate_trait_ref(ccx, trait_ref, selfty);
635-
636-
// Prevent the builtin kind traits from being manually implemented.
637-
if tcx.lang_items.to_builtin_kind(trait_ref.def_id).is_some() {
638-
tcx.sess.span_err(it.span,
639-
"cannot provide an explicit implementation \
640-
for a builtin kind");
641-
}
634+
instantiate_trait_ref(ccx, trait_ref, selfty);
642635
}
643636
},
644637
ast::ItemTrait(ref generics, _, _, ref trait_methods) => {

src/test/compile-fail/cant-implement-builtin-kinds.rs

-19
This file was deleted.

0 commit comments

Comments
 (0)