Skip to content

Commit 57fd676

Browse files
committed
---
yaml --- r: 234716 b: refs/heads/tmp c: 5a91ba8 h: refs/heads/master v: v3
1 parent ff2d65b commit 57fd676

Some content is hidden

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

57 files changed

+303
-493
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: f1473b6c00cc006771758434ea0e6f21ca0c12a2
28+
refs/heads/tmp: 5a91ba8e6028241558c5eb1a9405ede07bf306c6
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 imbedded in
3+
In the Rust project, we use a special set of comands embedded 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 emediatly after `HELP`.
32+
\* **Note**: `SUGGESTION` must follow immediately 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/reference.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,22 +1178,11 @@ let px: i32 = match p { Point(x, _) => x };
11781178
```
11791179

11801180
A _unit-like struct_ is a structure without any fields, defined by leaving off
1181-
the list of fields entirely. Such a structure implicitly defines a constant of
1182-
its type with the same name. For example:
1181+
the list of fields entirely. Such types will have a single value. For example:
11831182

11841183
```
1185-
# #![feature(braced_empty_structs)]
11861184
struct Cookie;
1187-
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1188-
```
1189-
1190-
is equivalent to
1191-
1192-
```
1193-
# #![feature(braced_empty_structs)]
1194-
struct Cookie {}
1195-
const Cookie: Cookie = Cookie {};
1196-
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1185+
let c = [Cookie, Cookie, Cookie, Cookie];
11971186
```
11981187

11991188
The precise memory layout of a structure is not specified. One can specify a
@@ -2422,7 +2411,6 @@ The currently implemented features of the reference compiler are:
24222411
terms of encapsulation).
24232412
* - `default_type_parameter_fallback` - Allows type parameter defaults to
24242413
influence type inference.
2425-
* - `braced_empty_structs` - Allows use of empty structs with braces.
24262414

24272415
If a feature is promoted to a language feature, then all existing programs will
24282416
start to receive compilation warnings about `#![feature]` directives which enabled

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ 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-
<div id="code-unwrap-double">
90+
<a name="code-unwrap-double"/>
9191
```rust,should_panic
9292
9393
use std::env;
@@ -99,7 +99,6 @@ fn main() {
9999
println!("{}", 2 * n);
100100
}
101101
```
102-
</div>
103102

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

143-
<div id="code-option-ex-string-find">
142+
<a name="code-option-ex-string-find"/>
144143
```rust
145144
// Searches `haystack` for the Unicode character `needle`. If one is found, the
146145
// byte offset of the character is returned. Otherwise, `None` is returned.
@@ -153,7 +152,6 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
153152
None
154153
}
155154
```
156-
</div>
157155

158156
Notice that when this function finds a matching character, it doen't just
159157
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or

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",

branches/tmp/src/librustc_borrowck/borrowck/gather_loans/move_error.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,18 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
119119
mc::cat_deref(_, _, mc::Implicit(..)) |
120120
mc::cat_deref(_, _, mc::UnsafePtr(..)) |
121121
mc::cat_static_item => {
122-
span_err!(bccx, move_from.span, E0507,
123-
"cannot move out of {}",
124-
move_from.descriptive_string(bccx.tcx));
122+
bccx.span_err(move_from.span,
123+
&format!("cannot move out of {}",
124+
move_from.descriptive_string(bccx.tcx)));
125125
}
126126

127127
mc::cat_interior(ref b, mc::InteriorElement(Kind::Index, _)) => {
128128
let expr = bccx.tcx.map.expect_expr(move_from.id);
129129
if let hir::ExprIndex(..) = expr.node {
130-
span_err!(bccx, move_from.span, E0508,
131-
"cannot move out of type `{}`, \
132-
a non-copy fixed-size array",
133-
b.ty);
130+
bccx.span_err(move_from.span,
131+
&format!("cannot move out of type `{}`, \
132+
a non-copy fixed-size array",
133+
b.ty));
134134
}
135135
}
136136

@@ -139,10 +139,11 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
139139
match b.ty.sty {
140140
ty::TyStruct(def, _) |
141141
ty::TyEnum(def, _) if def.has_dtor() => {
142-
span_err!(bccx, move_from.span, E0509,
143-
"cannot move out of type `{}`, \
144-
which defines the `Drop` trait",
145-
b.ty);
142+
bccx.span_err(
143+
move_from.span,
144+
&format!("cannot move out of type `{}`, \
145+
which defines the `Drop` trait",
146+
b.ty));
146147
},
147148
_ => {
148149
bccx.span_bug(move_from.span, "this path should not cause illegal move")

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,6 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
803803
self.tcx.sess.span_err(s, m);
804804
}
805805

806-
pub fn span_err_with_code(&self, s: Span, msg: &str, code: &str) {
807-
self.tcx.sess.span_err_with_code(s, msg, code);
808-
}
809-
810806
pub fn span_bug(&self, s: Span, m: &str) {
811807
self.tcx.sess.span_bug(s, m);
812808
}

branches/tmp/src/librustc_borrowck/diagnostics.rs

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -263,50 +263,12 @@ fn mutable() {
263263
You can read more about cell types in the API documentation:
264264
265265
https://doc.rust-lang.org/std/cell/
266-
"##,
267-
268-
E0499: r##"
269-
A variable was borrowed as mutable more than once. Erroneous code example:
270-
271-
```
272-
let mut i = 0;
273-
let mut x = &mut i;
274-
let mut a = &mut i;
275-
// error: cannot borrow `i` as mutable more than once at a time
276-
```
277-
278-
Please note that in rust, you can either have many immutable references, or one
279-
mutable reference. Take a look at
280-
https://doc.rust-lang.org/stable/book/references-and-borrowing.html for more
281-
information. Example:
282-
283-
284-
```
285-
let mut i = 0;
286-
let mut x = &mut i; // ok!
287-
288-
// or:
289-
let mut i = 0;
290-
let a = &i; // ok!
291-
let b = &i; // still ok!
292-
let c = &i; // still ok!
293-
```
294-
"##,
266+
"##
295267

296268
}
297269

298270
register_diagnostics! {
299271
E0385, // {} in an aliasable location
300272
E0388, // {} in a static location
301-
E0389, // {} in a `&` reference
302-
E0500, // closure requires unique access to `..` but .. is already borrowed
303-
E0501, // cannot borrow `..`.. as .. because previous closure requires unique access
304-
E0502, // cannot borrow `..`.. as .. because .. is also borrowed as ...
305-
E0503, // cannot use `..` because it was mutably borrowed
306-
E0504, // cannot move `..` into closure because it is borrowed
307-
E0505, // cannot move out of `..` because it is borrowed
308-
E0506, // cannot assign to `..` because it is borrowed
309-
E0507, // cannot move out of ..
310-
E0508, // cannot move out of type `..`, a non-copy fixed-size array
311-
E0509, // cannot move out of type `..`, which defines the `Drop` trait
273+
E0389 // {} in a `&` reference
312274
}

0 commit comments

Comments
 (0)