Skip to content

Commit 0d8388f

Browse files
author
Nick Hamann
committed
---
yaml --- r: 210739 b: refs/heads/try c: ba534f6 h: refs/heads/master i: 210737: da3ab9a 210735: 9ff2be7 v: v3
1 parent 46061a8 commit 0d8388f

40 files changed

+483
-722
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: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 12c93aa278ebbe8527b42d17065d3d5605c26bac
5+
refs/heads/try: ba534f63c9744cfd4786f07d568f4968147573e1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ Rob Hoelz <[email protected]>
736736
Robert Buonpastore <[email protected]>
737737
Robert Clipsham <[email protected]>
738738
Robert Gawdzik <[email protected]>
739-
Robert Foss <[email protected]>
740739
Robert Irelan <[email protected]>
741740
Robert Knight <[email protected]>
742741
Robert Millar <[email protected]>

branches/try/src/doc/reference.md

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,6 @@ vtable when the trait is used as a [trait object](#trait-objects).
13461346
Traits are implemented for specific types through separate
13471347
[implementations](#implementations).
13481348

1349-
Consider the following trait:
1350-
13511349
```
13521350
# type Surface = i32;
13531351
# type BoundingBox = i32;
@@ -1362,20 +1360,6 @@ This defines a trait with two methods. All values that have
13621360
`draw` and `bounding_box` methods called, using `value.bounding_box()`
13631361
[syntax](#method-call-expressions).
13641362

1365-
Traits can include default implementations of methods, as in:
1366-
1367-
```
1368-
trait Foo {
1369-
fn bar(&self);
1370-
1371-
fn baz(&self) { println!("We called baz."); }
1372-
}
1373-
```
1374-
1375-
Here the `baz` method has a default implementation, so types that implement
1376-
`Foo` need only implement `bar`. It is also possible for implementing types
1377-
to override a method that has a default implementation.
1378-
13791363
Type parameters can be specified for a trait to make it generic. These appear
13801364
after the trait name, using the same syntax used in [generic
13811365
functions](#generic-functions).
@@ -1388,30 +1372,6 @@ trait Seq<T> {
13881372
}
13891373
```
13901374

1391-
It is also possible to define associated types for a trait. Consider the
1392-
following example of a `Container` trait. Notice how the type is available
1393-
for use in the method signatures:
1394-
1395-
```
1396-
trait Container {
1397-
type E;
1398-
fn empty() -> Self;
1399-
fn insert(&mut self, Self::E);
1400-
}
1401-
```
1402-
1403-
In order for a type to implement this trait, it must not only provide
1404-
implementations for every method, but it must specify the type `E`. Here's
1405-
an implementation of `Container` for the standard library type `Vec`:
1406-
1407-
```
1408-
impl<T> Container for Vec<T> {
1409-
type E = T;
1410-
fn empty() -> Vec<T> { Vec::new() }
1411-
fn insert(&mut self, x: T) { self.push(x); }
1412-
}
1413-
```
1414-
14151375
Generic functions may use traits as _bounds_ on their type parameters. This
14161376
will have two effects: only types that have the trait may instantiate the
14171377
parameter, and within the generic function, the methods of the trait can be
@@ -3510,21 +3470,13 @@ more of the closure traits:
35103470

35113471
### Trait objects
35123472

3513-
In Rust, a type like `&SomeTrait` or `Box<SomeTrait>` is called a _trait object_.
3514-
Each instance of a trait object includes:
3515-
3516-
- a pointer to an instance of a type `T` that implements `SomeTrait`
3517-
- a _virtual method table_, often just called a _vtable_, which contains, for
3518-
each method of `SomeTrait` that `T` implements, a pointer to `T`'s
3519-
implementation (i.e. a function pointer).
3520-
3521-
The purpose of trait objects is to permit "late binding" of methods. A call to
3522-
a method on a trait object is only resolved to a vtable entry at compile time.
3523-
The actual implementation for each vtable entry can vary on an object-by-object
3524-
basis.
3525-
3526-
Note that for a trait object to be instantiated, the trait must be
3527-
_object-safe_. Object safety rules are defined in [RFC 255][rfc255].
3473+
Every trait item (see [traits](#traits)) defines a type with the same name as
3474+
the trait. This type is called the _trait object_ of the trait. Trait objects
3475+
permit "late binding" of methods, dispatched using _virtual method tables_
3476+
("vtables"). Whereas most calls to trait methods are "early bound" (statically
3477+
resolved) to specific implementations at compile time, a call to a method on an
3478+
trait objects is only resolved to a vtable entry at compile time. The actual
3479+
implementation for each vtable entry can vary on an object-by-object basis.
35283480

35293481
Given a pointer-typed expression `E` of type `&T` or `Box<T>`, where `T`
35303482
implements trait `R`, casting `E` to the corresponding pointer type `&R` or

branches/try/src/doc/trpl/dining-philosophers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ which blocks execution until the thread has completed execution. This ensures
450450
that the threads complete their work before the program exits.
451451

452452
If you run this program, you’ll see that the philosophers eat out of order!
453-
We have multi-threading!
453+
We have mult-threading!
454454

455455
```text
456456
Gilles Deleuze is eating.

branches/try/src/librustc/middle/infer/freshen.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,11 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
129129
.probe(v)
130130
.map(|v| v.to_type(tcx)),
131131
ty::FloatVar(v),
132-
ty::FreshFloatTy)
132+
ty::FreshIntTy)
133133
}
134134

135135
ty::ty_infer(ty::FreshTy(c)) |
136-
ty::ty_infer(ty::FreshIntTy(c)) |
137-
ty::ty_infer(ty::FreshFloatTy(c)) => {
136+
ty::ty_infer(ty::FreshIntTy(c)) => {
138137
if c >= self.freshen_count {
139138
tcx.sess.bug(
140139
&format!("Encountered a freshend type with id {} \

branches/try/src/librustc/middle/traits/select.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,8 +1773,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17731773
ty::ty_err => ok_if(Vec::new()),
17741774

17751775
ty::ty_infer(ty::FreshTy(_))
1776-
| ty::ty_infer(ty::FreshIntTy(_))
1777-
| ty::ty_infer(ty::FreshFloatTy(_)) => {
1776+
| ty::ty_infer(ty::FreshIntTy(_)) => {
17781777
self.tcx().sess.bug(
17791778
&format!(
17801779
"asked to assemble builtin bounds of unexpected type: {}",
@@ -1836,8 +1835,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
18361835
ty::ty_projection(..) |
18371836
ty::ty_infer(ty::TyVar(_)) |
18381837
ty::ty_infer(ty::FreshTy(_)) |
1839-
ty::ty_infer(ty::FreshIntTy(_)) |
1840-
ty::ty_infer(ty::FreshFloatTy(_)) => {
1838+
ty::ty_infer(ty::FreshIntTy(_)) => {
18411839
self.tcx().sess.bug(
18421840
&format!(
18431841
"asked to assemble constituent types of unexpected type: {}",

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,8 +1697,11 @@ pub enum InferTy {
16971697
/// unbound type variable. This is convenient for caching etc. See
16981698
/// `middle::infer::freshen` for more details.
16991699
FreshTy(u32),
1700+
1701+
// FIXME -- once integral fallback is impl'd, we should remove
1702+
// this type. It's only needed to prevent spurious errors for
1703+
// integers whose type winds up never being constrained.
17001704
FreshIntTy(u32),
1701-
FreshFloatTy(u32)
17021705
}
17031706

17041707
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
@@ -1770,7 +1773,6 @@ impl fmt::Debug for InferTy {
17701773
FloatVar(ref v) => v.fmt(f),
17711774
FreshTy(v) => write!(f, "FreshTy({:?})", v),
17721775
FreshIntTy(v) => write!(f, "FreshIntTy({:?})", v),
1773-
FreshFloatTy(v) => write!(f, "FreshFloatTy({:?})", v)
17741776
}
17751777
}
17761778
}
@@ -3773,7 +3775,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
37733775
}
37743776

37753777
// Scalar and unique types are sendable, and durable
3776-
ty_infer(ty::FreshIntTy(_)) | ty_infer(ty::FreshFloatTy(_)) |
3778+
ty_infer(ty::FreshIntTy(_)) |
37773779
ty_bool | ty_int(_) | ty_uint(_) | ty_float(_) |
37783780
ty_bare_fn(..) | ty::ty_char => {
37793781
TC::None
@@ -4323,7 +4325,6 @@ pub fn type_is_fresh(ty: Ty) -> bool {
43234325
match ty.sty {
43244326
ty_infer(FreshTy(_)) => true,
43254327
ty_infer(FreshIntTy(_)) => true,
4326-
ty_infer(FreshFloatTy(_)) => true,
43274328
_ => false
43284329
}
43294330
}
@@ -5025,7 +5026,6 @@ pub fn ty_sort_string<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> String {
50255026
ty_infer(FloatVar(_)) => "floating-point variable".to_string(),
50265027
ty_infer(FreshTy(_)) => "skolemized type".to_string(),
50275028
ty_infer(FreshIntTy(_)) => "skolemized integral type".to_string(),
5028-
ty_infer(FreshFloatTy(_)) => "skolemized floating-point type".to_string(),
50295029
ty_projection(_) => "associated type".to_string(),
50305030
ty_param(ref p) => {
50315031
if p.space == subst::SelfSpace {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Match<'a, 'tcx> {
6767

6868
match (&a.sty, &b.sty) {
6969
(_, &ty::ty_infer(ty::FreshTy(_))) |
70-
(_, &ty::ty_infer(ty::FreshIntTy(_))) |
71-
(_, &ty::ty_infer(ty::FreshFloatTy(_))) => {
70+
(_, &ty::ty_infer(ty::FreshIntTy(_))) => {
7271
Ok(a)
7372
}
7473

branches/try/src/librustc/plugin/registry.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use lint::{LintPassObject, LintId, Lint};
1414
use session::Session;
1515

1616
use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT};
17-
use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MultiDecorator};
18-
use syntax::ext::base::{MacroExpanderFn, MacroRulesTT};
17+
use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MacroRulesTT};
18+
use syntax::ext::base::MacroExpanderFn;
1919
use syntax::codemap::Span;
2020
use syntax::parse::token;
2121
use syntax::ptr::P;
@@ -84,7 +84,6 @@ impl<'a> Registry<'a> {
8484
/// Register a syntax extension of any kind.
8585
///
8686
/// This is the most general hook into `libsyntax`'s expansion behavior.
87-
#[allow(deprecated)]
8887
pub fn register_syntax_extension(&mut self, name: ast::Name, extension: SyntaxExtension) {
8988
self.syntax_exts.push((name, match extension {
9089
NormalTT(ext, _, allow_internal_unstable) => {
@@ -94,7 +93,6 @@ impl<'a> Registry<'a> {
9493
IdentTT(ext, Some(self.krate_span), allow_internal_unstable)
9594
}
9695
Decorator(ext) => Decorator(ext),
97-
MultiDecorator(ext) => MultiDecorator(ext),
9896
Modifier(ext) => Modifier(ext),
9997
MultiModifier(ext) => MultiModifier(ext),
10098
MacroRulesTT => {

branches/try/src/librustc/util/ppaux.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
349349
ty::FloatVar(ref vid) if print_var_ids => vid.repr(cx),
350350
ty::TyVar(_) | ty::IntVar(_) | ty::FloatVar(_) => format!("_"),
351351
ty::FreshTy(v) => format!("FreshTy({})", v),
352-
ty::FreshIntTy(v) => format!("FreshIntTy({})", v),
353-
ty::FreshFloatTy(v) => format!("FreshFloatTy({})", v)
352+
ty::FreshIntTy(v) => format!("FreshIntTy({})", v)
354353
}
355354
}
356355

branches/try/src/librustc_trans/save/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,12 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
520520
let qualname = format!("::{}", self.analysis.ty_cx.map.path_to_string(item.id));
521521

522522
// If the variable is immutable, save the initialising expression.
523-
let (value, keyword) = match mt {
524-
ast::MutMutable => (String::from_str("<mutable>"), keywords::Mut),
525-
ast::MutImmutable => (self.span.snippet(expr.span), keywords::Static),
523+
let value = match mt {
524+
ast::MutMutable => String::from_str("<mutable>"),
525+
ast::MutImmutable => self.span.snippet(expr.span),
526526
};
527527

528-
let sub_span = self.span.sub_span_after_keyword(item.span, keyword);
528+
let sub_span = self.span.sub_span_after_keyword(item.span, keywords::Static);
529529
self.fmt.static_str(item.span,
530530
sub_span,
531531
item.id,

0 commit comments

Comments
 (0)