Skip to content

Commit c49d46c

Browse files
committed
---
yaml --- r: 64622 b: refs/heads/snap-stage3 c: e68697b h: refs/heads/master v: v3
1 parent a662f8c commit c49d46c

File tree

11 files changed

+91
-37
lines changed

11 files changed

+91
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 64ff30a4f093480abbc2f29fd1379e28e0801c29
4+
refs/heads/snap-stage3: e68697b55e0b89c72ab52e7a8004cc1ceb7619ff
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ was taken.
309309

310310
In short, everything that's not a declaration (declarations are `let` for
311311
variables; `fn` for functions; and any top-level named items such as
312-
[traits](#traits), [enum types](#enums), and [constants](#constants)) is an
312+
[traits](#traits), [enum types](#enums), and static items) is an
313313
expression, including function bodies.
314314

315315
~~~~
@@ -992,7 +992,7 @@ task-local garbage collector. It will be destroyed at some point after there
992992
are no references left to the box, no later than the end of the task. Managed
993993
boxes lack an owner, so they start a new ownership tree and don't inherit
994994
mutability. They do own the contained object, and mutability is defined by the
995-
type of the shared box (`@` or `@mut`). An object containing a managed box is
995+
type of the managed box (`@` or `@mut`). An object containing a managed box is
996996
not `Owned`, and can't be sent between tasks.
997997

998998
~~~~
@@ -1089,10 +1089,8 @@ we might like to compute the distance between `on_the_stack` and
10891089
to define a function that takes two arguments of type point—that is,
10901090
it takes the points by value. But this will cause the points to be
10911091
copied when we call the function. For points, this is probably not so
1092-
bad, but often copies are expensive or, worse, if there are mutable
1093-
fields, they can change the semantics of your program. So we’d like to
1094-
define a function that takes the points by pointer. We can use
1095-
borrowed pointers to do this:
1092+
bad, but often copies are expensive. So we’d like to define a function
1093+
that takes the points by pointer. We can use borrowed pointers to do this:
10961094
10971095
~~~
10981096
# struct Point { x: float, y: float }
@@ -1374,7 +1372,7 @@ let exchange_crayons: ~str = ~"Black, BlizzardBlue, Blue";
13741372
~~~
13751373

13761374
Both vectors and strings support a number of useful
1377-
[methods](#functions-and-methods), defined in [`std::vec`]
1375+
[methods](#methods), defined in [`std::vec`]
13781376
and [`std::str`]. Here are some examples.
13791377

13801378
[`std::vec`]: std/vec.html
@@ -1928,7 +1926,7 @@ that implements a trait includes the name of the trait at the start of
19281926
the definition, as in the following impls of `Printable` for `int`
19291927
and `~str`.
19301928

1931-
[impls]: #functions-and-methods
1929+
[impls]: #methods
19321930

19331931
~~~~
19341932
# trait Printable { fn print(&self); }

branches/snap-stage3/mk/target.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export CFG_COMPILER_TRIPLE
1717
# code, make sure that these common warnings are denied by default. These can
1818
# be overridden during development temporarily. For stage0, we allow all these
1919
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
20-
# NOTE: add "-A warnings" after snapshot to WFLAGS_ST0
21-
WFLAGS_ST0 = -A unrecognized-lint
20+
WFLAGS_ST0 = -A warnings
2221
WFLAGS_ST1 = -D warnings
2322
WFLAGS_ST2 = -D warnings
2423

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::node_id) -> ValueRef {
24562456
let val = match item {
24572457
ast_map::node_item(i, pth) => {
24582458
let my_path = vec::append((*pth).clone(), [path_name(i.ident)]);
2459-
let v = match i.node {
2459+
match i.node {
24602460
ast::item_static(_, m, expr) => {
24612461
let typ = ty::node_id_to_type(ccx.tcx, i.id);
24622462
let s = mangle_exported_name(ccx, my_path, typ);
@@ -2488,16 +2488,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::node_id) -> ValueRef {
24882488
llfn
24892489
}
24902490
_ => fail!("get_item_val: weird result in table")
2491-
};
2492-
match (attr::first_attr_value_str_by_name(i.attrs, "link_section")) {
2493-
Some(sect) => unsafe {
2494-
do sect.as_c_str |buf| {
2495-
llvm::LLVMSetSection(v, buf);
2496-
}
2497-
},
2498-
None => ()
24992491
}
2500-
v
25012492
}
25022493
ast_map::node_trait_method(trait_method, _, pth) => {
25032494
debug!("get_item_val(): processing a node_trait_method");

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3996,37 +3996,50 @@ impl Parser {
39963996
let prefix = prefix.dir_path();
39973997
let mod_path_stack = &*self.mod_path_stack;
39983998
let mod_path = Path(".").push_many(*mod_path_stack);
3999+
let dir_path = prefix.push_many(mod_path.components);
39994000
let file_path = match ::attr::first_attr_value_str_by_name(
40004001
outer_attrs, "path") {
40014002
Some(d) => {
40024003
let path = Path(d);
40034004
if !path.is_absolute {
4004-
mod_path.push(d)
4005+
dir_path.push(d)
40054006
} else {
40064007
path
40074008
}
40084009
}
4009-
None => mod_path.push(token::interner_get(id.name) + ".rs") // default
4010+
None => {
4011+
let mod_name = token::interner_get(id.name).to_owned();
4012+
let default_path_str = mod_name + ".rs";
4013+
let secondary_path_str = mod_name + "/mod.rs";
4014+
let default_path = dir_path.push(default_path_str);
4015+
let secondary_path = dir_path.push(secondary_path_str);
4016+
let default_exists = default_path.exists();
4017+
let secondary_exists = secondary_path.exists();
4018+
match (default_exists, secondary_exists) {
4019+
(true, false) => default_path,
4020+
(false, true) => secondary_path,
4021+
(false, false) => {
4022+
self.span_fatal(id_sp, fmt!("file not found for module `%s`", mod_name));
4023+
}
4024+
(true, true) => {
4025+
self.span_fatal(id_sp,
4026+
fmt!("file for module `%s` found at both %s and %s",
4027+
mod_name, default_path_str, secondary_path_str));
4028+
}
4029+
}
4030+
}
40104031
};
40114032

4012-
self.eval_src_mod_from_path(prefix,
4013-
file_path,
4033+
self.eval_src_mod_from_path(file_path,
40144034
outer_attrs.to_owned(),
40154035
id_sp)
40164036
}
40174037

40184038
fn eval_src_mod_from_path(&self,
4019-
prefix: Path,
40204039
path: Path,
40214040
outer_attrs: ~[ast::Attribute],
40224041
id_sp: span) -> (ast::item_, ~[ast::Attribute]) {
4023-
4024-
let full_path = if path.is_absolute {
4025-
path
4026-
} else {
4027-
prefix.push_many(path.components)
4028-
};
4029-
let full_path = full_path.normalize();
4042+
let full_path = path.normalize();
40304043

40314044
let maybe_i = do self.sess.included_mod_stack.iter().position |p| { *p == full_path };
40324045
match maybe_i {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both
12+
13+
fn main() {
14+
assert_eq!(mod_file_aux::bar(), 10);
15+
}

branches/snap-stage3/src/test/compile-fail/missingmod.rc renamed to branches/snap-stage3/src/test/compile-fail/mod_file_disambig_aux.rs

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

11-
// error-pattern:error opening
12-
13-
mod doesnotexist;
11+
// xfail-test not a test. aux file
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-test not a test. aux file

branches/snap-stage3/src/test/compile-fail/mod_file_not_exist.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-
mod not_a_real_file; //~ ERROR not_a_real_file.rs
11+
mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
1212

1313
fn main() {
1414
assert_eq!(mod_file_aux::bar(), 10);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-pretty
12+
// xfail-fast
13+
14+
mod mod_dir_implicit_aux;
15+
16+
pub fn main() {
17+
assert_eq!(mod_dir_implicit_aux::foo(), 10);
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn foo() -> int { 10 }

0 commit comments

Comments
 (0)