Skip to content

Commit 00b1a05

Browse files
committed
---
yaml --- r: 62969 b: refs/heads/snap-stage3 c: c68c015 h: refs/heads/master i: 62967: 12b360e v: v3
1 parent 5c975e1 commit 00b1a05

File tree

11 files changed

+244
-121
lines changed

11 files changed

+244
-121
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: fe70361bb6d89a6226d558c64c03d05bba46412b
4+
refs/heads/snap-stage3: c68c015798998448dd51af138f4a223fb94ea387
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rustpkg.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ or the equivalent on Windows.
3030

3131
Each workspace may contain one or more packages.
3232

33+
When building code that contains one or more directives of the form `extern mod P`,
34+
rustpkg automatically searches for packages named `P` in the `RUST_PATH` (as described above).
35+
It builds those dependencies if necessary.
36+
Thus, when using rustpkg,
37+
there is no need for `-L` flags to tell the linker where to find libraries for external crates.
38+
3339
# Package structure
3440

3541
A valid workspace must contain each of the following subdirectories:
@@ -66,6 +72,10 @@ A package can be stored in a workspace on the local file system,
6672
or on a remote Web server, in which case the package ID resembles a URL.
6773
For example, `github.com/mozilla/rust` is a package ID
6874
that would refer to the git repository browsable at `http://github.com/mozilla/rust`.
75+
A package ID can also specify a version, like:
76+
`github.com/mozilla/rust#0.3`.
77+
In this case, `rustpkg` will check that the repository `github.com/mozilla/rust` has a tag named `0.3`,
78+
and report an error otherwise.
6979

7080
## Source files
7181

@@ -76,6 +86,15 @@ rustpkg searches for four different fixed filenames in order to determine the cr
7686
* `test.rs`: Assumed to contain tests declared with the `#[test]` attribute.
7787
* `bench.rs`: Assumed to contain benchmarks declared with the `#[bench]` attribute.
7888

89+
## Versions
90+
91+
`rustpkg` packages do not need to declare their versions with an attribute inside one of the source files,
92+
because `rustpkg` infers it from the version control system.
93+
When building a package that is in a `git` repository,
94+
`rustpkg` assumes that the most recent tag specifies the current version.
95+
When building a package that is not under version control,
96+
or that has no tags, `rustpkg` assumes the intended version is 0.1.
97+
7998
# Custom build scripts
8099

81100
A file called `pkg.rs` at the root level in a workspace is called a *package script*.

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,15 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
17301730
// We really should do this regardless of whether self is owned, but
17311731
// it doesn't work right with default method impls yet. (FIXME: #2794)
17321732
if slf.is_owned {
1733-
let self_val = PointerCast(bcx, slf.v,
1734-
T_ptr(type_of(bcx.ccx(), slf.t)));
1733+
let self_val = if datum::appropriate_mode(slf.t).is_by_value() {
1734+
let tmp = BitCast(bcx, slf.v, type_of(bcx.ccx(), slf.t));
1735+
let alloc = alloc_ty(bcx, slf.t);
1736+
Store(bcx, tmp, alloc);
1737+
alloc
1738+
} else {
1739+
PointerCast(bcx, slf.v, T_ptr(type_of(bcx.ccx(), slf.t)))
1740+
};
1741+
17351742
fcx.llself = Some(ValSelfData {v: self_val, ..slf});
17361743
add_clean(bcx, self_val, slf.t);
17371744
}

branches/snap-stage3/src/libstd/pipes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use option::{None, Option, Some};
9494
use unstable::finally::Finally;
9595
use unstable::intrinsics;
9696
use ptr;
97-
use ptr::Ptr;
97+
use ptr::RawPtr;
9898
use task;
9999
use vec;
100100
use vec::OwnedVector;

branches/snap-stage3/src/libstd/prelude.rs

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

