Skip to content

Commit f3548d0

Browse files
committed
---
yaml --- r: 80695 b: refs/heads/try c: b7435cf h: refs/heads/master i: 80693: e4a8078 80691: a689e30 80687: 4df5489 v: v3
1 parent 261ce1b commit f3548d0

File tree

12 files changed

+88
-53
lines changed

12 files changed

+88
-53
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: de5b9b9a0bafe493691d350d8184d2a6390289da
5+
refs/heads/try: b7435cf44783c9ab6cf16bc387299ed9891ae90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,11 +1202,10 @@ pub fn get_struct_fields(intr: @ident_interner, cdata: Cmd, id: ast::NodeId)
12021202
do reader::tagged_docs(item, tag_item_field) |an_item| {
12031203
let f = item_family(an_item);
12041204
if f == PublicField || f == PrivateField || f == InheritedField {
1205-
// FIXME #6993: name should be of type Name, not Ident
12061205
let name = item_name(intr, an_item);
12071206
let did = item_def_id(an_item, cdata);
12081207
result.push(ty::field_ty {
1209-
name: name.name,
1208+
ident: name,
12101209
id: did, vis:
12111210
struct_field_family_to_visibility(f),
12121211
});
@@ -1216,7 +1215,7 @@ pub fn get_struct_fields(intr: @ident_interner, cdata: Cmd, id: ast::NodeId)
12161215
do reader::tagged_docs(item, tag_item_unnamed_field) |an_item| {
12171216
let did = item_def_id(an_item, cdata);
12181217
result.push(ty::field_ty {
1219-
name: special_idents::unnamed_field.name,
1218+
ident: special_idents::unnamed_field,
12201219
id: did,
12211220
vis: ast::inherited,
12221221
});

branches/try/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ pub fn specialize(cx: &MatchCheckCtxt,
700700
}
701701
let args = class_fields.iter().map(|class_field| {
702702
match flds.iter().find(|f|
703-
f.ident.name == class_field.name) {
703+
f.ident == class_field.ident) {
704704
Some(f) => f.pat,
705705
_ => wild()
706706
}

branches/try/src/librustc/middle/mem_categorization.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ impl mem_categorization_ctxt {
10591059
/// an enum to determine which variant is in use.
10601060
pub fn field_mutbl(tcx: ty::ctxt,
10611061
base_ty: ty::t,
1062-
// FIXME #6993: change type to Name
10631062
f_name: ast::Ident,
10641063
node_id: ast::NodeId)
10651064
-> Option<ast::Mutability> {
@@ -1068,7 +1067,7 @@ pub fn field_mutbl(tcx: ty::ctxt,
10681067
ty::ty_struct(did, _) => {
10691068
let r = ty::lookup_struct_fields(tcx, did);
10701069
for fld in r.iter() {
1071-
if fld.name == f_name.name {
1070+
if fld.ident == f_name {
10721071
return Some(ast::MutImmutable);
10731072
}
10741073
}
@@ -1078,7 +1077,7 @@ pub fn field_mutbl(tcx: ty::ctxt,
10781077
ast::DefVariant(_, variant_id, _) => {
10791078
let r = ty::lookup_struct_fields(tcx, variant_id);
10801079
for fld in r.iter() {
1081-
if fld.name == f_name.name {
1080+
if fld.ident == f_name {
10821081
return Some(ast::MutImmutable);
10831082
}
10841083
}

branches/try/src/librustc/middle/privacy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,10 @@ impl PrivacyVisitor {
203203
}
204204

205205
// Checks that a private field is in scope.
206-
// FIXME #6993: change type (and name) from Ident to Name
207206
fn check_field(&mut self, span: Span, id: ast::DefId, ident: ast::Ident) {
208207
let fields = ty::lookup_struct_fields(self.tcx, id);
209208
for field in fields.iter() {
210-
if field.name != ident.name { loop; }
209+
if field.ident.name != ident.name { loop; }
211210
if field.vis == private {
212211
self.tcx.sess.span_err(span, fmt!("field `%s` is private",
213212
token::ident_to_str(&ident)));

branches/try/src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ fn enter_opt<'r>(bcx: @mut Block,
672672
let r = ty::lookup_struct_fields(tcx, struct_id);
673673
for field in r.iter() {
674674
match field_pats.iter().find(|p| p.ident.name
675-
== field.name) {
675+
== field.ident.name) {
676676
None => reordered_patterns.push(dummy),
677677
Some(fp) => reordered_patterns.push(fp.pat)
678678
}

branches/try/src/librustc/middle/ty.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub enum SelfMode {
156156
}
157157

158158
pub struct field_ty {
159-
name: Name,
159+
ident: Ident,
160160
id: DefId,
161161
vis: ast::visibility,
162162
}
@@ -1757,7 +1757,7 @@ fn type_is_newtype_immediate(cx: ctxt, ty: t) -> bool {
17571757
ty_struct(def_id, ref substs) => {
17581758
let fields = struct_fields(cx, def_id, substs);
17591759
fields.len() == 1 &&
1760-
fields[0].ident.name == token::special_idents::unnamed_field.name &&
1760+
fields[0].ident == token::special_idents::unnamed_field &&
17611761
type_is_immediate(cx, fields[0].mt.ty)
17621762
}
17631763
_ => false
@@ -4227,15 +4227,15 @@ fn struct_field_tys(fields: &[@struct_field]) -> ~[field_ty] {
42274227
match field.node.kind {
42284228
named_field(ident, visibility) => {
42294229
field_ty {
4230-
name: ident.name,
4230+
ident: ident,
42314231
id: ast_util::local_def(field.node.id),
42324232
vis: visibility,
42334233
}
42344234
}
42354235
unnamed_field => {
42364236
field_ty {
4237-
name:
4238-
syntax::parse::token::special_idents::unnamed_field.name,
4237+
ident:
4238+
syntax::parse::token::special_idents::unnamed_field,
42394239
id: ast_util::local_def(field.node.id),
42404240
vis: ast::public,
42414241
}
@@ -4250,8 +4250,7 @@ pub fn struct_fields(cx: ctxt, did: ast::DefId, substs: &substs)
42504250
-> ~[field] {
42514251
do lookup_struct_fields(cx, did).map |f| {
42524252
field {
4253-
// FIXME #6993: change type of field to Name and get rid of new()
4254-
ident: ast::Ident::new(f.name),
4253+
ident: f.ident,
42554254
mt: mt {
42564255
ty: lookup_field_type(cx, did, f.id, substs),
42574256
mutbl: MutImmutable
@@ -4267,6 +4266,7 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
42674266
static tycat_int: int = 3;
42684267
static tycat_float: int = 4;
42694268
static tycat_bot: int = 5;
4269+
static tycat_raw_ptr: int = 6;
42704270

42714271
static opcat_add: int = 0;
42724272
static opcat_sub: int = 1;
@@ -4310,6 +4310,7 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
43104310
ty_int(_) | ty_uint(_) | ty_infer(IntVar(_)) => tycat_int,
43114311
ty_float(_) | ty_infer(FloatVar(_)) => tycat_float,
43124312
ty_bot => tycat_bot,
4313+
ty_ptr(_) => tycat_raw_ptr,
43134314
_ => tycat_other
43144315
}
43154316
}
@@ -4324,7 +4325,8 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
43244325
/*char*/ [f, f, f, f, t, t, f, f],
43254326
/*int*/ [t, t, t, t, t, t, t, f],
43264327
/*float*/ [t, t, t, f, t, t, f, f],
4327-
/*bot*/ [t, t, t, t, f, f, t, t]];
4328+
/*bot*/ [t, t, t, t, f, f, t, t],
4329+
/*raw ptr*/ [f, f, f, f, t, t, f, f]];
43284330

43294331
return tbl[tycat(cx, ty)][opcat(op)];
43304332
}

branches/try/src/librustc/middle/typeck/check/_match.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use middle::typeck::require_same_types;
2121
use std::hashmap::{HashMap, HashSet};
2222
use syntax::ast;
2323
use syntax::ast_util;
24-
use syntax::parse::token;
2524
use syntax::codemap::Span;
2625
use syntax::print::pprust;
2726

@@ -297,7 +296,7 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
297296
// Index the class fields.
298297
let mut field_map = HashMap::new();
299298
for (i, class_field) in class_fields.iter().enumerate() {
300-
field_map.insert(class_field.name, i);
299+
field_map.insert(class_field.ident.name, i);
301300
}
302301
303302
// Typecheck each field.
@@ -334,7 +333,7 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
334333
}
335334
tcx.sess.span_err(span,
336335
fmt!("pattern does not mention field `%s`",
337-
token::interner_get(field.name)));
336+
tcx.sess.str_of(field.ident)));
338337
}
339338
}
340339
}

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ pub fn lookup_field_ty(tcx: ty::ctxt,
11201120
fieldname: ast::Name,
11211121
substs: &ty::substs) -> Option<ty::t> {
11221122

1123-
let o_field = items.iter().find(|f| f.name == fieldname);
1123+
let o_field = items.iter().find(|f| f.ident.name == fieldname);
11241124
do o_field.map() |f| {
11251125
ty::lookup_field_type(tcx, class_id, f.id, substs)
11261126
}
@@ -2018,7 +2018,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
20182018
let mut class_field_map = HashMap::new();
20192019
let mut fields_found = 0;
20202020
for field in field_types.iter() {
2021-
class_field_map.insert(field.name, (field.id, false));
2021+
class_field_map.insert(field.ident.name, (field.id, false));
20222022
}
20232023

20242024
let mut error_happened = false;
@@ -2070,7 +2070,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
20702070
if fields_found < field_types.len() {
20712071
let mut missing_fields = ~[];
20722072
for class_field in field_types.iter() {
2073-
let name = class_field.name;
2073+
let name = class_field.ident.name;
20742074
let (_, seen) = *class_field_map.get(&name);
20752075
if !seen {
20762076
missing_fields.push(

branches/try/src/libstd/ptr.rs

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<T> RawPtr<T> for *mut T {
383383
}
384384

385385
// Equality for pointers
386-
#[cfg(not(test))]
386+
#[cfg(stage0, not(test))]
387387
impl<T> Eq for *T {
388388
#[inline]
389389
fn eq(&self, other: &*T) -> bool {
@@ -393,7 +393,17 @@ impl<T> Eq for *T {
393393
fn ne(&self, other: &*T) -> bool { !self.eq(other) }
394394
}
395395

396-
#[cfg(not(test))]
396+
#[cfg(not(stage0), not(test))]
397+
impl<T> Eq for *T {
398+
#[inline]
399+
fn eq(&self, other: &*T) -> bool {
400+
*self == *other
401+
}
402+
#[inline]
403+
fn ne(&self, other: &*T) -> bool { !self.eq(other) }
404+
}
405+
406+
#[cfg(stage0, not(test))]
397407
impl<T> Eq for *mut T {
398408
#[inline]
399409
fn eq(&self, other: &*mut T) -> bool {
@@ -403,6 +413,16 @@ impl<T> Eq for *mut T {
403413
fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
404414
}
405415

416+
#[cfg(not(stage0), not(test))]
417+
impl<T> Eq for *mut T {
418+
#[inline]
419+
fn eq(&self, other: &*mut T) -> bool {
420+
*self == *other
421+
}
422+
#[inline]
423+
fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
424+
}
425+
406426
// Equivalence for pointers
407427
#[cfg(not(test))]
408428
impl<T> Equiv<*mut T> for *T {
@@ -460,7 +480,7 @@ mod externfnpointers {
460480
}
461481

462482
// Comparison for pointers
463-
#[cfg(not(test))]
483+
#[cfg(stage0, not(test))]
464484
impl<T> Ord for *T {
465485
#[inline]
466486
fn lt(&self, other: &*T) -> bool {
@@ -480,7 +500,27 @@ impl<T> Ord for *T {
480500
}
481501
}
482502

483-
#[cfg(not(test))]
503+
#[cfg(not(stage0), not(test))]
504+
impl<T> Ord for *T {
505+
#[inline]
506+
fn lt(&self, other: &*T) -> bool {
507+
*self < *other
508+
}
509+
#[inline]
510+
fn le(&self, other: &*T) -> bool {
511+
*self <= *other
512+
}
513+
#[inline]
514+
fn ge(&self, other: &*T) -> bool {
515+
*self >= *other
516+
}
517+
#[inline]
518+
fn gt(&self, other: &*T) -> bool {
519+
*self > *other
520+
}
521+
}
522+
523+
#[cfg(stage0, not(test))]
484524
impl<T> Ord for *mut T {
485525
#[inline]
486526
fn lt(&self, other: &*mut T) -> bool {
@@ -500,6 +540,26 @@ impl<T> Ord for *mut T {
500540
}
501541
}
502542

543+
#[cfg(not(stage0), not(test))]
544+
impl<T> Ord for *mut T {
545+
#[inline]
546+
fn lt(&self, other: &*mut T) -> bool {
547+
*self < *other
548+
}
549+
#[inline]
550+
fn le(&self, other: &*mut T) -> bool {
551+
*self <= *other
552+
}
553+
#[inline]
554+
fn ge(&self, other: &*mut T) -> bool {
555+
*self >= *other
556+
}
557+
#[inline]
558+
fn gt(&self, other: &*mut T) -> bool {
559+
*self > *other
560+
}
561+
}
562+
503563
#[cfg(test)]
504564
pub mod ptr_tests {
505565
use super::*;

branches/try/src/libsyntax/ast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ impl Eq for Ident {
4747
// if it should be non-hygienic (most things are), just compare the
4848
// 'name' fields of the idents. Or, even better, replace the idents
4949
// with Name's.
50-
fail!(fmt!("not allowed to compare these idents: %?, %?. Probably \
51-
related to issue #6993", self, other));
50+
fail!(fmt!("not allowed to compare these idents: %?, %?", self, other));
5251
}
5352
}
5453
fn ne(&self, other: &Ident) -> bool {

branches/try/src/test/run-pass/issue-9110.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)