Skip to content

Commit 49a9383

Browse files
committed
---
yaml --- r: 7729 b: refs/heads/snap-stage3 c: 7da3733 h: refs/heads/master i: 7727: ff2b7c9 v: v3
1 parent a152ada commit 49a9383

25 files changed

+146
-493
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: dfae48736ffd3504598b15e0f350269a8d1b1063
4+
refs/heads/snap-stage3: 7da3733c73e7a3ba4c18f3927bbbe185598ad233
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/doc/rust.md

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,7 @@ fn main() {
761761
##### Export declarations
762762

763763
~~~~~~~~ {.ebnf .gram}
764-
export_decl : "export" ident [ ',' ident ] *
765-
| "export" ident "::{}"
766-
| "export" ident '{' ident [ ',' ident ] * '}' ;
764+
export_decl : "export" ident [ ',' ident ] * ;
767765
~~~~~~~~
768766

769767
An _export declaration_ restricts the set of local names within a module that
@@ -815,40 +813,6 @@ mod foo {
815813
}
816814
~~~~~~~~
817815

818-
When exporting the name of an `enum` type `t`, by default, the module also
819-
implicitly exports all of `t`'s constructors. For example:
820-
821-
~~~~~~~~
822-
mod foo {
823-
export t;
824-
825-
enum t {a, b, c};
826-
}
827-
~~~~~~~~
828-
829-
Here, `foo` imports `t`, `a`, `b`, and `c`.
830-
831-
The second and third forms of export declaration can be used to export
832-
an `enum` item without exporting all of its constructors. These two
833-
forms can only be used to export an `enum` item. The second form
834-
exports the `enum` type name without exporting any of its
835-
constructors, achieving a simple kind of data abstraction. The third
836-
form exports an `enum` type name along with a subset of its
837-
constructors. For example:
838-
839-
~~~~~~~~
840-
mod foo {
841-
export abstract{};
842-
export slightly_abstract{a, b};
843-
844-
enum abstract {x, y, z}
845-
enum slightly_abstract {a, b, c, d}
846-
}
847-
~~~~~~~~
848-
849-
Module `foo` exports the types `abstract` and `slightly_abstract`, as well as
850-
constructors `a` and `b`, but doesn't export constructors `x`, `y`, `z`, `c`,
851-
or `d`.
852816

853817
### Functions
854818

branches/snap-stage3/src/cargo/cargo.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type package = {
3434
uuid: str,
3535
url: str,
3636
method: str,
37-
description: str,
3837
ref: option::t<str>,
3938
tags: [str]
4039
};
@@ -270,15 +269,12 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
270269
}
271270
_ { }
272271
}
273-
// TODO: make this *actually* get the description from the .rc file.
274-
let description = "This package's description.";
275272
vec::grow(src.packages, 1u, {
276273
// source: _source(src),
277274
name: name,
278275
uuid: uuid,
279276
url: url,
280277
method: method,
281-
description: description,
282278
ref: ref,
283279
tags: tags
284280
});
@@ -685,9 +681,6 @@ fn print_pkg(s: source, p: package) {
685681
m = m + " [" + str::connect(p.tags, ", ") + "]";
686682
}
687683
info(m);
688-
if p.description != "" {
689-
print(" >> " + p.description)
690-
}
691684
}
692685
fn cmd_list(c: cargo, argv: [str]) {
693686
for_each_package(c, { |s, p|

branches/snap-stage3/src/comp/middle/resolve.rs

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,6 @@ fn index_mod(md: ast::_mod) -> mod_index {
14031403
}
14041404
//globbed imports have to be resolved lazily.
14051405
ast::view_item_import_glob(_, _) | ast::view_item_export(_, _) {}
1406-
// exports: ignore
1407-
_ {}
14081406
}
14091407
}
14101408
for it: @ast::item in md.items {
@@ -1766,32 +1764,6 @@ fn check_exports(e: @env) {
17661764
}
17671765
}
17681766

1769-
fn check_enum_ok(e: @env, sp:span, id: ident, val: @indexed_mod)
1770-
-> node_id {
1771-
alt val.index.find(id) {
1772-
none { e.sess.span_fatal(sp, #fmt("error: undefined id %s\
1773-
in an export", id)); }
1774-
some(ms) {
1775-
let maybe_id = list::find(ms) {|m|
1776-
alt m {
1777-
mie_item(an_item) {
1778-
alt an_item.node {
1779-
item_tag(_,_) { /* OK */ some(an_item.id) }
1780-
_ { none }
1781-
}
1782-
}
1783-
_ { none }
1784-
}
1785-
};
1786-
alt maybe_id {
1787-
some(an_id) { ret an_id; }
1788-
_ { e.sess.span_fatal(sp, #fmt("error: %s does not refer \
1789-
to an enumeration", id)); }
1790-
}
1791-
}
1792-
}
1793-
}
1794-
17951767
e.mod_map.values {|val|
17961768
alt val.m {
17971769
some(m) {
@@ -1802,44 +1774,14 @@ fn check_exports(e: @env) {
18021774
check_export(e, ident, val, vi);
18031775
}
18041776
}
1805-
ast::view_item_export_tag_none(id, _) {
1806-
let _ = check_enum_ok(e, vi.span, id, val);
1807-
}
1808-
ast::view_item_export_tag_some(id, ids, _) {
1809-
// Check that it's an enum and all the given variants
1810-
// belong to it
1811-
let parent_id = check_enum_ok(e, vi.span, id, val);
1812-
for variant_id in ids {
1813-
alt val.index.find(variant_id.node.name) {
1814-
some(ms) {
1815-
list::iter(ms) {|m|
1816-
alt m {
1817-
mie_tag_variant(parent_item,_) {
1818-
if parent_item.id != parent_id {
1819-
e.sess.span_err(vi.span,
1820-
#fmt("variant %s \
1821-
doesn't belong to enum %s",
1822-
variant_id.node.name,
1823-
id));
1824-
}
1825-
}
1826-
_ { e.sess.span_err(vi.span,
1827-
#fmt("%s is not a \
1828-
variant", variant_id.node.name)); }
1829-
}}
1830-
}
1831-
_ { e.sess.span_err(vi.span, #fmt("%s is not a\
1832-
variant", variant_id.node.name)); }
1833-
}
1834-
}
1835-
}
18361777
_ { }
18371778
}
18381779
}
18391780
}
18401781
none { }
18411782
}
1842-
}}
1783+
};
1784+
}
18431785

18441786
// Impl resolution
18451787

branches/snap-stage3/src/comp/rustc.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
uuid = "0ce89b41-2f92-459e-bbc1-8f5fe32f16cf",
66
url = "http://rust-lang.org/src/rustc")];
77

