Skip to content

Commit cd9fab3

Browse files
committed
---
yaml --- r: 49595 b: refs/heads/master c: e11d13f h: refs/heads/master i: 49593: 7512a3d 49591: c319f7b v: v3
1 parent 51f13be commit cd9fab3

File tree

16 files changed

+132
-215
lines changed

16 files changed

+132
-215
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bbc4ca134900456ba2a00368ec1f19bc1a357528
2+
refs/heads/master: e11d13f3de084fe73d754ca206ad70737bb5957d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea

trunk/src/libcore/cast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Unsafe casting functions
12-
1311
pub mod rusti {
1412
#[abi = "rust-intrinsic"]
1513
#[link_name = "rusti"]

trunk/src/libcore/cell.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! A mutable, nullable memory location
12-
1311
use cast::transmute;
1412
use option;
1513
use prelude::*;
1614

17-
/*
18-
A dynamic, mutable location.
19-
20-
Similar to a mutable option type, but friendlier.
21-
*/
15+
/// A dynamic, mutable location.
16+
///
17+
/// Similar to a mutable option type, but friendlier.
2218
2319
pub struct Cell<T> {
2420
mut value: Option<T>

trunk/src/libcore/clone.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! The Clone trait for types that cannot be "implicitly copied"
12-
13-
In Rust, some simple types are "implicitly copyable" and when you
14-
assign them or pass them as arguments, the receiver will get a copy,
15-
leaving the original value in place. These types do not require
16-
allocation to copy and do not have finalizers (i.e. they do not
17-
contain owned pointers or implement `Drop`), so the compiler considers
18-
them cheap and safe to copy and automatically implements the `Copy`
19-
trait for them. For other types copies must be made explicitly,
20-
by convention implementing the `Clone` trait and calling the
21-
`clone` method.
22-
11+
/**
12+
Clonable types are copied with the clone method
2313
*/
24-
2514
pub trait Clone {
2615
fn clone(&self) -> Self;
2716
}

trunk/src/libcore/comm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*!
12-
Message passing
13-
*/
14-
1511
use cast;
1612
use either::{Either, Left, Right};
1713
use kinds::Owned;

trunk/src/libcore/condition.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/*! Condition handling */
12-
1311
use prelude::*;
1412
use task;
1513
use task::local_data::{local_data_pop, local_data_set};

trunk/src/libcore/core.rc

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,27 @@
1010

1111
/*!
1212

13-
# The Rust core library
13+
The Rust core library
1414

1515
The Rust core library provides runtime features required by the language,
1616
including the task scheduler and memory allocators, as well as library
1717
support for Rust built-in types, platform abstractions, and other commonly
1818
used features.
1919

2020
`core` includes modules corresponding to each of the integer types, each of
21-
the floating point types, the `bool` type, tuples, characters, strings
22-
(`str`), vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`),
23-
and unsafe and borrowed pointers (`ptr`). Additionally, `core` provides
24-
pervasive types (`option` and `result`), task creation and communication
25-
primitives (`task`, `comm`), platform abstractions (`os` and `path`), basic
26-
I/O abstractions (`io`), common traits (`kinds`, `ops`, `cmp`, `num`,
27-
`to_str`), and complete bindings to the C standard library (`libc`).
21+
the floating point types, the `bool` type, tuples, characters, strings,
22+
vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`), and unsafe
23+
and borrowed pointers (`ptr`). Additionally, `core` provides task management
24+
and creation (`task`), communication primitives (`comm` and `pipes`), platform
25+
abstractions (`os` and `path`), basic I/O abstractions (`io`), common traits
26+
(`cmp`, `num`, `to_str`), and complete bindings to the C standard library
27+
(`libc`).
2828

29-
# Core injection and the Rust prelude
30-
31-
`core` is imported at the topmost level of every crate by default, as
32-
if the first line of each crate was
29+
`core` is linked to all crates by default and its contents imported.
30+
Implicitly, all crates behave as if they included the following prologue:
3331

3432
extern mod core;
35-
36-
This means that the contents of core can be accessed from from any context
37-
with the `core::` path prefix, as in `use core::vec`, `use core::task::spawn`,
38-
etc.
39-
40-
Additionally, `core` contains a `prelude` module that reexports many of the
41-
most common core modules, types and traits. The contents of the prelude are
42-
imported inte every *module* by default. Implicitly, all modules behave as if
43-
they contained the following prologue:
44-
45-
use core::prelude::*;
33+
use core::*;
4634

4735
*/
4836

trunk/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! The Rust prelude. Imported into every module by default.
11+
// This file is imported into every module by default.
1212

1313
/* Reexported core operators */
1414

trunk/src/libcore/rt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[doc(hidden)];
12-
1311
use libc::c_char;
1412

1513
// Some basic logging

trunk/src/librustc/middle/typeck/check/mod.rs

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,13 +1321,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
13211321
sugar: ast::CallSugar) {
13221322
// Index expressions need to be handled separately, to inform them
13231323
// that they appear in call position.
1324-
match f.node {
1325-
ast::expr_field(ref base, ref field, ref tys) => {
1326-
check_field(fcx, f, true, *base, *field, *tys)
1327-
}
1328-
_ => check_expr(fcx, f)
1329-
};
1330-
1324+
let mut bot = check_expr(fcx, f);
13311325
check_call_or_method(fcx,
13321326
sp,
13331327
call_expr_id,
@@ -1689,7 +1683,6 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
16891683
// Check field access expressions
16901684
fn check_field(fcx: @mut FnCtxt,
16911685
expr: @ast::expr,
1692-
is_callee: bool,
16931686
base: @ast::expr,
16941687
field: ast::ident,
16951688
tys: &[@ast::Ty]) {
@@ -1723,7 +1716,6 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
17231716
}
17241717

17251718
let tps = vec::map(tys, |ty| fcx.to_ty(*ty));
1726-
17271719
match method::lookup(fcx,
17281720
expr,
17291721
base,
@@ -1734,34 +1726,30 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
17341726
DontDerefArgs,
17351727
CheckTraitsAndInherentMethods,
17361728
AutoderefReceiver) {
1737-
Some(ref entry) => {
1738-
let method_map = fcx.ccx.method_map;
1739-
method_map.insert(expr.id, (*entry));
1740-
1741-
// If we have resolved to a method but this is not in
1742-
// a callee position, error
1743-
if !is_callee {
1744-
tcx.sess.span_err(
1745-
expr.span,
1746-
~"attempted to take value of method \
1747-
(try writing an anonymous function)");
1748-
// Add error type for the result
1749-
fcx.write_error(expr.id);
1750-
}
1729+
Some(_) => {
1730+
fcx.type_error_message(
1731+
expr.span,
1732+
|actual| {
1733+
fmt!("attempted to take value of method `%s` on type `%s` \
1734+
(try writing an anonymous function)",
1735+
*tcx.sess.str_of(field), actual)
1736+
},
1737+
expr_t, None);
17511738
}
1739+
17521740
None => {
1753-
fcx.type_error_message(expr.span,
1754-
|actual| {
1755-
fmt!("attempted access of field `%s` on type `%s`, but \
1756-
no field or method with that name was found",
1757-
*tcx.sess.str_of(field), actual)
1758-
},
1759-
expr_t, None);
1760-
// Add error type for the result
1761-
fcx.write_error(expr.id);
1741+
fcx.type_error_message(
1742+
expr.span,
1743+
|actual| {
1744+
fmt!("attempted access of field `%s` on type `%s`, \
1745+
but no field with that name was found",
1746+
*tcx.sess.str_of(field), actual)
1747+
},
1748+
expr_t, None);
17621749
}
17631750
}
17641751

1752+
fcx.write_error(expr.id);
17651753
}
17661754

17671755
fn check_struct_or_variant_fields(fcx: @mut FnCtxt,
@@ -2750,15 +2738,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
27502738
}
27512739
}
27522740
ast::expr_field(base, field, ref tys) => {
2753-
check_field(fcx, expr, false, base, field, * tys);
2754-
let base_t = fcx.expr_ty(base);
2755-
if ty::type_is_error(base_t) {
2756-
fcx.write_error(id);
2757-
}
2758-
else if ty::type_is_bot(base_t) {
2759-
fcx.write_bot(id);
2760-
}
2761-
// Otherwise, type already got written
2741+
check_field(fcx, expr, base, field, *tys);
27622742
}
27632743
ast::expr_index(base, idx) => {
27642744
check_expr(fcx, base);

0 commit comments

Comments
 (0)