From eb4d39e1fef918242a5dba2a09d7b9faa437b911 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 25 Jan 2013 16:57:39 -0800 Subject: 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. --- src/libsyntax/parse/comments.rs | 2 +- src/libsyntax/parse/lexer.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 66c3111b309..fbe258852e2 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -11,7 +11,7 @@ use core::prelude::*; use ast; -use codemap::{BytePos, CharPos, CodeMap, FileMap}; +use codemap::{BytePos, CharPos, CodeMap, FileMap, Pos}; use diagnostic; use parse::lexer::{is_whitespace, get_str_from, reader}; use parse::lexer::{string_reader, bump, is_eof, nextch}; diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 1574a037a46..5a0f40f3c12 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -12,7 +12,7 @@ use core::prelude::*; use ast; use ast_util; -use codemap::{span, CodeMap, CharPos, BytePos}; +use codemap::{BytePos, CharPos, CodeMap, Pos, span}; use codemap; use diagnostic::span_handler; use ext::tt::transcribe::{tt_next_token}; -- cgit 1.4.1-3-g733a5