Skip to content

Commit 1d9291d

Browse files
committed
---
yaml --- r: 152770 b: refs/heads/try2 c: 7be2019 h: refs/heads/master v: v3
1 parent b125603 commit 1d9291d

File tree

85 files changed

+1159
-1728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1159
-1728
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 58bf8b2155dc2ece0cee2bc2f60c72ea60d75af3
8+
refs/heads/try2: 7be2019428ff888ea26075a065fa3cebb66c5ead
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/guide-unsafe.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ in the same format as a C:
451451

452452
```
453453
#![no_std]
454-
#![feature(lang_items)]
455454
456455
// Pull in the system libc library for what crt0.o likely requires
457456
extern crate libc;
@@ -478,7 +477,6 @@ compiler's name mangling too:
478477
```ignore
479478
#![no_std]
480479
#![no_main]
481-
#![feature(lang_items)]
482480
483481
extern crate libc;
484482
@@ -530,7 +528,6 @@ vectors provided from C, using idiomatic Rust practices.
530528
```
531529
#![no_std]
532530
#![feature(globs)]
533-
#![feature(lang_items)]
534531
535532
# extern crate libc;
536533
extern crate core;
@@ -622,9 +619,6 @@ perform efficient pointer arithmetic, one would import those functions
622619
via a declaration like
623620

624621
```
625-
# #![feature(intrinsics)]
626-
# fn main() {}
627-
628622
extern "rust-intrinsic" {
629623
fn transmute<T, U>(x: T) -> U;
630624
@@ -653,7 +647,6 @@ sugar for dynamic allocations via `malloc` and `free`:
653647

654648
```
655649
#![no_std]
656-
#![feature(lang_items)]
657650
658651
extern crate libc;
659652

branches/try2/src/doc/rust.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ block_comment_body : [block_comment | character] * ;
160160
line_comment : "//" non_eol * ;
161161
~~~~
162162

163-
Comments in Rust code follow the general C++ style of line and block-comment forms.
163+
Comments in Rust code follow the general C++ style of line and block-comment forms.
164164
Nested block comments are supported.
165165

166166
Line comments beginning with exactly _three_ slashes (`///`), and block
@@ -3004,7 +3004,7 @@ ten_times(|j| println!("hello, {}", j));
30043004
### While loops
30053005

30063006
~~~~ {.ebnf .gram}
3007-
while_expr : "while" no_struct_literal_expr '{' block '}' ;
3007+
while_expr : "while" expr '{' block '}' ;
30083008
~~~~
30093009

30103010
A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3071,7 +3071,7 @@ A `continue` expression is only permitted in the body of a loop.
30713071
### For expressions
30723072

30733073
~~~~ {.ebnf .gram}
3074-
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
3074+
for_expr : "for" pat "in" expr '{' block '}' ;
30753075
~~~~
30763076

30773077
A `for` expression is a syntactic construct for looping over elements
@@ -3105,7 +3105,7 @@ for i in range(0u, 256) {
31053105
### If expressions
31063106

31073107
~~~~ {.ebnf .gram}
3108-
if_expr : "if" no_struct_literal_expr '{' block '}'
3108+
if_expr : "if" expr '{' block '}'
31093109
else_tail ? ;
31103110
31113111
else_tail : "else" [ if_expr
@@ -3126,7 +3126,7 @@ then any `else` block is executed.
31263126
### Match expressions
31273127

31283128
~~~~ {.ebnf .gram}
3129-
match_expr : "match" no_struct_literal_expr '{' match_arm * '}' ;
3129+
match_expr : "match" expr '{' match_arm * '}' ;
31303130
31313131
match_arm : attribute * match_pat "=>" [ expr "," | '{' block '}' ] ;
31323132
@@ -3563,11 +3563,10 @@ There are four varieties of pointer in Rust:
35633563

35643564
* Raw pointers (`*`)
35653565
: Raw pointers are pointers without safety or liveness guarantees.
3566-
Raw pointers are written as `*const T` or `*mut T`,
3567-
for example `*const int` means a raw pointer to an integer.
3568-
Copying or dropping a raw pointer has no effect on the lifecycle of any
3569-
other value. Dereferencing a raw pointer or converting it to any other
3570-
pointer type is an [`unsafe` operation](#unsafe-functions).
3566+
Raw pointers are written `*content`,
3567+
for example `*int` means a raw pointer to an integer.
3568+
Copying or dropping a raw pointer has no effect on the lifecycle of any other value.
3569+
Dereferencing a raw pointer or converting it to any other pointer type is an [`unsafe` operation](#unsafe-functions).
35713570
Raw pointers are generally discouraged in Rust code;
35723571
they exist to support interoperability with foreign code,
35733572
and writing performance-critical or low-level functions.

branches/try2/src/doc/tutorial.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ fn sendable_foo(f: Box<Foo + Send>) { /* ... */ }
25222522
fn shareable_bar<T: Share>(b: &Bar<T> + Share) { /* ... */ }
25232523
~~~
25242524

2525-
When no colon is specified (such as the type `Box<Foo>`), it is inferred that the
2525+
When no colon is specified (such as the type `~Foo`), it is inferred that the
25262526
value ascribes to no bounds. They must be added manually if any bounds are
25272527
necessary for usage.
25282528

@@ -2579,18 +2579,17 @@ fn radius_times_area<T: Circle>(c: T) -> f64 {
25792579

25802580
Likewise, supertrait methods may also be called on trait objects.
25812581

2582-
~~~
2582+
~~~ {.ignore}
25832583
use std::f64::consts::PI;
25842584
# trait Shape { fn area(&self) -> f64; }
25852585
# trait Circle : Shape { fn radius(&self) -> f64; }
25862586
# struct Point { x: f64, y: f64 }
25872587
# struct CircleStruct { center: Point, radius: f64 }
25882588
# impl Circle for CircleStruct { fn radius(&self) -> f64 { (self.area() / PI).sqrt() } }
25892589
# impl Shape for CircleStruct { fn area(&self) -> f64 { PI * square(self.radius) } }
2590-
# fn square(x: f64) -> f64 { x * x }
25912590
2592-
let concrete = box CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2593-
let mycircle: Box<Circle> = concrete as Box<Circle>;
2591+
let concrete = ~CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2592+
let mycircle: ~Circle = concrete as ~Circle;
25942593
let nonsense = mycircle.radius() * mycircle.area();
25952594
~~~
25962595

branches/try2/src/etc/2014-06-rewrite-bytes-macros.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/bin/env python
22
#
33
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
44
# file at the top-level directory of this distribution and at

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ syn keyword rustKeyword unsafe virtual while
3030
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
3131
" FIXME: Scoped impl's name is also fallen in this category
3232
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
33-
syn keyword rustStorage mut ref static const
33+
syn keyword rustStorage mut ref static
34+
syn keyword rustObsoleteStorage const
3435

3536
syn keyword rustInvalidBareKeyword crate
3637

branches/try2/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
html_root_url = "http://doc.rust-lang.org/")]
7070

7171
#![no_std]
72-
#![feature(lang_items, phase, unsafe_destructor)]
72+
#![feature(phase, unsafe_destructor)]
7373
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
7474

7575
#[phase(plugin, link)]

branches/try2/src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#![feature(unsafe_destructor)]
3232
#![allow(missing_doc)]
33+
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
3334

3435
use std::cell::{Cell, RefCell};
3536
use std::cmp;

branches/try2/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2525
#![feature(unsafe_destructor)]
2626
#![no_std]
27+
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
2728

2829
#[phase(plugin, link)] extern crate core;
2930
extern crate alloc;

branches/try2/src/libcore/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@
5555
html_playground_url = "http://play.rust-lang.org/")]
5656

5757
#![no_std]
58-
#![feature(globs, intrinsics, lang_items, macro_rules, managed_boxes, phase)]
59-
#![feature(simd, unsafe_destructor)]
58+
#![feature(globs, macro_rules, managed_boxes, phase, simd, unsafe_destructor)]
6059
#![deny(missing_doc)]
61-
#![allow(unknown_features)] // NOTE: remove after stage0 snapshot
60+
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
6261

6362
#[cfg(test)] extern crate realcore = "core";
6463
#[cfg(test)] extern crate libc;

branches/try2/src/libnative/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@
5454
html_root_url = "http://doc.rust-lang.org/")]
5555

