Skip to content

Rolling up PRs in the queue #22541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 96 commits into from
Feb 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5550beb
Move remaning compile-fail tests that are rejected by the parser to p…
fhahn Feb 8, 2015
6824f13
Add pfail targets for parse-fail tests
fhahn Feb 11, 2015
378abdb
Simplify the codegen in iter_vec_loop
dotdash Feb 17, 2015
0fe880b
Use the right array type in trans_slice_vec
dotdash Feb 17, 2015
02e1d5e
When converting parameters for an object type, be careful of defaults…
nikomatsakis Feb 17, 2015
ff388c1
Traits that reference `Self` in the supertrait list are not object-sa…
nikomatsakis Feb 17, 2015
5705d48
Implement RandomAccessIterator for Cloned
Ryman Feb 13, 2015
2f586b9
Opt for .cloned() over .map(|x| x.clone()) etc.
Ryman Feb 13, 2015
061206b
Remove usage of .map(|&foo| foo)
Ryman Feb 15, 2015
d2f54e6
librustc: implement Clone for middle::ty::FreeVar
Ryman Feb 15, 2015
b8527c0
Fixed link in ffi documentation
riginding Feb 18, 2015
52b5150
Avoid ptrtoint when checking if a pointer is null
dotdash Feb 2, 2015
7412d1b
Eliminate excessive null-checks from slice iterators
dotdash Feb 2, 2015
f82e231
Audit `core::borrow` for use of `int/uint`: use `i32` in doc example.
pnkfelix Feb 18, 2015
343909b
Audit `core::cmp` for `int/uint`.
pnkfelix Feb 18, 2015
e240cb9
Audit `core::default` for `int`/`uint` usage.
pnkfelix Feb 18, 2015
fc0f6e8
Audit `core::intrinsics` for `int`/`uint`: `size_of`/`align_of` use …
pnkfelix Feb 18, 2015
2594d56
Introduce the new phantomdata/phantomfn markers and integrate them
nikomatsakis Feb 12, 2015
91eedfe
Report errors for type parameters that are not constrained, either by
nikomatsakis Feb 12, 2015
8c841f2
Extend coherence check to understand subtyping.
nikomatsakis Feb 12, 2015
801bc48
Rewrite `Unique<T>` so that it is covariant in T, implies `NonZero` a…
nikomatsakis Feb 12, 2015
f2529ac
Constrain operands to outlive the operation. Fixes #21422.
nikomatsakis Feb 12, 2015
c5579ca
Fallout: Port Vec to use `Unique`
nikomatsakis Feb 12, 2015
b3c00a6
Fallout: btree. Rephrase invariant lifetime in terms of PhantomData.
nikomatsakis Feb 12, 2015
68ebe64
Fallout: port btree to use Unique, some markers.
nikomatsakis Feb 12, 2015
c2891cc
Fallout: EnumSet, add Marker.
nikomatsakis Feb 12, 2015
8dbdcdb
Fallout: RingBuf, use Unique.
nikomatsakis Feb 12, 2015
2bcf3a4
Fallout: arena needs to use phantomdata since invariantlifetime is gone
nikomatsakis Feb 12, 2015
1735e41
Fallout: AtomicPtr needs phantom data to indicate that it contains an…
nikomatsakis Feb 12, 2015
d801a4d
Fallout: iter, add markers or other changes such that all type parame…
nikomatsakis Feb 12, 2015
ef42c2b
Fallout: docs, elided examples often elided too much.
nikomatsakis Feb 12, 2015
872ce47
Fallout: tests. As tests frequently elide things, lots of changes
nikomatsakis Feb 12, 2015
60f507b
Fallout: remove unused type and region parameters.
nikomatsakis Feb 12, 2015
aaf4176
Fallout: Port slice to use `PhantomData` instead of `ContravariantLif…
nikomatsakis Feb 12, 2015
2953710
Fallout: port libflate to new Unique API
nikomatsakis Feb 12, 2015
199b992
Fallout: add phantom data to librand
nikomatsakis Feb 12, 2015
62b5177
Fallout: add phantom data to the type inferencer
nikomatsakis Feb 12, 2015
1ed5842
Fallout: extend thread with phantomdata for `'a` lifetime
nikomatsakis Feb 12, 2015
9e0bb52
Fallout: add phantomdata for 'a in path
nikomatsakis Feb 12, 2015
ae7c534
Fallout: port hashmap to use Unique
nikomatsakis Feb 12, 2015
6f2a1c9
Fallout: add phantomdata to hash
nikomatsakis Feb 12, 2015
df76442
Fallout: Accepter trait needs phantomdata. This seems like it should
nikomatsakis Feb 12, 2015
d179bb5
Add regression test for #20533. Fixes #20533.
nikomatsakis Feb 13, 2015
e8cb11c
Missing test.
nikomatsakis Feb 18, 2015
f83e23a
std: Stabilize the `hash` module
alexcrichton Feb 18, 2015
5fa9de1
Implement RFC 580
aturon Feb 18, 2015
4a9d190
make Extend use IntoIterator
Gankra Feb 18, 2015
66613e2
make FromIterator use IntoIterator
Gankra Feb 18, 2015
204e2bd
Style all docblock links properly
nagisa Feb 18, 2015
a36fc2d
Fix inconsistent spacing of collapse all button
nagisa Feb 18, 2015
a2393e6
WIP -- improve documentation on the phantom traits
nikomatsakis Feb 18, 2015
4acc483
Simplify README by not talking about the source tarball option
brson Feb 16, 2015
21ed20b
README: Give a hint about how to build Cargo from source.
brson Feb 16, 2015
9265e13
README: Make the wiki links more useful.
brson Feb 16, 2015
4618955
README: Add a link to #rust
brson Feb 16, 2015
aaabdbf
README: Add one sentence about what Rust is.
brson Feb 16, 2015
73cc4ed
README: Simplify markdown
brson Feb 16, 2015
7430e58
Address review feedback
brson Feb 18, 2015
c273571
Remove mention of wiki from README
brson Feb 18, 2015
d622235
Add deprecated versions of the old markers and integrate them back in…
nikomatsakis Feb 18, 2015
1860ee5
std: Implement CString-related RFCs
alexcrichton Feb 18, 2015
74199c2
Try to write some basic docs.
nikomatsakis Feb 18, 2015
f5491e6
Stabilize Send/Sync.
nikomatsakis Feb 18, 2015
fa30c4f
rollup merge of #21886: dotdash/fast_slice_iter
alexcrichton Feb 18, 2015
c5fddd8
rollup merge of #22118: fhahn/separate-parse-fail-2
alexcrichton Feb 18, 2015
cc61f9c
Minor unused imports etc.
nikomatsakis Feb 18, 2015
9f8b9d6
Update tests to use #[feature(rustc_attrs)]
nikomatsakis Feb 18, 2015
c07ec50
rollup merge of #22287: Ryman/purge_carthographers
alexcrichton Feb 18, 2015
31166ec
rollup merge of #22395: brson/readme-cleanup
alexcrichton Feb 18, 2015
754db0f
rollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-a…
alexcrichton Feb 18, 2015
386d329
rollup merge of #22437: dotdash/fix_array_type
alexcrichton Feb 18, 2015
d8753a0
rollup merge of #22438: dotdash/iter_vec_loop
alexcrichton Feb 18, 2015
261364d
rollup merge of #22452: nikomatsakis/issue-22040-18956-Self
alexcrichton Feb 18, 2015
9774b7e
rollup merge of #22480: alexcrichton/hashv3
alexcrichton Feb 18, 2015
f365717
rollup merge of #22482: alexcrichton/cstr-changes
alexcrichton Feb 18, 2015
b90e407
rollup merge of #22484: riginding/master
alexcrichton Feb 18, 2015
9aee389
rollup merge of #22485: pnkfelix/fsk-int-uint-audit
alexcrichton Feb 18, 2015
5a32b4a
rollup merge of #22491: Gankro/into_iter
alexcrichton Feb 18, 2015
5250a82
rollup merge of #22497: nikomatsakis/suffixes
alexcrichton Feb 18, 2015
b64dfff
rollup merge of #22498: nagisa/style-fixes
alexcrichton Feb 18, 2015
64cd30e
Declare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism to
nikomatsakis Feb 18, 2015
9ea84ae
Replace all uses of `&foo[]` with `&foo[..]` en masse.
nikomatsakis Feb 18, 2015
a99e698
Stabilize std::borrow
aturon Feb 12, 2015
365bd9a
Round 1 fixes and rebase conflicts
alexcrichton Feb 18, 2015
2cdbd28
rollup merge of #22210: aturon/stab-final-borrow
alexcrichton Feb 18, 2015
231eeaa
rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
alexcrichton Feb 18, 2015
3e7a04c
Round 2 test fixes and conflicts
alexcrichton Feb 18, 2015
1506b34
rollup merge of #22286: nikomatsakis/variance-4b
alexcrichton Feb 18, 2015
d6e939a
Round 3 test fixes and conflicts
alexcrichton Feb 18, 2015
63f51ee
Exempt phantom fns from the object safety check
nikomatsakis Feb 19, 2015
b7c0813
Round 4 test fixes and rebase conflicts
alexcrichton Feb 19, 2015
b8d35de
rollup merge of #22517: brson/relnotes
alexcrichton Feb 19, 2015
cb29c46
Fix from niko for cfail tests
alexcrichton Feb 19, 2015
0cd54b8
Round 5 test fixes and rebase conflicts
alexcrichton Feb 19, 2015
163be75
Merge remote-tracking branch 'origin/master' into rollup
alexcrichton Feb 19, 2015
49771ba
Round 8 tex fixes
Manishearth Feb 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# The Rust Programming Language