8-
#[comment = "The Rust compiler"];
8+
#[desc = "The Rust compiler"];
99
#[license = "MIT"];
1010
#[crate_type = "lib"];
1111

branches/snap-stage3/src/comp/syntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ enum view_item_ {
442442
// export foo::{}
443443
view_item_export_tag_none(ident, node_id),
444444
// export foo::{bar, baz, blat}
445-
view_item_export_tag_some(ident, [import_ident], node_id)
445+
view_item_export_tag_some(ident, [ident], node_id)
446446
}
447447

448448
// Meta-data associated with an item

branches/snap-stage3/src/comp/syntax/ast_util.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,12 @@ fn float_ty_to_str(t: float_ty) -> str {
113113

114114
fn is_exported(i: ident, m: _mod) -> bool {
115115
let nonlocal = true;
116-
let parent_tag : option<ident> = none;
117116
for it: @item in m.items {
118117
if it.ident == i { nonlocal = false; }
119118
alt it.node {
120119
item_tag(variants, _) {
121120
for v: variant in variants {
122-
if v.node.name == i {
123-
nonlocal = false;
124-
parent_tag = some(it.ident);
125-
}
121+
if v.node.name == i { nonlocal = false; }
126122
}
127123
}
128124
_ { }
@@ -133,28 +129,9 @@ fn is_exported(i: ident, m: _mod) -> bool {
133129
for vi: @view_item in m.view_items {
134130
alt vi.node {
135131
view_item_export(ids, _) {
136-
// If any of ids is a tag, we want to consider
137-
// all the variants to be exported
138-
for id in ids {
139-
if str::eq(i, id) { ret true; }
140-
alt parent_tag {
141-
some(parent_tag_id) {
142-
if str::eq(id, parent_tag_id) { ret true; }
143-
}
144-
_ { }
145-
}
146-
}
132+
for id in ids { if str::eq(i, id) { ret true; } }
147133
count += 1u;
148134
}
149-
view_item_export_tag_none(id, _) {
150-
if str::eq(i, id) { ret true; }
151-
count += 1u;
152-
}
153-
view_item_export_tag_some(id, ids, _) {
154-
if str::eq(i, id) { ret true; }
155-
for id in ids { if str::eq(i, id.node.name) { ret true; } }
156-
count += 1u;
157-
}
158135
_ {/* fall through */ }
159136
}
160137
}

branches/snap-stage3/src/comp/syntax/parse/parser.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,10 @@ fn spanned<T: copy>(lo: uint, hi: uint, node: T) -> spanned<T> {
194194
fn parse_ident(p: parser) -> ast::ident {
195195
alt p.token {
196196
token::IDENT(i, _) { p.bump(); ret p.get_str(i); }
197-
_ { p.fatal("expecting ident, found "
198-
+ token::to_str(p.reader, p.token)); }
197+
_ { p.fatal("expecting ident"); }
199198
}
200199
}
201200

202-
fn parse_import_ident(p: parser) -> ast::import_ident {
203-
let lo = p.span.lo;
204-
let ident = parse_ident(p);
205-
let hi = p.span.hi;
206-
ret spanned(lo, hi, {name: ident, id: p.get_id()});
207-
}
208-
209201
fn parse_value_ident(p: parser) -> ast::ident {
210202
check_bad_word(p);
211203
ret parse_ident(p);
@@ -2324,6 +2316,12 @@ fn parse_rest_import_name(p: parser, first: ast::ident,
23242316

23252317

23262318
token::LBRACE {
2319+
fn parse_import_ident(p: parser) -> ast::import_ident {
2320+
let lo = p.span.lo;
2321+
let ident = parse_ident(p);
2322+
let hi = p.span.hi;
2323+
ret spanned(lo, hi, {name: ident, id: p.get_id()});
2324+
}
23272325
let from_idents_ =
23282326
parse_seq(token::LBRACE, token::RBRACE, seq_sep(token::COMMA),
23292327
parse_import_ident, p).node;
@@ -2394,9 +2392,9 @@ fn parse_import(p: parser) -> ast::view_item_ {
23942392
}
23952393

23962394
fn parse_tag_export(p:parser, tyname:ast::ident) -> ast::view_item_ {
2397-
let tagnames:[ast::import_ident] =
2395+
let tagnames:[ast::ident] =
23982396
parse_seq(token::LBRACE, token::RBRACE,
2399-
seq_sep(token::COMMA), {|p| parse_import_ident(p) }, p).node;
2397+
seq_sep(token::COMMA), {|p| parse_ident(p) }, p).node;
24002398
let id = p.get_id();
24012399
if vec::is_empty(tagnames) {
24022400
ret ast::view_item_export_tag_none(tyname, id);
@@ -2409,8 +2407,9 @@ fn parse_tag_export(p:parser, tyname:ast::ident) -> ast::view_item_ {
24092407
fn parse_export(p: parser) -> ast::view_item_ {
24102408
let first = parse_ident(p);
24112409
alt p.token {
2412-
token::MOD_SEP {
2410+
token::COLON {
24132411
p.bump();
2412+
expect(p, token::COLON);
24142413
ret parse_tag_export(p, first);
24152414
}
24162415
t {

branches/snap-stage3/src/comp/syntax/print/pprust.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,19 +1303,6 @@ fn print_view_item(s: ps, item: @ast::view_item) {
13031303
commasep(s, inconsistent, ids,
13041304
fn@(s: ps, &&w: ast::ident) { word(s.s, w) });
13051305
}
1306-
ast::view_item_export_tag_none(id, _) {
1307-
head(s, "export");
1308-
word(s.s, id);
1309-
word(s.s, "::{}");
1310-
}
1311-
ast::view_item_export_tag_some(id, ids, _) {
1312-
head(s, "export");
1313-
word(s.s, id);
1314-
word(s.s, "::{");
1315-
commasep(s, inconsistent, ids, fn@(s:ps, &&w: ast::import_ident) {
1316-
word(s.s, w.node.name) });
1317-
word(s.s, "}");
1318-
}
13191306
}
13201307
word(s.s, ";");
13211308
end(s); // end inner head-block

branches/snap-stage3/src/etc/rustdoc.py

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

branches/snap-stage3/src/libcore/core.rc

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@
77
#[license = "MIT"];
88
#[crate_type = "lib"];
99

10-
#[doc(
11-
brief = "The Rust core library",
12-
desc = "
13-
The core library provides functionality that is closely tied to
14-
the Rust built-in types and runtime services, or that is used in nearly
15-
every non-trivial program.
16-
17-
The core library is linked by default to all crates and the contents
18-
imported. The effect is as though the user had written the following:
19-
20-
~~~
21-
use core;
22-
import core::*;
23-
~~~
24-
25-
This behavior can be disabled with the `--no-core` compiler flag."
26-
)];
27-
2810
export box, char, float, bessel, f32, f64, int, str, ptr;
2911
export uint, u8, u32, u64, vec, bool;
3012
export either, option, result;

0 commit comments

Comments
 (0)