11-
/*!
12-
13-
Many programming languages have a 'prelude': a particular subset of the
14-
libraries that come with the language. Every program imports the prelude by
15-
default.
16-
17-
For example, it would be annoying to add `use io::println;` to every single
18-
program, and the vast majority of Rust programs will wish to print to standard
19-
output. Therefore, it makes sense to import it into every program.
20-
21-
Rust's prelude has three main parts:
22-
23-
1. io::print and io::println.
24-
2. Core operators, such as `Add`, `Mul`, and `Not`.
25-
3. Various types and traits, such as `Clone`, `Eq`, and `comm::Chan`.
26-
27-
*/
28-
11+
//! The Rust prelude. Imported into every module by default.
2912
3013
// Reexported core operators
3114
pub use either::{Either, Left, Right};
@@ -60,9 +43,9 @@ pub use path::GenericPath;
6043
pub use path::Path;
6144
pub use path::PosixPath;
6245
pub use path::WindowsPath;
63-
pub use ptr::Ptr;
46+
pub use ptr::RawPtr;
6447
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr};
65-
pub use str::{StrSlice, OwnedStr, StrUtil};
48+
pub use str::{StrVector, StrSlice, OwnedStr, StrUtil};
6649
pub use from_str::{FromStr};
6750
pub use to_bytes::IterBytes;
6851
pub use to_str::{ToStr, ToStrConsume};
@@ -73,7 +56,7 @@ pub use tuple::{CloneableTuple10, CloneableTuple11, CloneableTuple12};
7356
pub use tuple::{ImmutableTuple2, ImmutableTuple3, ImmutableTuple4, ImmutableTuple5};
7457
pub use tuple::{ImmutableTuple6, ImmutableTuple7, ImmutableTuple8, ImmutableTuple9};
7558
pub use tuple::{ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
76-
pub use vec::{CopyableVector, ImmutableVector};
59+
pub use vec::{VectorVector, CopyableVector, ImmutableVector};
7760
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
7861
pub use vec::{OwnedVector, OwnedCopyableVector, MutableVector};
7962
pub use io::{Reader, ReaderUtil, Writer, WriterUtil};

branches/snap-stage3/src/libstd/ptr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ pub unsafe fn array_each<T>(arr: **T, cb: &fn(*T)) {
296296
}
297297

298298
#[allow(missing_doc)]
299-
pub trait Ptr<T> {
299+
pub trait RawPtr<T> {
300300
fn is_null(&const self) -> bool;
301301
fn is_not_null(&const self) -> bool;
302302
unsafe fn to_option(&const self) -> Option<&T>;
303303
fn offset(&self, count: uint) -> Self;
304304
}
305305

306306
/// Extension methods for immutable pointers
307-
impl<T> Ptr<T> for *T {
307+
impl<T> RawPtr<T> for *T {
308308
/// Returns true if the pointer is equal to the null pointer.
309309
#[inline(always)]
310310
fn is_null(&const self) -> bool { is_null(*self) }
@@ -336,7 +336,7 @@ impl<T> Ptr<T> for *T {
336336
}
337337

338338
/// Extension methods for mutable pointers
339-
impl<T> Ptr<T> for *mut T {
339+
impl<T> RawPtr<T> for *mut T {
340340
/// Returns true if the pointer is equal to the null pointer.
341341
#[inline(always)]
342342
fn is_null(&const self) -> bool { is_null(*self) }

branches/snap-stage3/src/libstd/rt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Several modules in `core` are clients of `rt`:
5656

5757
#[doc(hidden)];
5858

59-
use ptr::Ptr;
59+
use ptr::RawPtr;
6060

6161
/// The global (exchange) heap.
6262
pub mod global_heap;

branches/snap-stage3/src/libstd/rt/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use container::Container;
12-
use ptr::Ptr;
12+
use ptr::RawPtr;
1313
use vec;
1414
use ops::Drop;
1515
use libc::{c_uint, uintptr_t};

branches/snap-stage3/src/libstd/rt/uv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use container::Container;
3838
use option::*;
3939
use str::raw::from_c_str;
4040
use to_str::ToStr;
41-
use ptr::Ptr;
41+
use ptr::RawPtr;
4242
use libc;
4343
use vec;
4444
use ptr;

0 commit comments

Comments
 (0)