diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-01-25 16:57:39 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-01-29 10:42:45 -0800 |
| commit | eb4d39e1fef918242a5dba2a09d7b9faa437b911 (patch) | |
| tree | 92d923119a6d8f1b16d83c2214e8acf9d0dd25e6 /src/libsyntax/ext | |
| parent | f1e78c6dd7dc41a9937c466a7af5d0efc779909f (diff) | |
| download | rust-eb4d39e1fef918242a5dba2a09d7b9faa437b911.tar.gz rust-eb4d39e1fef918242a5dba2a09d7b9faa437b911.zip | |
libstd: Remove "dual impls" from the language and enforce coherence rules. r=brson
"Dual impls" are impls that are both type implementations and trait implementations. They can lead to ambiguity and so this patch removes them from the language. This also enforces coherence rules. Without this patch, records can implement traits not defined in the current crate. This patch fixes this, and updates all of rustc to adhere to the new enforcement. Most of this patch is fixing rustc to obey the coherence rules, which involves converting a bunch of records to structs.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/mod.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 343ce4b039b..8a5b8a127d0 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -66,7 +66,7 @@ impl @ast::path: append_types { } } -trait ext_ctxt_ast_builder { +pub trait ext_ctxt_ast_builder { fn ty_param(id: ast::ident, +bounds: ~[ast::ty_param_bound]) -> ast::ty_param; fn arg(name: ident, ty: @ast::Ty) -> ast::arg; diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs index 8eef065395e..f91ec1ea48f 100644 --- a/src/libsyntax/ext/pipes/mod.rs +++ b/src/libsyntax/ext/pipes/mod.rs @@ -49,6 +49,7 @@ use codemap::span; use ext::base; use ext::base::ext_ctxt; use ext::pipes::parse_proto::proto_parser; +use ext::pipes::pipec::gen_init; use ext::pipes::proto::{visit, protocol}; use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index e53057cb312..774a5596258 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -13,7 +13,8 @@ use ast::ident; use ast_util::dummy_sp; use ext::base::ext_ctxt; -use ext::pipes::ast_builder::{append_types, path, path_global}; +use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path}; +use ext::pipes::ast_builder::{path_global}; use ext::pipes::proto::*; use ext::quote::rt::*; use parse::*; @@ -35,7 +36,7 @@ trait to_type_decls { fn to_endpoint_decls(cx: ext_ctxt, dir: direction) -> ~[@ast::item]; } -trait gen_init { +pub trait gen_init { fn gen_init(cx: ext_ctxt) -> @ast::item; fn compile(cx: ext_ctxt) -> @ast::item; fn buffer_ty_path(cx: ext_ctxt) -> @ast::Ty; diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 26638cd8cd6..9d24b3db724 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -13,7 +13,7 @@ use core::prelude::*; use ast; use codemap::span; use ext::base::ext_ctxt; -use ext::pipes::ast_builder::{path, append_types}; +use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path}; use core::cmp; use core::dvec::DVec; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 3354d015476..7605e01fbf0 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -10,7 +10,7 @@ use ast; use attr; -use codemap::{span, BytePos}; +use codemap::{BytePos, Pos, span}; use ext::base::ext_ctxt; use ext::base; use ext::build; diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 3ade0bf86b1..4ecbbdc9760 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -9,7 +9,7 @@ // except according to those terms. use codemap; -use codemap::{span, Loc, FileMap}; +use codemap::{FileMap, Loc, Pos, span}; use ext::base::*; use ext::base; use ext::build::{mk_base_vec_e, mk_uint, mk_u8, mk_base_str}; |
