Skip to content

Commit 36a5c89

Browse files
---
yaml --- r: 64495 b: refs/heads/snap-stage3 c: a1303cc h: refs/heads/master i: 64493: 4e7c6f5 64491: 563d63b 64487: 271148a 64479: abacdcc v: v3
1 parent 1228fbd commit 36a5c89

Some content is hidden

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

65 files changed

+3013
-1131
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: 098709aa638bb29998b5e6f2700997b13c2c6712
4+
refs/heads/snap-stage3: a1303cc81565a019d59be28940a94caf0f9329bf
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ endef
249249

250250
# Same interface as above, but deletes rather than just listing the files.
251251
define REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT
252-
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: removing previous" \'$(2)\' "libraries:" $$MATCHES; rm $$MATCHES ; fi
252+
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: removing previous" \'$(2)\' "libraries:" $$MATCHES; rm -v $$MATCHES ; fi
253253
endef
254254

255255
# We use a different strategy for LIST_ALL_OLD_GLOB_MATCHES_EXCEPT

branches/snap-stage3/README.md

Lines changed: 48 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,18 @@
33
This is a compiler for Rust, including standard libraries, tools and
44
documentation.
55

6-
## Quick Start
76

8-
### Windows
7+
## Installation
98

10-
1. Download and use the [installer][win-exe].
11-
2. Read the [tutorial].
12-
2. Enjoy!
9+
The Rust compiler currently must be built from a [tarball], unless you
10+
are on Windows, in which case using the [installer][win-exe] is
11+
recommended.
1312

