Skip to content

Commit e75b58e

Browse files
committed
---
yaml --- r: 108839 b: refs/heads/dist-snap c: 53f3442 h: refs/heads/master i: 108837: c5b0d38 108835: d95f93d 108831: 4a799c0 v: v3
1 parent 7e6c239 commit e75b58e

File tree

13 files changed

+600
-561
lines changed

13 files changed

+600
-561
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 8a55cd988f272ec70fc7d5adf6e61ed8ee6a8e78
9+
refs/heads/dist-snap: 53f3442ef7ee2852e6e59158f47ae7dbefb2f175
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTC "1" "March 2014" "rustc 0.10-pre" "User Commands"
1+
.TH RUSTC "1" "July 2013" "rustc 0.7" "User Commands"
22
.SH NAME
33
rustc \- rust compiler
44
.SH SYNOPSIS

branches/dist-snap/man/rustdoc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTDOC "1" "March 2014" "rustdoc 0.10-pre" "User Commands"
1+
.TH RUSTDOC "1" "July 2013" "rustdoc 0.7" "User Commands"
22
.SH NAME
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS

branches/dist-snap/src/librustc/middle/resolve.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ use middle::pat_util::pat_bindings;
1919

2020
use syntax::ast::*;
2121
use syntax::ast;
22-
use syntax::ast_util::{def_id_of_def, local_def};
22+
use syntax::ast_util::{def_id_of_def, local_def, mtwt_resolve};
2323
use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
24-
use syntax::ext::mtwt;
2524
use syntax::parse::token::special_idents;
2625
use syntax::parse::token;
2726
use syntax::print::pprust::path_to_str;
@@ -4177,7 +4176,7 @@ impl Resolver {
41774176
fn binding_mode_map(&mut self, pat: @Pat) -> BindingMap {
41784177
let mut result = HashMap::new();
41794178
pat_bindings(self.def_map, pat, |binding_mode, _id, sp, path| {
4180-
let name = mtwt::resolve(path_to_ident(path));
4179+
let name = mtwt_resolve(path_to_ident(path));
41814180
result.insert(name,
41824181
binding_info {span: sp,
41834182
binding_mode: binding_mode});
@@ -4412,7 +4411,7 @@ impl Resolver {
44124411
// what you want).
44134412

44144413
let ident = path.segments.get(0).identifier;
4415-
let renamed = mtwt::resolve(ident);
4414+
let renamed = mtwt_resolve(ident);
44164415

44174416
match self.resolve_bare_identifier_pattern(ident) {
44184417
FoundStructOrEnumVariant(def, lp)
@@ -4966,7 +4965,7 @@ impl Resolver {
49664965
let search_result;
49674966
match namespace {
49684967
ValueNS => {
4969-
let renamed = mtwt::resolve(ident);
4968+
let renamed = mtwt_resolve(ident);
49704969
let mut value_ribs = self.value_ribs.borrow_mut();
49714970
search_result = self.search_ribs(value_ribs.get(),
49724971
renamed,
@@ -5214,7 +5213,7 @@ impl Resolver {
52145213
let rib = label_ribs.get()[label_ribs.get().len() -
52155214
1];
52165215
let mut bindings = rib.bindings.borrow_mut();
5217-
let renamed = mtwt::resolve(label);
5216+
let renamed = mtwt_resolve(label);
52185217
bindings.get().insert(renamed, def_like);
52195218
}
52205219

@@ -5226,7 +5225,7 @@ impl Resolver {
52265225

52275226
ExprBreak(Some(label)) | ExprAgain(Some(label)) => {
52285227
let mut label_ribs = self.label_ribs.borrow_mut();
5229-
let renamed = mtwt::resolve(label);
5228+
let renamed = mtwt_resolve(label);
52305229
match self.search_ribs(label_ribs.get(), renamed, expr.span) {
52315230
None =>
52325231
self.resolve_error(expr.span,

branches/dist-snap/src/librustc/middle/typeck/collect.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,12 +1040,23 @@ pub fn ty_of_foreign_fn_decl(ccx: &CrateCtxt,
10401040
ast_generics: &ast::Generics,
10411041
abis: AbiSet)
10421042
-> ty::ty_param_bounds_and_ty {
1043+
1044+
for i in decl.inputs.iter() {
1045+
match (*i).pat.node {
1046+
ast::PatIdent(_, _, _) => (),
1047+
ast::PatWild => (),
1048+
_ => ccx.tcx.sess.span_err((*i).pat.span,
1049+
"patterns aren't allowed in foreign function declarations")
1050+
}
1051+
}
1052+
10431053
let ty_generics = ty_generics(ccx, ast_generics, 0);
10441054
let rb = BindingRscope::new(def_id.node);
10451055
let input_tys = decl.inputs
10461056
.iter()
10471057
.map(|a| ty_of_arg(ccx, &rb, a, None))
10481058
.collect();
1059+
10491060
let output_ty = ast_ty_to_ty(ccx, &rb, decl.output);
10501061

10511062
let t_fn = ty::mk_bare_fn(

branches/dist-snap/src/libsyntax/ast.rs

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use parse::token;
1919

2020
use std::fmt;
2121
use std::fmt::Show;
22+
use std::cell::RefCell;
23+
use collections::HashMap;
2224
use std::option::Option;
2325
use std::rc::Rc;
2426
use std::vec_ng::Vec;
@@ -40,10 +42,7 @@ pub fn P<T: 'static>(value: T) -> P<T> {
4042
// macro expansion per Flatt et al., "Macros
4143
// That Work Together"
4244
#[deriving(Clone, Hash, TotalEq, TotalOrd, Show)]
43-
pub struct Ident {
44-
name: Name,
45-
ctxt: SyntaxContext
46-
}
45+
pub struct Ident { name: Name, ctxt: SyntaxContext }
4746

4847
impl Ident {
4948
/// Construct an identifier with the given name and an empty context:
@@ -89,9 +88,43 @@ impl Eq for Ident {
8988
// this uint is a reference to a table stored in thread-local
9089
// storage.
9190
pub type SyntaxContext = u32;
91+
92+
// the SCTable contains a table of SyntaxContext_'s. It
93+
// represents a flattened tree structure, to avoid having
94+
// managed pointers everywhere (that caused an ICE).
95+
// the mark_memo and rename_memo fields are side-tables
96+
// that ensure that adding the same mark to the same context
97+
// gives you back the same context as before. This shouldn't
98+
// change the semantics--everything here is immutable--but
99+
// it should cut down on memory use *a lot*; applying a mark
100+
// to a tree containing 50 identifiers would otherwise generate
101+
pub struct SCTable {
102+
table: RefCell<Vec<SyntaxContext_> >,
103+
mark_memo: RefCell<HashMap<(SyntaxContext,Mrk),SyntaxContext>>,
104+
rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
105+
}
106+
107+
// NB: these must be placed in any SCTable...
92108
pub static EMPTY_CTXT : SyntaxContext = 0;
93109
pub static ILLEGAL_CTXT : SyntaxContext = 1;
94110

111+
#[deriving(Eq, Encodable, Decodable, Hash)]
112+
pub enum SyntaxContext_ {
113+
EmptyCtxt,
114+
Mark (Mrk,SyntaxContext),
115+
// flattening the name and syntaxcontext into the rename...
116+
// HIDDEN INVARIANTS:
117+
// 1) the first name in a Rename node
118+
// can only be a programmer-supplied name.
119+
// 2) Every Rename node with a given Name in the
120+
// "to" slot must have the same name and context
121+
// in the "from" slot. In essence, they're all
122+
// pointers to a single "rename" event node.
123+
Rename (Ident,Name,SyntaxContext),
124+
// actually, IllegalCtxt may not be necessary.
125+
IllegalCtxt
126+
}
127+
95128
/// A name is a part of an identifier, representing a string or gensym. It's
96129
/// the result of interning.
97130
pub type Name = u32;

0 commit comments

Comments
 (0)