Skip to content

Commit da7be3c

Browse files
committed
---
yaml --- r: 77271 b: refs/heads/snap-stage3 c: 35a4177 h: refs/heads/master i: 77269: 0c4d117 77267: a0f73af 77263: 443a319 v: v3
1 parent d1a66f5 commit da7be3c

File tree

429 files changed

+6969
-14789
lines changed

Some content is hidden

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

429 files changed

+6969
-14789
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: f1132496dddbdd88f321a7919eec3d65136b3f75
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c822d1070ac39871165df30ac8d09e733a6e7fb9
4+
refs/heads/snap-stage3: 35a41775505b9c7bb7b5ad9bfe1b7b7a6afb27b8
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ src/rt/msvc/* -whitespace
88
src/rt/vg/* -whitespace
99
src/rt/linenoise/* -whitespace
1010
src/rt/jemalloc/**/* -whitespace
11-
src/rt/jemalloc/include/jemalloc/jemalloc.h.in text eol=lf
12-
src/rt/jemalloc/include/jemalloc/jemalloc_defs.h.in text eol=lf
13-
src/rt/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in text eol=lf

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ ifdef CFG_DISABLE_OPTIMIZE
9696
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
9797
CFG_RUSTC_FLAGS +=
9898
else
99-
# The rtopt cfg turns off runtime sanity checks
100-
CFG_RUSTC_FLAGS += -O --cfg rtopt
99+
CFG_RUSTC_FLAGS += -O
101100
endif
102101

103102
ifdef CFG_ENABLE_DEBUG

branches/snap-stage3/configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,7 @@ do
739739
make_dir $h/test/doc-tutorial-ffi
740740
make_dir $h/test/doc-tutorial-macros
741741
make_dir $h/test/doc-tutorial-borrowed-ptr
742-
make_dir $h/test/doc-tutorial-container
743742
make_dir $h/test/doc-tutorial-tasks
744-
make_dir $h/test/doc-tutorial-conditions
745743
make_dir $h/test/doc-rust
746744
done
747745

branches/snap-stage3/doc/rust.md

Lines changed: 17 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ extern mod complicated_mod = "some-file/in/the-rust/path";
788788
##### Use declarations
789789