This is a compiler for Rust, including standard libraries, tools and
documentation.
documentation. Rust is a systems programming language that is fast,
memory safe and multithreaded, but does not employ a garbage collector
or otherwise impose significant runtime overhead.

## Quick Start

Read ["Installing Rust"][install] from [The Book][trpl].
Read ["Installing Rust"] from [The Book].

[install]: http://doc.rust-lang.org/book/installing-rust.html
[trpl]: http://doc.rust-lang.org/book/index.html
["Installing Rust"]: http://doc.rust-lang.org/book/installing-rust.html
[The Book]: http://doc.rust-lang.org/book/index.html

## Building from Source

Expand All @@ -19,22 +21,14 @@ Read ["Installing Rust"][install] from [The Book][trpl].
* `curl`
* `git`

2. Download and build Rust:

You can either download a [tarball] or build directly from the [repo].

To build from the [tarball] do:

$ curl -O https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
$ tar -xzf rustc-nightly-src.tar.gz
$ cd rustc-nightly

Or to build from the [repo] do:
2. Clone the [source] with `git`:

$ git clone https://github.com/rust-lang/rust.git
$ cd rust

Now that you have Rust's source code, you can configure and build it:
[source]: https://github.com/rust-lang/rust

3. Build and install:

$ ./configure
$ make && make install
Expand All @@ -46,7 +40,10 @@ Read ["Installing Rust"][install] from [The Book][trpl].