5656
#![deny(unused_result, unused_must_use)]
57-
#![allow(non_camel_case_types, deprecated)]
57+
#![allow(non_camel_case_types)]
58+
#![allow(deprecated)]
5859
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
59-
#![feature(default_type_params, lang_items)]
60+
#![feature(default_type_params)]
6061

6162
// NB this crate explicitly does *not* allow glob imports, please seriously
6263
// consider whether they're needed before adding that feature here (the
6364
// answer is that you don't need them)
64-
#![feature(macro_rules, unsafe_destructor, default_type_params)]
65+
#![feature(macro_rules, unsafe_destructor)]
6566

6667
extern crate alloc;
6768
extern crate libc;

branches/try2/src/librlibc/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2727
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2828
html_root_url = "http://doc.rust-lang.org/")]
29-
#![feature(intrinsics)]
30-
#![allow(unknown_features)] // NOTE: remove after stage0 snapshot
3129

3230
#![no_std]
3331
#![experimental]

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
2121
use middle::lint;
2222

23-
use syntax::abi::RustIntrinsic;
24-
use syntax::ast::NodeId;
2523
use syntax::ast;
2624
use syntax::attr;
2725
use syntax::attr::AttrMetaMethods;
@@ -53,8 +51,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5351
("trace_macros", Active),
5452
("concat_idents", Active),
5553
("unsafe_destructor", Active),
56-
("intrinsics", Active),
57-
("lang_items", Active),
5854

