Skip to content

Commit

Permalink
Allow manual implementations of built-in traits
Browse files Browse the repository at this point in the history
[RFC #3]

cc #13231
  • Loading branch information
flaper87 committed Apr 30, 2014
1 parent a3f9f37 commit a51be8e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
9 changes: 1 addition & 8 deletions src/librustc/middle/typeck/collect.rs
Expand Up @@ -631,14 +631,7 @@ pub fn convert(ccx: &CrateCtxt, it: &ast::Item) {
parent_visibility);

for trait_ref in opt_trait_ref.iter() {
let trait_ref = instantiate_trait_ref(ccx, trait_ref, selfty);

// Prevent the builtin kind traits from being manually implemented.
if tcx.lang_items.to_builtin_kind(trait_ref.def_id).is_some() {
tcx.sess.span_err(it.span,
"cannot provide an explicit implementation \
for a builtin kind");
}
instantiate_trait_ref(ccx, trait_ref, selfty);
}
},
ast::ItemTrait(ref generics, _, _, ref trait_methods) => {
Expand Down
19 changes: 0 additions & 19 deletions src/test/compile-fail/cant-implement-builtin-kinds.rs

This file was deleted.

0 comments on commit a51be8e

Please sign in to comment.