When complete, `make install` will place several programs into
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
API-documentation tool.
API-documentation tool. This install does not include [Cargo],
Rust's package manager, which you may also want to build.

[Cargo]: https://github.com/rust-lang/cargo

### Building on Windows

Expand All @@ -72,9 +69,6 @@ $ pacman -S base-devel
$ ./configure
$ make && make install

[repo]: https://github.com/rust-lang/rust
[tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz

## Notes

Since the Rust compiler is written in Rust, it must be built by a
Expand All @@ -94,9 +88,9 @@ supported build environments that are most likely to work.
Rust currently needs about 1.5 GiB of RAM to build without swapping; if it hits
swap, it will take a very long time to build.

There is a lot more documentation in the [wiki].
There is more advice about hacking on Rust in [CONTRIBUTING.md].

[wiki]: https://github.com/rust-lang/rust/wiki
[CONTRIBUTING.md]: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md

## Getting help

Expand All @@ -114,6 +108,14 @@ The Rust community congregates in a few places:

To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).

Rust has an [IRC] culture and most real-time collaboration happens in a
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
most popular channel is [#rust], a venue for general discussion about
Rust, and a good place to ask for help,

[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust

## License

Rust is primarily distributed under the terms of both the MIT license
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ do
make_dir $h/test/run-pass-fulldeps
make_dir $h/test/run-fail
make_dir $h/test/compile-fail
make_dir $h/test/parse-fail
make_dir $h/test/compile-fail-fulldeps
make_dir $h/test/bench
make_dir $h/test/perf
Expand Down
17 changes: 13 additions & 4 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
check-lite: cleantestlibs cleantmptestlogs \
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
check-stage2-rpass check-stage2-rpass-valgrind \
check-stage2-rfail check-stage2-cfail check-stage2-rmake
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
check-stage2-rfail check-stage2-cfail check-stage2-rmake
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

# Only check the docs.
Expand Down Expand Up @@ -291,6 +291,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
Expand Down Expand Up @@ -470,7 +471,8 @@ RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
RFAIL_TESTS := $(RFAIL_RS)
CFAIL_TESTS := $(CFAIL_RS) $(PFAIL_RS)
CFAIL_TESTS := $(CFAIL_RS)
PFAIL_TESTS := $(PFAIL_RS)
BENCH_TESTS := $(BENCH_RS)
PERF_TESTS := $(PERF_RS)
PRETTY_TESTS := $(PRETTY_RS)
Expand Down Expand Up @@ -508,6 +510,11 @@ CTEST_BUILD_BASE_cfail = compile-fail
CTEST_MODE_cfail = compile-fail
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)

CTEST_SRC_BASE_pfail = parse-fail
CTEST_BUILD_BASE_pfail = parse-fail
CTEST_MODE_pfail = parse-fail
CTEST_RUNTOOL_pfail = $(CTEST_RUNTOOL)

CTEST_SRC_BASE_bench = bench
CTEST_BUILD_BASE_bench = bench
CTEST_MODE_bench = run-pass
Expand Down Expand Up @@ -630,6 +637,7 @@ CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
Expand Down Expand Up @@ -698,7 +706,7 @@ endif

endef

CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail pfail bench perf debuginfo-gdb debuginfo-lldb codegen

$(foreach host,$(CFG_HOST), \
$(eval $(foreach target,$(CFG_TARGET), \
Expand Down Expand Up @@ -857,6 +865,7 @@ TEST_GROUPS = \
cfail-full \
rfail \
cfail \
pfail \
bench \
perf \
rmake \
Expand Down
3 changes: 3 additions & 0 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::str::FromStr;
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum Mode {
CompileFail,
ParseFail,
RunFail,
RunPass,
RunPassValgrind,
Expand All @@ -29,6 +30,7 @@ impl FromStr for Mode {
fn from_str(s: &str) -> Result<Mode, ()> {
match s {
"compile-fail" => Ok(CompileFail),
"parse-fail" => Ok(ParseFail),
"run-fail" => Ok(RunFail),
"run-pass" => Ok(RunPass),
"run-pass-valgrind" => Ok(RunPassValgrind),
Expand All @@ -45,6 +47,7 @@ impl fmt::Display for Mode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(match *self {
CompileFail => "compile-fail",
ParseFail => "parse-fail",
RunFail => "run-fail",
RunPass => "run-pass",
RunPassValgrind => "run-pass-valgrind",
Expand Down
3 changes: 2 additions & 1 deletion src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#![feature(test)]
#![feature(unicode)]
#![feature(env)]
#![feature(core)]

#![deny(warnings)]

Expand Down Expand Up @@ -72,7 +73,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
reqopt("", "mode", "which sort of compile tests to run",
"(compile-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
"(compile-fail|parse-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
optflag("", "ignored", "run tests marked as ignored"),
optopt("", "runtool", "supervisor program to run tests under \
(eg. emulator, valgrind)", "PROGRAM"),
Expand Down
9 changes: 5 additions & 4 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use self::TargetLocation::*;

use common::Config;
use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
use common::{Codegen, DebugInfoLldb};
use errors;
use header::TestProps;
Expand Down Expand Up @@ -66,6 +66,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
debug!("loaded props");
match config.mode {
CompileFail => run_cfail_test(&config, &props, &testfile),
ParseFail => run_cfail_test(&config, &props, &testfile),
RunFail => run_rfail_test(&config, &props, &testfile),
RunPass => run_rpass_test(&config, &props, &testfile),
RunPassValgrind => run_valgrind_test(&config, &props, &testfile),
Expand All @@ -88,7 +89,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
let proc_res = compile_test(config, props, testfile);

if proc_res.status.success() {
fatal_proc_rec("compile-fail test compiled successfully!",
fatal_proc_rec(&format!("{} test compiled successfully!", config.mode)[],
&proc_res);
}

Expand Down Expand Up @@ -688,7 +689,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
.unwrap()
.to_string();

script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[])[]);
script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[..])[]);
script_str.push_str("type summary add --no-value ");
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
script_str.push_str("-x \".*\" --category Rust\n");
Expand Down Expand Up @@ -1133,7 +1134,7 @@ fn compile_test_(config: &Config, props: &TestProps,
// FIXME (#9639): This needs to handle non-utf8 paths
let mut link_args = vec!("-L".to_string(),
aux_dir.as_str().unwrap().to_string());
link_args.extend(extra_args.iter().map(|s| s.clone()));
link_args.extend(extra_args.iter().cloned());
let args = make_compile_args(config,
props,
link_args,
Expand Down
12 changes: 6 additions & 6 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ the final namespace qualifier is omitted.
Two examples of paths with type arguments:

```
# struct HashMap<K, V>;
# struct HashMap<K, V>(K,V);
# fn f() {
# fn id<T>(t: T) -> T { t }
type T = HashMap<i32,String>; // Type arguments used in a type expression
Expand Down Expand Up @@ -1599,7 +1599,7 @@ pointer values (pointing to a type for which an implementation of the given
trait is in scope) to pointers to the trait name, used as a type.

```
# trait Shape { }
# trait Shape { fn dummy(&self) { } }
# impl Shape for i32 { }
# let mycircle = 0i32;
let myshape: Box<Shape> = Box::new(mycircle) as Box<Shape>;
Expand Down Expand Up @@ -1630,8 +1630,8 @@ let x: f64 = Num::from_i32(42);
Traits may inherit from other traits. For example, in

```
trait Shape { fn area() -> f64; }
trait Circle : Shape { fn radius() -> f64; }
trait Shape { fn area(&self) -> f64; }
trait Circle : Shape { fn radius(&self) -> f64; }
```

the syntax `Circle : Shape` means that types that implement `Circle` must also
Expand Down Expand Up @@ -1725,7 +1725,7 @@ type parameters taken by the trait it implements. Implementation parameters
are written after the `impl` keyword.

```
# trait Seq<T> { }
# trait Seq<T> { fn dummy(&self, _: T) { } }
impl<T> Seq<T> for Vec<T> {
/* ... */
}
Expand Down Expand Up @@ -3583,7 +3583,7 @@ An example of each kind:
```{rust}
let vec: Vec<i32> = vec![1, 2, 3];
let arr: [i32; 3] = [1, 2, 3];
let s: &[i32] = &vec[];
let s: &[i32] = &vec[..];
```

As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ extern {
}

fn main() {
let prompt = CString::from_slice(b"[my-awesome-shell] $");
unsafe {
let prompt = CString::new("[my-awesome-shell] $").unwrap();
unsafe {
rl_prompt = prompt.as_ptr();

println!("{:?}", rl_prompt);
Expand Down Expand Up @@ -541,6 +541,6 @@ pub extern fn hello_rust() -> *const u8 {

The `extern` makes this function adhere to the C calling convention, as
discussed above in "[Foreign Calling
Conventions](guide-ffi.html#foreign-calling-conventions)". The `no_mangle`
Conventions](ffi.html#foreign-calling-conventions)". The `no_mangle`
attribute turns off Rust's name mangling, so that it is easier to link to.

2 changes: 1 addition & 1 deletion src/doc/trpl/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ If you want to match against a slice or array, you can use `&`:
fn main() {
let v = vec!["match_this", "1"];

match &v[] {
match &v[..] {
["match_this", second] => println!("The second element is {}", second),
_ => {},
}
Expand Down
15 changes: 8 additions & 7 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ use core::prelude::*;

use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::borrow::BorrowFrom;
use core::fmt;
use core::cmp::{Ordering};
use core::default::Default;
Expand Down Expand Up @@ -244,12 +243,6 @@ impl<T> Clone for Arc<T> {
}
}

impl<T> BorrowFrom<Arc<T>> for T {
fn borrow_from(owned: &Arc<T>) -> &T {
&**owned
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Deref for Arc<T> {
type Target = T;
Expand Down Expand Up @@ -605,11 +598,19 @@ impl<T: Default + Sync + Send> Default for Arc<T> {
fn default() -> Arc<T> { Arc::new(Default::default()) }
}

#[cfg(stage0)]
impl<H: Hasher, T: Hash<H>> Hash<H> for Arc<T> {
fn hash(&self, state: &mut H) {
(**self).hash(state)
}
}
#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Hash> Hash for Arc<T> {
fn hash<H: Hasher>(&self, state: &mut H) {
(**self).hash(state)
}
}

#[cfg(test)]
mod tests {
Expand Down
Loading