5955
("simd", Active),
6056
("default_type_params", Active),
@@ -191,18 +187,13 @@ impl<'a> Visitor<()> for Context<'a> {
191187
}
192188
}
193189

194-
ast::ItemForeignMod(ref foreign_module) => {
190+
ast::ItemForeignMod(..) => {
195191
if attr::contains_name(i.attrs.as_slice(), "link_args") {
196192
self.gate_feature("link_args", i.span,
197193
"the `link_args` attribute is not portable \
198194
across platforms, it is recommended to \
199195
use `#[link(name = \"foo\")]` instead")
200196
}
201-
if foreign_module.abi == RustIntrinsic {
202-
self.gate_feature("intrinsics",
203-
i.span,
204-
"intrinsics are subject to change")
205-
}
206197
}
207198

208199
ast::ItemFn(..) => {
@@ -292,10 +283,14 @@ impl<'a> Visitor<()> for Context<'a> {
292283
}
293284

294285
fn visit_foreign_item(&mut self, i: &ast::ForeignItem, _: ()) {
295-
if attr::contains_name(i.attrs.as_slice(), "linkage") {
296-
self.gate_feature("linkage", i.span,
297-
"the `linkage` attribute is experimental \
298-
and not portable across platforms")
286+
match i.node {
287+
ast::ForeignItemFn(..) | ast::ForeignItemStatic(..) => {
288+
if attr::contains_name(i.attrs.as_slice(), "linkage") {
289+
self.gate_feature("linkage", i.span,
290+
"the `linkage` attribute is experimental \
291+
and not portable across platforms")
292+
}
293+
}
299294
}
300295
visit::walk_foreign_item(self, i, ())
301296
}
@@ -343,32 +338,6 @@ impl<'a> Visitor<()> for Context<'a> {
343338
}
344339
visit::walk_generics(self, generics, ());
345340
}
346-
347-
fn visit_attribute(&mut self, attr: &ast::Attribute, _: ()) {
348-
if attr::contains_name([*attr], "lang") {
349-
self.gate_feature("lang_items",
350-
attr.span,
351-
"language items are subject to change");
352-
}
353-
}
354-
355-
fn visit_fn(&mut self,
356-
fn_kind: &visit::FnKind,
357-
fn_decl: &ast::FnDecl,
358-
block: &ast::Block,
359-
span: Span,
360-
_: NodeId,
361-
(): ()) {
362-
match *fn_kind {
363-
visit::FkItemFn(_, _, _, ref abi) if *abi == RustIntrinsic => {
364-
self.gate_feature("intrinsics",
365-
span,
366-
"intrinsics are subject to change")
367-
}
368-
_ => {}
369-
}
370-
visit::walk_fn(self, fn_kind, fn_decl, block, span, ());
371-
}
372341
}
373342

374343
pub fn check_crate(sess: &Session, krate: &ast::Crate) {

branches/try2/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This API is completely unstable and subject to change.
2929
html_root_url = "http://doc.rust-lang.org/")]
3030

3131
#![allow(deprecated)]
32+
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
3233
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote)]
3334
#![feature(default_type_params, phase, unsafe_destructor)]
3435

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3894,31 +3894,8 @@ impl<'a> Resolver<'a> {
38943894
self.resolve_error(trait_reference.path.span, msg.as_slice());
38953895
}
38963896
Some(def) => {
3897-
match def {
3898-
(DefTrait(_), _) => {
3899-
debug!("(resolving trait) found trait def: {:?}", def);
3900-
self.record_def(trait_reference.ref_id, def);
3901-
}
3902-
(def, _) => {
3903-
self.resolve_error(trait_reference.path.span,
3904-
format!("`{}` is not a trait",
3905-
self.path_idents_to_str(
3906-
&trait_reference.path)));
3907-
3908-
// If it's a typedef, give a note
3909-
match def {
3910-
DefTy(_) => {
3911-
self.session.span_note(
3912-
trait_reference.path.span,
3913-
format!("`type` aliases cannot \
3914-
be used for traits")
3915-
.as_slice());
3916-
}
3917-
_ => {}
3918-
}
3919-
}
3920-
}
3921-
3897+
debug!("(resolving trait) found trait def: {:?}", def);
3898+
self.record_def(trait_reference.ref_id, def);
39223899
}
39233900
}
39243901
}
@@ -4044,9 +4021,6 @@ impl<'a> Resolver<'a> {
40444021

40454022
this.with_current_self_type(self_type, |this| {
40464023
for method in methods.iter() {
4047-
// If this is a trait impl, ensure the method exists in trait
4048-
this.check_trait_method(&**method);
4049-
40504024
// We also need a new scope for the method-specific type parameters.
40514025
this.resolve_method(MethodRibKind(id, Provided(method.id)),
40524026
&**method);
@@ -4056,21 +4030,6 @@ impl<'a> Resolver<'a> {
40564030
});
40574031
}
40584032

4059-
fn check_trait_method(&self, method: &Method) {
4060-
// If there is a TraitRef in scope for an impl, then the method must be in the trait.
4061-
for &(did, ref trait_ref) in self.current_trait_ref.iter() {
4062-
let method_name = method.ident.name;
4063-
4064-
if self.method_map.borrow().find(&(method_name, did)).is_none() {
4065-
let path_str = self.path_idents_to_str(&trait_ref.path);
4066-
self.resolve_error(method.span,
4067-
format!("method `{}` is not a member of trait `{}`",
4068-
token::get_name(method_name),
4069-
path_str).as_slice());
4070-
}
4071-
}
4072-
}
4073-
40744033
fn resolve_module(&mut self, module: &Mod, _span: Span,
40754034
_name: Ident, id: NodeId) {
40764035
// Write the implementations in scope into the module metadata.

0 commit comments

Comments
 (0)