Skip to content

Commit 68e3d88

Browse files
committed
---
yaml --- r: 39606 b: refs/heads/incoming c: c880d0a h: refs/heads/master v: v3
1 parent b175579 commit 68e3d88

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 08735536809d9bcafacf689cdb5e5314f1510b87
9+
refs/heads/incoming: c880d0ab7688af2cf5ed547019c22e10d81f7cb4
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Pull request procedure
2+
3+
Pull requests should be targeted at Rust's `incoming` branch (note that by default Github will aim them at the `master` branch) -- see "Changing The Commit Range and Destination Repository" in Github's documentation on [pull requests](https://help.github.com/articles/using-pull-requests). Before pushing to your Github repo and issuing the pull request, please do two things:
4+
5+
1. [Rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your local changes against the `incoming` branch. Resolve any conflicts that arise.
6+
2. Run the full Rust test suite with the `make check` command. You're not off the hook even if you just stick to documentation; code examples in the docs are tested as well!
7+
8+
Pull requests will be treated as "review requests", and we will give feedback we expect to see corrected on [style](https://github.com/mozilla/rust/wiki/Note-style-guide) and substance before pulling. Changes contributed via pull request should focus on a single issue at a time, like any other. We will not look kindly on pull-requests that try to "sneak" unrelated changes in.
9+
10+
Normally, all pull requests must include regression tests (see [[Note-testsuite]]) that test your change. Occasionally, a change will be very difficult to test for. In those cases, please include a note in your commit message explaining why.
11+
12+
For more details, please refer to [[Note-development-policy]].
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-test
12+
enum Nil {Nil}
13+
struct Cons<T> {head:int, tail:T}
14+
trait Dot {fn dot(other:self) -> int;}
15+
impl Nil:Dot {
16+
fn dot(_:Nil) -> int {0}
17+
}
18+
impl<T:Dot> Cons<T>:Dot {
19+
fn dot(other:Cons<T>) -> int {
20+
self.head * other.head + self.tail.dot(other.tail)
21+
}
22+
}
23+
fn test<T:Dot> (n:int, i:int, first:T, second:T) ->int {
24+
match n {
25+
0 => {first.dot(second)}
26+
// Error message should be here. It should be a type error
27+
// to instantiate `test` at a type other than T. (See #4287)
28+
_ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})}
29+
}
30+
}
31+
fn main() {
32+
let n = test(1, 0, Nil, Nil);
33+
io::println(fmt!("%d", n));
34+
}

0 commit comments

Comments
 (0)