Skip to content

Commit 737a03d

Browse files
committed
---
yaml --- r: 234729 b: refs/heads/tmp c: 49b1902 h: refs/heads/master i: 234727: 18ace87 v: v3
1 parent e5aaff8 commit 737a03d

File tree

22 files changed

+97
-237
lines changed

22 files changed

+97
-237
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: b2c7e7791a0793df5199e209470734e4f26dccbe
28+
refs/heads/tmp: 49b1902345468564a9da16d745cc1a5c5c650908
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/COMPILER_TESTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compiler Test Documentation
22

3-
In the Rust project, we use a special set of comands embedded in
3+
In the Rust project, we use a special set of comands imbedded in
44
comments to test the Rust compiler. There are two groups of commands:
55

66
1. Header commands
@@ -29,11 +29,11 @@ The error levels that you can have are:
2929
3. `NOTE`
3030
4. `HELP` and `SUGGESTION`*
3131

32-
\* **Note**: `SUGGESTION` must follow immediately after `HELP`.
32+
\* **Note**: `SUGGESTION` must follow emediatly after `HELP`.
3333

3434
## Summary of Header Commands
3535

36-
Header commands specify something about the entire test file as a
36+
Header commands specify something about the entire test file, as a
3737
whole, instead of just a few lines inside the test.
3838

3939
* `ignore-X` where `X` is an architecture, OS or stage will ignore the test accordingly

branches/tmp/RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 1.3.0 (2015-09-17)
1+
Version 1.3.0 (September 2015)
22
==============================
33

44
* ~900 changes, numerous bugfixes

branches/tmp/configure

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,12 +1095,6 @@ envopt CPP
10951095
envopt CFLAGS
10961096
envopt CXXFLAGS
10971097

1098-
# stdc++ name in use
1099-
# used to manage non-standard name (on OpenBSD for example)
1100-
program_transform_name=$($CFG_CC -v 2>&1 | sed -n "s/.*--program-transform-name='\([^']*\)'.*/\1/p")
1101-
CFG_STDCPP_NAME=$(echo "stdc++" | sed "${program_transform_name}")
1102-
putvar CFG_STDCPP_NAME
1103-
11041098
# a little post-processing of various config values
11051099
CFG_PREFIX=${CFG_PREFIX%/}
11061100
CFG_MANDIR=${CFG_MANDIR%/}

branches/tmp/mk/llvm.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
7373

7474
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
7575
LLVM_STDCPP_RUSTFLAGS_$(1) = -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
76-
-print-file-name=lib$(CFG_STDCPP_NAME).a))"
76+
-print-file-name=libstdc++.a))"
7777
else
7878
LLVM_STDCPP_RUSTFLAGS_$(1) =
7979
endif
@@ -83,7 +83,7 @@ endif
8383
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
8484
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
8585
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
86-
$$(LLVM_CONFIG_$(1)) "$(CFG_STDCPP_NAME)"
86+
$$(LLVM_CONFIG_$(1))
8787
endef
8888

