Skip to content

Commit ebba880

Browse files
committed
---
yaml --- r: 212831 b: refs/heads/master c: 85b5338 h: refs/heads/master i: 212829: 32cea07 212827: 8f3525f 212823: 0e4f0ff 212815: f947e07 212799: 8ec98cf v: v3
1 parent 6a4fb2f commit ebba880

File tree

9 files changed

+42
-38
lines changed

9 files changed

+42
-38
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3c69db4c3c8039ccd313188fa2d0f0d83bba6914
2+
refs/heads/master: 85b5338e3444de1c46ac8cf9bf20ae4b31b9f905
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ before_script:
1616
script:
1717
- make tidy
1818

19+
# Real testing happens on http://buildbot.rust-lang.org/
20+
#
21+
# See https://github.com/rust-lang/rust-buildbot
22+
# CONTRIBUTING.md#pull-requests
23+
1924
notifications:
2025
email: false
2126

trunk/src/doc/complement-lang-faq.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Yes. For example (incomplete):
3737
* [wit.ai](https://github.com/wit-ai/witd)
3838
* [Codius](https://codius.org/blog/codius-rust/)
3939
* [MaidSafe](http://maidsafe.net/)
40+
* [Terminal.com](https://terminal.com)
4041

4142
## Does it run on Windows?
4243

trunk/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ extern fn new_i32() -> i32 { 0 }
11111111
extern "stdcall" fn new_i32_stdcall() -> i32 { 0 }
11121112
```
11131113

1114-
Unlike normal functions, extern fns have an `extern "ABI" fn()`. This is the
1114+
Unlike normal functions, extern fns have type `extern "ABI" fn()`. This is the
11151115
same type as the functions declared in an extern block.
11161116

11171117
```

trunk/src/doc/trpl/hello-cargo.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ To start a new project with Cargo, use `cargo new`:
145145
$ cargo new hello_world --bin
146146
```
147147

148-
We’re passing `--bin` because we're making a binary program: if we were making
149-
a library, we'd leave it off.
148+
We’re passing `--bin` because our goal is to get straight to making an executable application, as opposed to a library. Executables are often called ‘binaries.’ (as in `/usr/bin`, if you’re on a Unix system)
150149

151150
Let's check out what Cargo has generated for us:
152151

trunk/src/doc/trpl/installing-rust.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ $ sh rustup.sh
2424

2525
[insecurity]: http://curlpipesh.tumblr.com
2626

27-
If you're on Windows, please download either the [32-bit installer][win32] or
28-
the [64-bit installer][win64] and run it.
27+
If you're on Windows, please download the appropriate [installer][install-page].
2928

30-
[win32]: https://static.rust-lang.org/dist/rust-1.0.0-i686-pc-windows-gnu.msi
31-
[win64]: https://static.rust-lang.org/dist/rust-1.0.0-x86_64-pc-windows-gnu.msi
29+
[install-page]: http://www.rust-lang.org/install.html
3230

3331
## Uninstalling
3432

@@ -51,7 +49,6 @@ documentation on [building Rust from Source][from-source], or [the official
5149
binary downloads][install-page].
5250

5351
[from-source]: https://github.com/rust-lang/rust#building-from-source
54-
[install-page]: http://www.rust-lang.org/install.html
5552

5653
Oh, we should also mention the officially supported platforms:
5754

@@ -75,10 +72,11 @@ If you've got Rust installed, you can open up a shell, and type this:
7572
$ rustc --version
7673
```
7774

78-
You should see the version number, commit hash, commit date and build date:
75+
You should see the version number, commit hash, and commit date. If you just
76+
installed version 1.0.0, you should see:
7977

8078
```bash
81-
rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
79+
rustc 1.0.0 (a59de37e9 2015-05-13)
8280
```
8381

8482
If you did, Rust has been installed successfully! Congrats!

trunk/src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,10 +1626,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16261626
let t = ast_ty_to_ty(self, self, ast_t);
16271627

16281628
let mut bounds_checker = wf::BoundsChecker::new(self,
1629-
ast_t.span,
16301629
self.body_id,
16311630
None);
1632-
bounds_checker.check_ty(t);
1631+
bounds_checker.check_ty(t, ast_t.span);
16331632

16341633
t
16351634
}

trunk/src/librustc_typeck/check/wf.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use util::ppaux::{Repr, UserString};
2323
use std::collections::HashSet;
2424
use syntax::ast;
2525
use syntax::ast_util::local_def;
26-
use syntax::codemap::Span;
26+
use syntax::codemap::{DUMMY_SP, Span};
2727
use syntax::parse::token::{self, special_idents};
2828
use syntax::visit;
2929
use syntax::visit::Visitor;
@@ -162,15 +162,14 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
162162
self.with_fcx(item, |this, fcx| {
163163
let variants = lookup_fields(fcx);
164164
let mut bounds_checker = BoundsChecker::new(fcx,
165-
item.span,
166165
item.id,
167166
Some(&mut this.cache));
168167
debug!("check_type_defn at bounds_checker.scope: {:?}", bounds_checker.scope);
169168

170-
for variant in &variants {
169+
for variant in &variants {
171170
for field in &variant.fields {
172171
// Regions are checked below.
173-
bounds_checker.check_traits_in_ty(field.ty);
172+
bounds_checker.check_traits_in_ty(field.ty, field.span);
174173
}
175174

176175
// For DST, all intermediate types must be sized.
@@ -199,7 +198,6 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
199198
{
200199
self.with_fcx(item, |this, fcx| {
201200
let mut bounds_checker = BoundsChecker::new(fcx,
202-
item.span,
203201
item.id,
204202
Some(&mut this.cache));
205203
debug!("check_item_type at bounds_checker.scope: {:?}", bounds_checker.scope);
@@ -209,7 +207,7 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
209207
&fcx.inh.param_env.free_substs,
210208
&type_scheme.ty);
211209

212-
bounds_checker.check_traits_in_ty(item_ty);
210+
bounds_checker.check_traits_in_ty(item_ty, item.span);
213211
});
214212
}
215213

@@ -218,7 +216,6 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
218216
{
219217
self.with_fcx(item, |this, fcx| {
220218
let mut bounds_checker = BoundsChecker::new(fcx,
221-
item.span,
222219
item.id,
223220
Some(&mut this.cache));
224221
debug!("check_impl at bounds_checker.scope: {:?}", bounds_checker.scope);
@@ -231,7 +228,7 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
231228
&fcx.inh.param_env.free_substs,
232229
&self_ty);
233230

234-
bounds_checker.check_traits_in_ty(self_ty);
231+
bounds_checker.check_traits_in_ty(self_ty, item.span);
235232

236233
// Similarly, obtain an "inside" reference to the trait
237234
// that the impl implements.
@@ -252,7 +249,7 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> {
252249
// trait reference. Instead, this is done at the impl site.
253250
// Arguably this is wrong and we should treat the trait-reference
254251
// the same way as we treat the self-type.
255-
bounds_checker.check_trait_ref(&trait_ref);
252+
bounds_checker.check_trait_ref(&trait_ref, item.span);
256253

257254
let cause =
258255
traits::ObligationCause::new(
@@ -483,11 +480,10 @@ pub struct BoundsChecker<'cx,'tcx:'cx> {
483480

484481
impl<'cx,'tcx> BoundsChecker<'cx,'tcx> {
485482
pub fn new(fcx: &'cx FnCtxt<'cx,'tcx>,
486-
span: Span,
487483
scope: ast::NodeId,
488484
cache: Option<&'cx mut HashSet<Ty<'tcx>>>)
489485
-> BoundsChecker<'cx,'tcx> {
490-
BoundsChecker { fcx: fcx, span: span, scope: scope,
486+
BoundsChecker { fcx: fcx, span: DUMMY_SP, scope: scope,
491487
cache: cache, binding_count: 0 }
492488
}
493489

@@ -500,30 +496,32 @@ impl<'cx,'tcx> BoundsChecker<'cx,'tcx> {
500496
///
501497
/// Note that it does not (currently, at least) check that `A : Copy` (that check is delegated
502498
/// to the point where impl `A : Trait<B>` is implemented).
503-
pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>) {
499+
pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>, span: Span) {
504500
let trait_predicates = ty::lookup_predicates(self.fcx.tcx(), trait_ref.def_id);
505501

506-
let bounds = self.fcx.instantiate_bounds(self.span,
502+
let bounds = self.fcx.instantiate_bounds(span,
507503
trait_ref.substs,
508504
&trait_predicates);
509505

510506
self.fcx.add_obligations_for_parameters(
511507
traits::ObligationCause::new(
512-
self.span,
508+
span,
513509
self.fcx.body_id,
514510
traits::ItemObligation(trait_ref.def_id)),
515511
&bounds);
516512

517513
for &ty in &trait_ref.substs.types {
518-
self.check_traits_in_ty(ty);
514+
self.check_traits_in_ty(ty, span);
519515
}
520516
}
521517

522-
pub fn check_ty(&mut self, ty: Ty<'tcx>) {
518+
pub fn check_ty(&mut self, ty: Ty<'tcx>, span: Span) {
519+
self.span = span;
523520
ty.fold_with(self);
524521
}
525522

526-
fn check_traits_in_ty(&mut self, ty: Ty<'tcx>) {
523+
fn check_traits_in_ty(&mut self, ty: Ty<'tcx>, span: Span) {
524+
self.span = span;
527525
// When checking types outside of a type def'n, we ignore
528526
// region obligations. See discussion below in fold_ty().
529527
self.binding_count += 1;

trunk/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@ impl<T> Foo<T> {
3232
}
3333

3434
struct Baz {
35-
//~^ ERROR not implemented
36-
a: Foo<isize>,
35+
a: Foo<isize>, //~ ERROR not implemented
3736
}
3837

3938
enum Boo {
40-
//~^ ERROR not implemented
41-
Quux(Bar<usize>),
39+
Quux(Bar<usize>), //~ ERROR not implemented
4240
}
4341

4442
struct Badness<U> {
45-
//~^ ERROR not implemented
46-
b: Foo<U>,
43+
b: Foo<U>, //~ ERROR not implemented
4744
}
4845

4946
enum MoreBadness<V> {
50-
//~^ ERROR not implemented
51-
EvenMoreBadness(Bar<V>),
47+
EvenMoreBadness(Bar<V>), //~ ERROR not implemented
48+
}
49+
50+
struct TupleLike(
51+
Foo<i32>, //~ ERROR not implemented
52+
);
53+
54+
enum Enum {
55+
DictionaryLike { field: Bar<i32> }, //~ ERROR not implemented
5256
}
5357

5458
trait PolyTrait<T>

0 commit comments

Comments
 (0)