790790
~~~~~~~~ {.ebnf .gram}
791-
use_decl : "pub" ? "use" ident [ '=' path
791+
use_decl : "pub"? "use" ident [ '=' path
792792
| "::" path_glob ] ;
793793
794794
path_glob : ident [ "::" path_glob ] ?
@@ -851,38 +851,6 @@ In this example, the module `quux` re-exports all of the public names defined in
851851

852852
Also note that the paths contained in `use` items are relative to the crate root.
853853
So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
854-
This also means that top-level module declarations should be at the crate root if direct usage
855-
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
856-
at the beginning of a `use` item to refer to the current and direct parent modules respectively.
857-
All rules regarding accessing declared modules in `use` declarations applies to both module declarations
858-
and `extern mod` declarations.
859-
860-
An example of what will and will not work for `use` items:
861-
~~~~
862-
# #[allow(unused_imports)];
863-
use foo::extra; // good: foo is at the root of the crate
864-
use foo::baz::foobaz; // good: foo is at the root of the crate
865-
866-
mod foo {
867-
extern mod extra;
868-
869-
use foo::extra::list; // good: foo is at crate root
870-
// use extra::*; // bad: extra is not at the crate root
871-
use self::baz::foobaz; // good: self refers to module 'foo'
872-
use foo::bar::foobar; // good: foo is at crate root
873-
874-
pub mod bar {
875-
pub fn foobar() { }
876-
}
877-
878-
pub mod baz {
879-
use super::bar::foobar; // good: super refers to module 'foo'
880-
pub fn foobaz() { }
881-
}
882-
}
883-
884-
fn main() {}
885-
~~~~
886854

887855
### Functions
888856

@@ -1038,25 +1006,20 @@ code_. They are defined in the same way as any other Rust function,
10381006
except that they have the `extern` modifier.
10391007

10401008
~~~
1041-
// Declares an extern fn, the ABI defaults to "C"
10421009
extern fn new_vec() -> ~[int] { ~[] }
1043-
1044-
// Declares an extern fn with "stdcall" ABI
1045-
extern "stdcall" fn new_vec_stdcall() -> ~[int] { ~[] }
10461010
~~~
10471011

1048-
Unlike normal functions, extern fns have an `extern "ABI" fn()`.
1049-
This is the same type as the functions declared in an extern
1050-
block.
1012+
Extern functions may not be called from Rust code,
1013+
but Rust code may take their value as a raw `u8` pointer.
10511014

10521015
~~~
10531016
# extern fn new_vec() -> ~[int] { ~[] }
1054-
let fptr: extern "C" fn() -> ~[int] = new_vec;
1017+
let fptr: *u8 = new_vec;
10551018
~~~
10561019

1057-
Extern functions may be called from Rust code, but
1058-
caution must be taken with respect to the size of the stack
1059-
segment, just as when calling an extern function normally.
1020+
The primary motivation for extern functions is
1021+
to create callbacks for foreign functions that expect to receive function
1022+
pointers.
10601023

10611024
### Type definitions
10621025

@@ -1421,13 +1384,14 @@ between the Rust ABI and the foreign ABI.
14211384
A number of [attributes](#attributes) control the behavior of external
14221385
blocks.
14231386

1424-
By default external blocks assume that the library they are calling
1425-
uses the standard C "cdecl" ABI. Other ABIs may be specified using
1426-
an `abi` string, as shown here:
1387+
By default external blocks assume
1388+
that the library they are calling uses the standard C "cdecl" ABI.
1389+
Other ABIs may be specified using the `abi` attribute as in
14271390

14281391
~~~{.xfail-test}
14291392
// Interface to the Windows API
1430-
extern "stdcall" { }
1393+
#[abi = "stdcall"]
1394+
extern { }
14311395
~~~
14321396

14331397
The `link_name` attribute allows the name of the library to be specified.
@@ -1443,12 +1407,6 @@ This is particularly useful for creating external blocks for libc,
14431407
which tends to not follow standard library naming conventions
14441408
and is linked to all Rust programs anyway.
14451409

1446-
The type of a function
1447-
declared in an extern block
1448-
is `extern "abi" fn(A1, ..., An) -> R`,
1449-
where `A1...An` are the declared types of its arguments
1450-
and `R` is the decalred return type.
1451-
14521410
## Attributes
14531411

14541412
~~~~~~~~{.ebnf .gram}
@@ -1962,7 +1920,7 @@ it is automatically dereferenced to make the field access possible.
19621920
### Vector expressions
19631921

19641922
~~~~~~~~{.ebnf .gram}
1965-
vec_expr : '[' "mut" ? vec_elems? ']'
1923+
vec_expr : '[' "mut"? vec_elems? ']'
19661924
19671925
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
19681926
~~~~~~~~
@@ -2906,16 +2864,17 @@ the vtable pointer for the `T` implementation of `R`, and the pointer value of `
29062864
An example of an object type:
29072865

29082866
~~~~~~~~
2867+
# use std::int;
29092868
trait Printable {
2910-
fn to_string(&self) -> ~str;
2869+
fn to_str(&self) -> ~str;
29112870
}
29122871
29132872
impl Printable for int {
2914-
fn to_string(&self) -> ~str { self.to_str() }
2873+
fn to_str(&self) -> ~str { int::to_str(*self) }
29152874
}
29162875
29172876
fn print(a: @Printable) {
2918-
println(a.to_string());
2877+
println(a.to_str());
29192878
}
29202879
29212880
fn main() {

0 commit comments

Comments
 (0)