14-
> ***Note:*** Windows users should read the detailed
15-
> [getting started][wiki-start] notes on the wiki. Even when using
16-
> the binary installer the Windows build requires a MinGW installation,
17-
> the precise details of which are not discussed here.
18-
19-
[tutorial]: http://static.rust-lang.org/doc/tutorial.html
20-
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
21-
[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe
22-
23-
### Linux / OS X
24-
25-
1. Install the prerequisites (if not already installed)
26-
* g++ 4.4 or clang++ 3.x
27-
* python 2.6 or later (but not 3.x)
28-
* perl 5.0 or later
29-
* gnu make 3.81 or later
30-
* curl
31-
2. Download and build Rust
32-
You can either download a [tarball] or build directly from the [repo].
33-
34-
To build from the [tarball] do:
35-
36-
$ curl -O http://static.rust-lang.org/dist/rust-0.7.tar.gz
37-
$ tar -xzf rust-0.7.tar.gz
38-
$ cd rust-0.7
39-
40-
Or to build from the [repo] do:
41-
42-
$ git clone https://github.com/mozilla/rust.git
43-
$ cd rust
44-
45-
Now that you have Rust's source code, you can configure and build it:
46-
47-
$ ./configure
48-
$ make && make install
49-
50-
You may need to use `sudo make install` if you do not normally have
51-
permission to modify the destination directory. The install locations can
52-
be adjusted by passing a `--prefix` argument to `configure`. Various other
53-
options are also supported, pass `--help` for more information on them.
54-
55-
When complete, `make install` will place several programs into
56-
`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
57-
API-documentation tool, and `rustpkg`, the Rust package manager and build
58-
system.
59-
3. Read the [tutorial].
60-
4. Enjoy!
61-
62-
[repo]: https://github.com/mozilla/rust
63-
[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz
64-
[tutorial]: http://static.rust-lang.org/doc/tutorial.html
65-
66-
## Notes
67-
68-
Since the Rust compiler is written in Rust, it must be built by a
69-
precompiled "snapshot" version of itself (made in an earlier state of
70-
development). As such, source builds require a connection to the Internet, to
71-
fetch snapshots, and an OS that can execute the available snapshot binaries.
13+
Since the Rust compiler is written in Rust, it must be built by
14+
a precompiled "snapshot" version of itself (made in an earlier state
15+
of development). As such, source builds require a connection to
16+
the Internet, to fetch snapshots, and an OS that can execute the
17+
available snapshot binaries.
7218

7319
Snapshot binaries are currently built and tested on several platforms:
7420

@@ -79,12 +25,42 @@ Snapshot binaries are currently built and tested on several platforms:
7925
You may find that other platforms work, but these are our "tier 1"
8026
supported build environments that are most likely to work.
8127

82-
Rust currently needs about 1.8G of RAM to build without swapping; if it hits
83-
swap, it will take a very long time to build.
28+
> ***Note:*** Windows users should read the detailed
29+
> [getting started][wiki-start] notes on the wiki. Even when using
30+
> the binary installer the Windows build requires a MinGW installation,
31+
> the precise details of which are not discussed here.
32+
33+
To build from source you will also need the following prerequisite
34+
packages:
35+
36+
* g++ 4.4 or clang++ 3.x
37+
* python 2.6 or later (but not 3.x)
38+
* perl 5.0 or later
39+
* gnu make 3.81 or later
40+
* curl
41+
42+
Assuming you're on a relatively modern *nix system and have met the
43+
prerequisites, something along these lines should work.
44+
45+
$ curl -O http://static.rust-lang.org/dist/rust-0.7.tar.gz
46+
$ tar -xzf rust-0.7.tar.gz
47+
$ cd rust-0.7
48+
$ ./configure
49+
$ make && make install
8450

85-
There is lots more documentation in the [wiki].
51+
You may need to use `sudo make install` if you do not normally have
52+
permission to modify the destination directory. The install locations
53+
can be adjusted by passing a `--prefix` argument to
54+
`configure`. Various other options are also supported, pass `--help`
55+
for more information on them.
8656

87-
[wiki]: https://github.com/mozilla/rust/wiki
57+
When complete, `make install` will place several programs into
58+
`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
59+
API-documentation tool, and `rustpkg`, the Rust package manager and build system.
60+
61+
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
62+
[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz
63+
[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe
8864

8965

9066
## License
@@ -95,3 +71,8 @@ BSD-like licenses.
9571

9672
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
9773

74+
## More help
75+
76+
The [tutorial] is a good starting point.
77+
78+
[tutorial]: http://static.rust-lang.org/doc/tutorial.html

branches/snap-stage3/configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,9 @@ do
921921
esac
922922
need_ok "LLVM configure failed"
923923

924+
# Hack the tools Makefile to turn off the clang build
925+
sed -i 's/clang//g' tools/Makefile
926+
924927
cd $CFG_BUILD_DIR
925928
fi
926929

branches/snap-stage3/doc/rust.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,8 @@ The top level of this tree is a module that is anonymous (from the point of view
573573

574574
The Rust compiler is always invoked with a single source file as input, and always produces a single output crate.
575575
The processing of that source file may result in other source files being loaded as modules.
576-
Source files have the extension `.rs`.
576+
Source files typically have the extension `.rs` but, by convention,
577+
source files that represent crates have the extension `.rc`, called *crate files*.
577578

578579
A Rust source file describes a module, the name and
579580
location of which -- in the module tree of the current crate -- are defined
@@ -3285,7 +3286,7 @@ As an example, to see all the logs generated by the compiler, you would set
32853286
you would set it to `rustc::metadata::creader`. To see just error logging
32863287
use `rustc=0`.
32873288

3288-
Note that when compiling source files that don't specify a
3289+
Note that when compiling either `.rs` or `.rc` files that don't specify a
32893290
crate name the crate is given a default name that matches the source file,
32903291
with the extension removed. In that case, to turn on logging for a program
32913292
compiled from, e.g. `helloworld.rs`, `RUST_LOG` should be set to `helloworld`.

branches/snap-stage3/src/libextra/future.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,6 @@ impl<A:Clone> Future<A> {
6060
}
6161
}
6262

63-
impl<A> Future<A> {
64-
/// Gets the value from this future, forcing evaluation.
65-
pub fn unwrap(self) -> A {
66-
let mut this = self;
67-
this.get_ref();
68-
let state = replace(&mut this.state, Evaluating);
69-
match state {
70-
Forced(v) => v,
71-
_ => fail!( "Logic error." ),
72-
}
73-
}
74-
}
75-
7663
impl<A> Future<A> {
7764
pub fn get_ref<'a>(&'a mut self) -> &'a A {
7865
/*!
@@ -192,12 +179,6 @@ mod test {
192179
assert_eq!(f.get(), ~"fail");
193180
}
194181
195-
#[test]
196-
fn test_interface_unwrap() {
197-
let mut f = from_value(~"fail");
198-
assert_eq!(f.unwrap(), ~"fail");
199-
}
200-
201182
#[test]
202183
fn test_get_ref_method() {
203184
let mut f = from_value(22);

branches/snap-stage3/src/librustc/lib/llvm.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,14 @@ pub mod llvm {
16351635
#[fast_ffi]
16361636
pub unsafe fn LLVMABIAlignmentOfType(TD: TargetDataRef,
16371637
Ty: TypeRef) -> c_uint;
1638+
1639+
/** Computes the byte offset of the indexed struct element for a target. */
1640+
#[fast_ffi]
1641+
pub unsafe fn LLVMOffsetOfElement(TD: TargetDataRef,
1642+
StructTy: TypeRef,
1643+
Element: c_uint)
1644+
-> c_ulonglong;
1645+
16381646
/**
16391647
* Returns the minimum alignment of a type when part of a call frame.
16401648
*/
@@ -2089,6 +2097,37 @@ pub mod llvm {
20892097
Val: ValueRef,
20902098
VarInfo: DIVariable,
20912099
InsertBefore: ValueRef) -> ValueRef;
2100+
2101+
#[fast_ffi]
2102+
pub unsafe fn LLVMDIBuilderCreateEnumerator(
2103+
Builder: DIBuilderRef,
2104+
Name: *c_char,
2105+
Val: c_ulonglong) -> ValueRef;
2106+
2107+
#[fast_ffi]
2108+
pub unsafe fn LLVMDIBuilderCreateEnumerationType(
2109+
Builder: DIBuilderRef,
2110+
Scope: ValueRef,
2111+
Name: *c_char,
2112+
File: ValueRef,
2113+
LineNumber: c_uint,
2114+
SizeInBits: c_ulonglong,
2115+
AlignInBits: c_ulonglong,
2116+
Elements: ValueRef,
2117+
ClassType: ValueRef) -> ValueRef;
2118+
2119+
#[fast_ffi]
2120+
pub unsafe fn LLVMDIBuilderCreateUnionType(
2121+
Builder: DIBuilderRef,
2122+
Scope: ValueRef,
2123+
Name: *c_char,
2124+
File: ValueRef,
2125+
LineNumber: c_uint,
2126+
SizeInBits: c_ulonglong,
2127+
AlignInBits: c_ulonglong,
2128+
Flags: c_uint ,
2129+
Elements: ValueRef,
2130+
RunTimeLang: c_uint) -> ValueRef;
20922131
}
20932132
}
20942133

branches/snap-stage3/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
9090
}
9191