8989
$(foreach host,$(CFG_HOST), \

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ systems may want to jump around.
2828
* [The `Result` type](#the-result-type)
2929
* [Parsing integers](#parsing-integers)
3030
* [The `Result` type alias idiom](#the-result-type-alias-idiom)
31-
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude:-unwrapping-isn't-evil)
31+
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isnt-evil)
3232
* [Working with multiple error types](#working-with-multiple-error-types)
3333
* [Composing `Option` and `Result`](#composing-option-and-result)
3434
* [The limits of combinators](#the-limits-of-combinators)
@@ -41,11 +41,11 @@ systems may want to jump around.
4141
* [The real `try!` macro](#the-real-try!-macro)
4242
* [Composing custom error types](#composing-custom-error-types)
4343
* [Advice for library writers](#advice-for-library-writers)
44-
* [Case study: A program to read population data](#case-study:-a-program-to-read-population-data)
44+
* [Case study: A program to read population data](#case-study-a-program-to-read-population-data)
4545
* [Initial setup](#initial-setup)
4646
* [Argument parsing](#argument-parsing)
4747
* [Writing the logic](#writing-the-logic)
48-
* [Error handling with `Box<Error>`](#error-handling-with-box%3Cerror%3E)
48+
* [Error handling with `Box<Error>`](#error-handling-with-box<error>)
4949
* [Reading from stdin](#reading-from-stdin)
5050
* [Error handling with a custom type](#error-handling-with-a-custom-type)
5151
* [Adding functionality](#adding-functionality)
@@ -87,9 +87,9 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90-
<a name="code-unwrap-double"></a>
91-
90+
<div id="code-unwrap-double">
9291
```rust,should_panic
92+
9393
use std::env;
9494
9595
fn main() {
@@ -99,6 +99,7 @@ fn main() {
9999
println!("{}", 2 * n);
100100
}
101101
```
102+
</div>
102103

103104
If you give this program zero arguments (error 1) or if the first argument
104105
isn't an integer (error 2), the program will panic just like in the first
@@ -139,8 +140,7 @@ system is an important concept because it will cause the compiler to force the
139140
programmer to handle that absence. Let's take a look at an example that tries
140141
to find a character in a string:
141142

142-
<a name="code-option-ex-string-find"></a>
143-
143+
<div id="code-option-ex-string-find">
144144
```rust
145145
// Searches `haystack` for the Unicode character `needle`. If one is found, the
146146
// byte offset of the character is returned. Otherwise, `None` is returned.
@@ -153,6 +153,7 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
153153
None
154154
}
155155
```
156+
</div>
156157

157158
Notice that when this function finds a matching character, it doen't just
158159
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or
@@ -186,8 +187,6 @@ But wait, what about `unwrap` used in [`unwrap-double`](#code-unwrap-double)?
186187
There was no case analysis there! Instead, the case analysis was put inside the
187188
`unwrap` method for you. You could define it yourself if you want:
188189

189-
<a name="code-option-def-unwrap"></a>
190-
191190
```rust
192191
enum Option<T> {
193192
None,
@@ -211,7 +210,7 @@ that makes `unwrap` ergonomic to use. Unfortunately, that `panic!` means that
211210

212211
### Composing `Option<T>` values
213212

214-
In [`option-ex-string-find`](#code-option-ex-string-find)
213+
In [`option-ex-string-find`](#code-option-ex-string-find-2)
215214
we saw how to use `find` to discover the extension in a file name. Of course,
216215
not all file names have a `.` in them, so it's possible that the file name has
217216
no extension. This *possibility of absence* is encoded into the types using
@@ -253,8 +252,6 @@ option is `None`, in which case, just return `None`.
253252
Rust has parametric polymorphism, so it is very easy to define a combinator
254253
that abstracts this pattern:
255254

256-
<a name="code-option-map"></a>
257-
258255
```rust
259256
fn map<F, T, A>(option: Option<T>, f: F) -> Option<A> where F: FnOnce(T) -> A {
260257
match option {
@@ -394,8 +391,6 @@ remove choices because they will panic if `Option<T>` is `None`.
394391
The `Result` type is also
395392
[defined in the standard library][6]:
396393

397-
<a name="code-result-def-1"></a>
398-
399394
```rust
400395
enum Result<T, E> {
401396
Ok(T),
@@ -672,8 +667,6 @@ with both an `Option` and a `Result`, the solution is *usually* to convert the
672667
(from `env::args()`) means the user didn't invoke the program correctly. We
673668
could just use a `String` to describe the error. Let's try:
674669

675-
<a name="code-error-double-string"></a>
676-
677670
```rust
678671
use std::env;
679672

@@ -906,8 +899,6 @@ seen above.
906899

907900
Here is a simplified definition of a `try!` macro:
908901

909-
<a nama name="code-try-def-simple"></a>
910-
911902
```rust
912903
macro_rules! try {
913904
($e:expr) => (match $e {
@@ -1168,8 +1159,6 @@ The `std::convert::From` trait is
11681159
[defined in the standard
11691160
library](../std/convert/trait.From.html):
11701161

1171-
<a name="code-from-def"></a>
1172-
11731162
```rust
11741163
trait From<T> {
11751164
fn from(T) -> Self;
@@ -1247,11 +1236,9 @@ macro_rules! try {
12471236
}
12481237
```
12491238

1250-
This is not its real definition. Its real definition is
1239+
This is not it's real definition. It's real definition is
12511240
[in the standard library](../std/macro.try!.html):
12521241

1253-
<a name="code-try-def"></a>
1254-
12551242
```rust
12561243
macro_rules! try {
12571244
($e:expr) => (match $e {
@@ -1470,7 +1457,7 @@ representation. But certainly, this will vary depending on use cases.
14701457
At a minimum, you should probably implement the
14711458
[`Error`](../std/error/trait.Error.html)
14721459
trait. This will give users of your library some minimum flexibility for
1473-
[composing errors](#the-real-try!-macro). Implementing the `Error` trait also
1460+
[composing errors](#the-real-try-macro). Implementing the `Error` trait also
14741461
means that users are guaranteed the ability to obtain a string representation
14751462
of an error (because it requires impls for both `fmt::Debug` and
14761463
`fmt::Display`).

branches/tmp/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ a few tricks up their sleeves.
147147

148148
For example, they’re [immutable][immutable] by default. That’s why our example
149149
uses `mut`: it makes a binding mutable, rather than immutable. `let` doesn’t
150-
take a name on the left hand side of the assignment, it actually accepts a
150+
take a name on the left hand side, it actually accepts a
151151
[pattern][patterns]’. We’ll use patterns later. It’s easy enough
152152
to use for now:
153153

branches/tmp/src/etc/mklldeps.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
components = sys.argv[2].split() # splits on whitespace
1818
enable_static = sys.argv[3]
1919
llvm_config = sys.argv[4]
20-
stdcpp_name = sys.argv[5]
2120

2221
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2322
// file at the top-level directory of this distribution and at
@@ -78,15 +77,15 @@ def run(args):
7877
out = run([llvm_config, '--cxxflags'])
7978
if enable_static == '1':
8079
assert('stdlib=libc++' not in out)
81-
f.write("#[link(name = \"" + stdcpp_name + "\", kind = \"static\")]\n")
80+
f.write("#[link(name = \"stdc++\", kind = \"static\")]\n")
8281
else:
8382
# Note that we use `cfg_attr` here because on MSVC the C++ standard library
8483
# is not c++ or stdc++, but rather the linker takes care of linking the
8584
# right standard library.
8685
if 'stdlib=libc++' in out:
8786
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"c++\"))]\n")
8887
else:
89-
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"" + stdcpp_name + "\"))]\n")
88+
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"stdc++\"))]\n")
9089

9190
# Attach everything to an extern block
9291
f.write("extern {}\n")

branches/tmp/src/librustc_borrowck/borrowck/check_loans.rs

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -464,36 +464,40 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
464464

465465
match (new_loan.kind, old_loan.kind) {
466466
(ty::MutBorrow, ty::MutBorrow) => {
467-
span_err!(self.bccx, new_loan.span, E0499,
468-
"cannot borrow `{}`{} as mutable \
469-
more than once at a time",
470-
nl, new_loan_msg);
467+
self.bccx.span_err(
468+
new_loan.span,
469+
&format!("cannot borrow `{}`{} as mutable \
470+
more than once at a time",
471+
nl, new_loan_msg))
471472
}
472473

473474
(ty::UniqueImmBorrow, _) => {
474-
span_err!(self.bccx, new_loan.span, E0500,
475-
"closure requires unique access to `{}` \
476-
but {} is already borrowed{}",
477-
nl, ol_pronoun, old_loan_msg);
475+
self.bccx.span_err(
476+
new_loan.span,
477+
&format!("closure requires unique access to `{}` \
478+
but {} is already borrowed{}",
479+
nl, ol_pronoun, old_loan_msg));
478480
}
479481

480482
(_, ty::UniqueImmBorrow) => {
481-
span_err!(self.bccx, new_loan.span, E0501,
482-
"cannot borrow `{}`{} as {} because \
483-
previous closure requires unique access",
484-
nl, new_loan_msg, new_loan.kind.to_user_str());
483+
self.bccx.span_err(
484+
new_loan.span,
485+
&format!("cannot borrow `{}`{} as {} because \
486+
previous closure requires unique access",
487+
nl, new_loan_msg, new_loan.kind.to_user_str()));
485488
}
486489

487490
(_, _) => {
488-
span_err!(self.bccx, new_loan.span, E0502,
489-
"cannot borrow `{}`{} as {} because \
490-
{} is also borrowed as {}{}",
491-
nl,
492-
new_loan_msg,
493-
new_loan.kind.to_user_str(),
494-
ol_pronoun,
495-
old_loan.kind.to_user_str(),
496-
old_loan_msg);
491+
self.bccx.span_err(
492+
new_loan.span,
493+
&format!("cannot borrow `{}`{} as {} because \
494+
{} is also borrowed as {}{}",
495+
nl,
496+
new_loan_msg,
497+
new_loan.kind.to_user_str(),
498+
ol_pronoun,
499+
old_loan.kind.to_user_str(),
500+
old_loan_msg));
497501
}
498502
}
499503

@@ -613,9 +617,11 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
613617
match self.analyze_restrictions_on_use(id, copy_path, ty::ImmBorrow) {
614618
UseOk => { }
615619
UseWhileBorrowed(loan_path, loan_span) => {
616-
span_err!(self.bccx, span, E0503,
617-
"cannot use `{}` because it was mutably borrowed",
618-
&self.bccx.loan_path_to_string(copy_path));
620+
self.bccx.span_err(
621+
span,
622+
&format!("cannot use `{}` because it was mutably borrowed",
623+
&self.bccx.loan_path_to_string(copy_path))
624+
);
619625
self.bccx.span_note(
620626
loan_span,
621627
&format!("borrow of `{}` occurs here",
@@ -636,19 +642,18 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
636642
match self.analyze_restrictions_on_use(id, move_path, ty::MutBorrow) {
637643
UseOk => { }
638644
UseWhileBorrowed(loan_path, loan_span) => {
639-
match move_kind {
645+
let err_message = match move_kind {
640646
move_data::Captured =>
641-
span_err!(self.bccx, span, E0504,
642-
"cannot move `{}` into closure because it is borrowed",
643-
&self.bccx.loan_path_to_string(move_path)),
647+
format!("cannot move `{}` into closure because it is borrowed",
648+
&self.bccx.loan_path_to_string(move_path)),
644649
move_data::Declared |
645650
move_data::MoveExpr |
646651
move_data::MovePat =>
647-
span_err!(self.bccx, span, E0505,
648-
"cannot move out of `{}` because it is borrowed",
649-
&self.bccx.loan_path_to_string(move_path))
652+
format!("cannot move out of `{}` because it is borrowed",
653+
&self.bccx.loan_path_to_string(move_path))
650654
};
651655

656+
self.bccx.span_err(span, &err_message[..]);
652657
self.bccx.span_note(
653658
loan_span,
654659
&format!("borrow of `{}` occurs here",
@@ -815,9 +820,10 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
815820
span: Span,
816821
loan_path: &LoanPath<'tcx>,
817822
loan: &Loan) {
818-
span_err!(self.bccx, span, E0506,
819-
"cannot assign to `{}` because it is borrowed",
820-
self.bccx.loan_path_to_string(loan_path));
823+
self.bccx.span_err(
824+
span,
825+
&format!("cannot assign to `{}` because it is borrowed",
826+
self.bccx.loan_path_to_string(loan_path)));
821827
self.bccx.span_note(
822828
loan.span,
823829
&format!("borrow of `{}` occurs here",

0 commit comments

Comments
 (0)