9292
pub fn get_enum_variants(tcx: ty::ctxt, def: ast::def_id)
93-
-> ~[ty::VariantInfo] {
93+
-> ~[@ty::VariantInfo] {
9494
let cstore = tcx.cstore;
9595
let cdata = cstore::get_crate_data(cstore, def.crate);
9696
return decoder::get_enum_variants(cstore.intr, cdata, def.node, tcx)

branches/snap-stage3/src/librustc/metadata/decoder.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,11 @@ pub fn maybe_get_item_ast(cdata: cmd, tcx: ty::ctxt,
733733
}
734734

735735
pub fn get_enum_variants(intr: @ident_interner, cdata: cmd, id: ast::node_id,
736-
tcx: ty::ctxt) -> ~[ty::VariantInfo] {
736+
tcx: ty::ctxt) -> ~[@ty::VariantInfo] {
737737
let data = cdata.data;
738738
let items = reader::get_doc(reader::Doc(data), tag_items);
739739
let item = find_item(id, items);
740-
let mut infos: ~[ty::VariantInfo] = ~[];
740+
let mut infos: ~[@ty::VariantInfo] = ~[];
741741
let variant_ids = enum_variant_ids(item, cdata);
742742
let mut disr_val = 0;
743743
for variant_ids.iter().advance |did| {
@@ -753,11 +753,16 @@ pub fn get_enum_variants(intr: @ident_interner, cdata: cmd, id: ast::node_id,
753753
Some(val) => { disr_val = val; }
754754
_ => { /* empty */ }
755755
}
756-
infos.push(@ty::VariantInfo_{args: arg_tys,
757-
ctor_ty: ctor_ty, name: name,
758-
// I'm not even sure if we encode visibility
759-
// for variants -- TEST -- tjc
760-
id: *did, disr_val: disr_val, vis: ast::inherited});
756+
infos.push(@ty::VariantInfo{
757+
args: arg_tys,
758+
arg_names: None,
759+
ctor_ty: ctor_ty,
760+
name: name,
761+
// I'm not even sure if we encode visibility
762+
// for variants -- TEST -- tjc
763+
id: *did,
764+
disr_val: disr_val,
765+
vis: ast::inherited});
761766
disr_val += 1;
762767
}
763768
return infos;

0 commit comments

Comments
 (0)