]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agodoc: fix links to servo
Richo Healey [Thu, 15 Jan 2015 00:13:33 +0000 (16:13 -0800)]
doc: fix links to servo

9 years agoauto merge of #21082 : brson/rust/finally, r=alexcrichton
bors [Wed, 14 Jan 2015 12:19:58 +0000 (12:19 +0000)]
auto merge of #21082 : brson/rust/finally, r=alexcrichton

No in-tree users. Ugly interface. Closes #14332.

I just happened to notice that this module still lives and has no users. Assuming we don't want it.

r? @aturon cc @alexcrichton

9 years agoauto merge of #21076 : sfackler/rust/bufferedreader-undef, r=Gankro
bors [Wed, 14 Jan 2015 09:52:08 +0000 (09:52 +0000)]
auto merge of #21076 : sfackler/rust/bufferedreader-undef, r=Gankro

It's passed to the underlying reader, so uninitialized memory == sad
times.

We might want to shrink the default buffer size as well. 64k is pretty
huge. Java uses 8k by default, and Go uses 4k for reference.

r? @alexcrichton

9 years agoauto merge of #21061 : japaric/rust/range, r=nick29581
bors [Wed, 14 Jan 2015 04:42:01 +0000 (04:42 +0000)]
auto merge of #21061 : japaric/rust/range, r=nick29581

9 years agoauto merge of #21018 : tomjakubowski/rust/rustdoc-where-xcrate, r=alexcrichton
bors [Wed, 14 Jan 2015 00:41:55 +0000 (00:41 +0000)]
auto merge of #21018 : tomjakubowski/rust/rustdoc-where-xcrate, r=alexcrichton

Various fixes for `rustdoc`, including showing where clauses
finally on re-exported items.

9 years agoAddress feedback
Brian Anderson [Tue, 13 Jan 2015 23:44:33 +0000 (15:44 -0800)]
Address feedback

9 years agoauto merge of #20957 : Ms2ger/rust/closures, r=alexcrichton
bors [Tue, 13 Jan 2015 21:29:00 +0000 (21:29 +0000)]
auto merge of #20957 : Ms2ger/rust/closures, r=alexcrichton

Returning the vectors directly makes the code a lot cleaner.

9 years agoauto merge of #20367 : retep998/rust/master, r=alexcrichton
bors [Tue, 13 Jan 2015 19:11:47 +0000 (19:11 +0000)]
auto merge of #20367 : retep998/rust/master, r=alexcrichton

Also adjusted some of the FFI definitions because apparently they don't use the long pointer prefix.
Gives a free performance boost because `SRWLock` is several times faster than `CriticalRegion` on every Windows system tested.
Fixes #19962

9 years agoauto merge of #20997 : nikomatsakis/rust/assoc-types-enum-field-access, r=nick29581
bors [Tue, 13 Jan 2015 14:21:39 +0000 (14:21 +0000)]
auto merge of #20997 : nikomatsakis/rust/assoc-types-enum-field-access, r=nick29581

Various fixes to enum field access. Builds on PR #20955.

r? @nick29581

9 years agoauto merge of #20963 : nick29581/rust/ast_map, r=eddyb
bors [Tue, 13 Jan 2015 11:56:31 +0000 (11:56 +0000)]
auto merge of #20963 : nick29581/rust/ast_map, r=eddyb

9 years agoRewrite each_attr to return a vector.
Ms2ger [Sun, 11 Jan 2015 19:03:20 +0000 (20:03 +0100)]
Rewrite each_attr to return a vector.

9 years agoReturn the Vec from csearch::get_item_attrs.
Ms2ger [Sun, 11 Jan 2015 17:16:02 +0000 (18:16 +0100)]
Return the Vec from csearch::get_item_attrs.

Using a closure unnecessarily obfuscates the code.

9 years agoReturn the Vec from decoder::get_item_attrs.
Ms2ger [Sun, 11 Jan 2015 16:33:02 +0000 (17:33 +0100)]
Return the Vec from decoder::get_item_attrs.

Using a closure unnecessarily obfuscates the code.

9 years agoauto merge of #20960 : erickt/rust/fix-associated-types-debuginfo, r=michaelwoerister
bors [Tue, 13 Jan 2015 09:06:35 +0000 (09:06 +0000)]
auto merge of #20960 : erickt/rust/fix-associated-types-debuginfo, r=michaelwoerister

Closes #20797

9 years agostd: Deprecate `finally` module
Brian Anderson [Tue, 13 Jan 2015 08:27:28 +0000 (00:27 -0800)]
std: Deprecate `finally` module

No in-tree users. Ugly interface. Closes #14332.

9 years agoauto merge of #20955 : nikomatsakis/rust/assoc-types-struct-field-access, r=nick29581
bors [Tue, 13 Jan 2015 05:01:34 +0000 (05:01 +0000)]
auto merge of #20955 : nikomatsakis/rust/assoc-types-struct-field-access, r=nick29581

Normalize the types of fields we project out of a struct or tuple struct.
Fixes #20954.

r? @nick29581

9 years agoInitialize memory for BufferedReader buffer
Steven Fackler [Tue, 13 Jan 2015 03:50:33 +0000 (19:50 -0800)]
Initialize memory for BufferedReader buffer

It's passed to the underlying reader, so uninitialized memory == sad
times.

We might want to shrink the default buffer size as well. 64k is pretty
huge. Java uses 8k by default, and Go uses 4k for reference.

9 years agoChange Mutex to use SRWLock on Windows.
Peter Atashian [Mon, 12 Jan 2015 22:50:39 +0000 (17:50 -0500)]
Change Mutex to use SRWLock on Windows.

Signed-off-by: Peter Atashian <retep998@gmail.com>
9 years agoauto merge of #20944 : brson/rust/weve-met-with-a-terrible-fate-havent-we, r=brson
bors [Tue, 13 Jan 2015 01:08:03 +0000 (01:08 +0000)]
auto merge of #20944 : brson/rust/weve-met-with-a-terrible-fate-havent-we, r=brson

Closes #13871

9 years agocleanup: `&foo[0..a]` -> `&foo[..a]`
Jorge Aparicio [Mon, 12 Jan 2015 21:59:18 +0000 (16:59 -0500)]
cleanup: `&foo[0..a]` -> `&foo[..a]`

9 years agoauto merge of #20896 : sfackler/rust/atomic-rename, r=alexcrichton
bors [Mon, 12 Jan 2015 22:56:20 +0000 (22:56 +0000)]
auto merge of #20896 : sfackler/rust/atomic-rename, r=alexcrichton

Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize

Closes #20893

[breaking-change]

9 years agoSome random things
Nick Cameron [Sun, 11 Jan 2015 05:45:59 +0000 (18:45 +1300)]
Some random things

9 years agoAdd view items to the ast map
Nick Cameron [Sun, 11 Jan 2015 09:45:34 +0000 (22:45 +1300)]
Add view items to the ast map

9 years agoauto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix
bors [Mon, 12 Jan 2015 19:20:56 +0000 (19:20 +0000)]
auto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix

rust-mode.el recently started highlighting keywords that were substrings of identifiers. Identifiers such as `xyz_type` would have `type` highlighted, which isn't normal. This patch re-introduces `_` as a word constituent, so that keywords following a `_` don't get syntax highlighted as keywords. Fixes issue #20422

9 years agorustdoc: Show type bindings on object types
Tom Jakubowski [Mon, 12 Jan 2015 17:43:24 +0000 (09:43 -0800)]
rustdoc: Show type bindings on object types

Fix #20299

9 years agorustdoc: Remove traces of old closures
Tom Jakubowski [Mon, 12 Jan 2015 17:08:50 +0000 (09:08 -0800)]
rustdoc: Remove traces of old closures

9 years agorustdoc: Fix where clauses on re-exports
Tom Jakubowski [Sun, 11 Jan 2015 07:50:46 +0000 (23:50 -0800)]
rustdoc: Fix where clauses on re-exports

Projection predicates on re-exports, for the time being, are rendered as
equality predicates because that's easier. It would be nice to fix this
in the future.

Some gymnastics were needed to remove redundant bounds from the `types`
and `lifetimes` fields, remove implicit `Sized` bounds, and re-create
`?Sized` bounds.

Fix #20203, fix #20924, fix #20911, fix #20534

9 years agoauto merge of #20789 : nikomatsakis/rust/issue-20765-normalize-where-clause, r=nrc
bors [Mon, 12 Jan 2015 15:10:38 +0000 (15:10 +0000)]
auto merge of #20789 : nikomatsakis/rust/issue-20765-normalize-where-clause, r=nrc

Normalize bounds that we extract from where clauses. Fixes #20765.

r? @nick29581
cc @jroesch

9 years agoNormalize bounds that we extract from where clauses. Fixes #20765.
Niko Matsakis [Fri, 9 Jan 2015 02:41:42 +0000 (21:41 -0500)]
Normalize bounds that we extract from where clauses. Fixes #20765.

9 years agoFix various oversights in enum field treatment in trans and typeck.
Niko Matsakis [Mon, 12 Jan 2015 09:59:59 +0000 (04:59 -0500)]
Fix various oversights in enum field treatment in trans and typeck.

Fixes #20996.

9 years agoauto merge of #20942 : nagisa/rust/shrl-impls, r=nikomatsakis
bors [Mon, 12 Jan 2015 11:05:30 +0000 (11:05 +0000)]
auto merge of #20942 : nagisa/rust/shrl-impls, r=nikomatsakis

This is only relevant to the code that uses generics such as

    fn magic<T: Shl>(a: T) { a << 10u8; }

r? @nikomatsakis

9 years agoauto merge of #19870 : mdinger/rust/align_error, r=nick29581
bors [Mon, 12 Jan 2015 08:55:22 +0000 (08:55 +0000)]
auto merge of #19870 : mdinger/rust/align_error, r=nick29581

#### Updated 1/12/2014

I updated the multi-line testcase to current but didn't modify the others. The spew code was broke by the `matches!` macro no longer working and I'm not interested in fixing the testcase.

I additionally added one testcase below.

Errors will in general look similar to below if the error is either `mismatched types` or a few other types. The rest are ignored.

---

#### Extra testcase:
```rust
pub trait Foo {
    type A;
    fn boo(&self) -> <Self as Foo>::A;
}

struct Bar;

impl Foo for i32 {
    type A = u32;
    fn boo(&self) -> u32 {
        42
    }
}

fn foo1<I: Foo<A=Bar>>(x: I) {
    let _: Bar = x.boo();
}

fn foo2<I: Foo>(x: I) {
    let _: Bar = x.boo();
}

pub fn baz(x: &Foo<A=Bar>) {
    let _: Bar = x.boo();
}

pub fn main() {
    let a = 42i32;
    foo1(a);
    baz(&a);
}
```

#### Multi-line output:
```cmd
$ ./rustc test3.rs
test3.rs:20:18: 20:25 error: mismatched types:
 expected `Bar`,
    found `<I as Foo>::A`
(expected struct `Bar`,
    found associated type)
test3.rs:20     let _: Bar = x.boo();
                             ^~~~~~~
test3.rs:31:5: 31:9 error: type mismatch resolving `<i32 as Foo>::A == Bar`:
 expected u32,
    found struct `Bar`
test3.rs:31     foo1(a);
                ^~~~
test3.rs:31:5: 31:9 note: required by `foo1`
test3.rs:31     foo1(a);
                ^~~~
test3.rs:32:9: 32:11 error: type mismatch resolving `<i32 as Foo>::A == Bar`:
 expected u32,
    found struct `Bar`
test3.rs:32     baz(&a);
                    ^~
test3.rs:32:9: 32:11 note: required for the cast to the object type `Foo`
test3.rs:32     baz(&a);
                    ^~
error: aborting due to 3 previous errors
```

---

This is a continuation of #19203 which I apparently broke by force pushing after it was closed. I'm attempting to add multi-line errors where they are largely beneficial - to help differentiate different types in compiler messages. As before, this is still a simple fix.

#### Testcase:
```rust
struct S;

fn test() -> Option<i32> {
    let s: S;

    s
}

fn test2() -> Option<i32> {
    Ok(7) // Should be Some(7)
}

impl Iterator for S {
    type Item = i32;
    fn next(&mut self) -> Result<i32, i32> { Ok(7) }
}

fn main(){
    test();
    test2();

}
```

---

#### Single-line playpen errors:
```cmd
<anon>:6:5: 6:6 error: mismatched types: expected `core::option::Option<int>`, found `S` (expected enum core::option::Option, found struct S)
<anon>:6     s
             ^
<anon>:10:5: 10:10 error: mismatched types: expected `core::option::Option<int>`, found `core::result::Result<_, _>` (expected enum core::option::Option, found enum core::result::Result)
<anon>:10     Ok(7) // Should be Some(7)
              ^~~~~
<anon>:14:5: 14:55 error: method `next` has an incompatible type for trait: expected enum core::option::Option, found enum core::result::Result [E0053]
<anon>:14     fn next(&mut self) -> Result<uint, uint> { Ok(7) }
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
playpen: application terminated with error code 101
```

---

#### Multi-line errors:
```cmd
$ ./rustc test.rs
test.rs:6:5: 6:6 error: mismatched types:
 expected `core::option::Option<i32>`,
    found `S`
(expected enum `core::option::Option`,
    found struct `S`)
test.rs:6     s
              ^
test.rs:10:5: 10:10 error: mismatched types:
 expected `core::option::Option<i32>`,
    found `core::result::Result<_, _>`
(expected enum `core::option::Option`,
    found enum `core::result::Result`)
test.rs:10     Ok(7) // Should be Some(7)
               ^~~~~
test.rs:15:5: 15:53 error: method `next` has an incompatible type for trait: expected enum `core::option::Option`, found enum `core::result::Result` [E0053]
test.rs:15     fn next(&mut self) -> Result<i32, i32> { Ok(7) }
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
```

---

#### Positive notes
* Vim worked fine with it: https://github.com/rust-lang/rust/pull/19203#issuecomment-66861668
* `make check` didn't find any errors
* Fixed *backtick* placement suggested by @p1start at https://github.com/rust-lang/rust/pull/19203#issuecomment-64062052

#### Negative notes
* Didn't check Emacs support but also wasn't provided a testcase...
* Needs to be tested with macro errors but I don't have a good testcase yet
* I would like to move the `E[0053]` earlier (see https://github.com/rust-lang/rust/issues/19464#issuecomment-65334301) but I don't know how
* It might be better to indent the types slightly like so (but I don't know how):
```cmd
test.rs:6:5: 6:6 error: mismatched types:
          expected `core::option::Option<int>`,
             found `S`
         (expected enum `core::option::Option`,
             found struct `S`)
test.rs:6     s
```
* Deep whitespace indentation may be a bad idea because early wrapping will cause misalignment between lines

#### Other
* I thought that compiler flags or something else (environment variables maybe) might be required because of comments against it but now that seems too much of a burden for users and for too little gain.
* There was concern that it will make large quantities of errors difficult to distinguish but I don't find that an issue. They both look awful and multi-line errors makes the types easier to understand.

---

#### Single lined spew:
```cmd
$ rustc test2.rs
test2.rs:161:9: 170:10 error: method `next` has an incompatible type for trait: expected enum core::option::Option, found enum core::result::Result [E0053]
test2.rs:161         fn next(&mut self) -> Result<&'a str, int> {
test2.rs:162             self.curr = self.next;
test2.rs:163
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
test2.rs:165                 self.next = if self.all.char_at(self.next) == '(' { close }
test2.rs:166                 else { open }
             ...
test2.rs:164:21: 164:31 error: mismatched types: expected `core::result::Result<uint, int>`, found `core::option::Option<_>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
                                 ^~~~~~~~~~
test2.rs:164:33: 164:44 error: mismatched types: expected `core::result::Result<uint, int>`, found `core::option::Option<_>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
                                             ^~~~~~~~~~~
test2.rs:169:40: 169:76 error: mismatched types: expected `core::result::Result<&'a str, int>`, found `core::option::Option<&str>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:169             if self.curr != self.len { Some(self.all[self.curr..self.next]) } else { None }
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:169:86: 169:90 error: mismatched types: expected `core::result::Result<&'a str, int>`, found `core::option::Option<_>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:169             if self.curr != self.len { Some(self.all[self.curr..self.next]) } else { None }
                                                                                                  ^~~~
test2.rs:205:14: 205:18 error: mismatched types: expected `core::result::Result<uint, int>`, found `core::option::Option<uint>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:205             (open, close)
                          ^~~~
test2.rs:205:20: 205:25 error: mismatched types: expected `core::result::Result<uint, int>`, found `core::option::Option<uint>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:205             (open, close)
                                ^~~~~
test2.rs:210:21: 210:31 error: mismatched types: expected `core::result::Result<uint, int>`, found `core::option::Option<_>` (expected enum core::result::Result, found enum core::option::Option)
test2.rs:210             if let (Some(open), _) = Parens::find_parens(self.all, 0) {
                                 ^~~~~~~~~~
test2.rs:210:13: 212:28 error: mismatched types: expected `core::option::Option<&'a int>`, found `core::option::Option<&str>` (expected int, found str)
test2.rs:210             if let (Some(open), _) = Parens::find_parens(self.all, 0) {
test2.rs:211                 Some(self.all[0..open])
test2.rs:212             } else { None }
test2.rs:299:48: 299:58 error: mismatched types: expected `Box<translate::Entity>`, found `collections::vec::Vec<_>` (expected box, found struct collections::vec::Vec)
test2.rs:299         pub fn new() -> Entity { Entity::Group(Vec::new()) }
                                                            ^~~~~~~~~~
test2.rs:359:51: 359:58 error: type `&mut Box<translate::Entity>` does not implement any method in scope named `push`
test2.rs:359                 Entity::Group(ref mut vec) => vec.push(e),
                                                               ^~~~~~~
test2.rs:366:51: 366:85 error: type `&mut Box<translate::Entity>` does not implement any method in scope named `push`
test2.rs:366                 Entity::Group(ref mut vec) => vec.push(Entity::Inner(s.to_string())),
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 12 previous errors
```

---

#### Multi-line spew:

```cmd
$ ./rustc test2.rs
test2.rs:161:9: 170:10 error: method `next` has an incompatible type for trait:
 expected enum `core::option::Option`,
    found enum `core::result::Result` [E0053]
test2.rs:161         fn next(&mut self) -> Result<&'a str, int> {
test2.rs:162             self.curr = self.next;
test2.rs:163
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
test2.rs:165                 self.next = if self.all.char_at(self.next) == '(' { close }
test2.rs:166                 else { open }
             ...
test2.rs:164:21: 164:31 error: mismatched types:
 expected `core::result::Result<uint, int>`,
    found `core::option::Option<_>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
                                 ^~~~~~~~~~
test2.rs:164:33: 164:44 error: mismatched types:
 expected `core::result::Result<uint, int>`,
    found `core::option::Option<_>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:164             if let (Some(open), Some(close)) = Parens::find_parens(self.all, self.next) {
                                             ^~~~~~~~~~~
test2.rs:169:40: 169:76 error: mismatched types:
 expected `core::result::Result<&'a str, int>`,
    found `core::option::Option<&str>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:169             if self.curr != self.len { Some(self.all[self.curr..self.next]) } else { None }
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:169:86: 169:90 error: mismatched types:
 expected `core::result::Result<&'a str, int>`,
    found `core::option::Option<_>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:169             if self.curr != self.len { Some(self.all[self.curr..self.next]) } else { None }
                                                                                                  ^~~~
test2.rs:205:14: 205:18 error: mismatched types:
 expected `core::result::Result<uint, int>`,
    found `core::option::Option<uint>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:205             (open, close)
                          ^~~~
test2.rs:205:20: 205:25 error: mismatched types:
 expected `core::result::Result<uint, int>`,
    found `core::option::Option<uint>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:205             (open, close)
                                ^~~~~
test2.rs:210:21: 210:31 error: mismatched types:
 expected `core::result::Result<uint, int>`,
    found `core::option::Option<_>`
(expected enum `core::result::Result`,
    found enum `core::option::Option`)
test2.rs:210             if let (Some(open), _) = Parens::find_parens(self.all, 0) {
                                 ^~~~~~~~~~
test2.rs:210:13: 212:28 error: mismatched types:
 expected `core::option::Option<&'a int>`,
    found `core::option::Option<&str>`
(expected int,
    found str)
test2.rs:210             if let (Some(open), _) = Parens::find_parens(self.all, 0) {
test2.rs:211                 Some(self.all[0..open])
test2.rs:212             } else { None }
test2.rs:229:57: 229:96 error: the trait `core::ops::Fn<(char,), bool>` is not implemented for the type `|char| -> bool`
test2.rs:229                                              .map(|s| s.trim_chars(|c: char| c.is_whitespace()))
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:238:46: 239:75 error: type `core::str::CharSplits<'_, |char| -> bool>` does not implement any method in scope named `filter_map`
test2.rs:238                                             .filter_map(|s| if !s.is_empty() { Some(s.trim_chars('\'')) }
test2.rs:239                                                             else { None })
test2.rs:237:46: 237:91 error: the trait `core::ops::Fn<(char,), bool>` is not implemented for the type `|char| -> bool`
test2.rs:237                 let vec: Vec<&str> = value[].split(|c: char| matches!(c, '(' | ')' | ','))
                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:238:65: 238:77 error: the type of this value must be known in this context
test2.rs:238                                             .filter_map(|s| if !s.is_empty() { Some(s.trim_chars('\'')) }
                                                                             ^~~~~~~~~~~~
test2.rs:299:48: 299:58 error: mismatched types:
 expected `Box<translate::Entity>`,
    found `collections::vec::Vec<_>`
(expected box,
    found struct `collections::vec::Vec`)
test2.rs:299         pub fn new() -> Entity { Entity::Group(Vec::new()) }
                                                            ^~~~~~~~~~
test2.rs:321:36: 322:65 error: type `core::str::CharSplits<'_, |char| -> bool>` does not implement any method in scope named `filter_map`
test2.rs:321                                   .filter_map(|s| if !s.is_empty() { Some(s.trim_chars('\'')) }
test2.rs:322                                                   else { None })
test2.rs:320:36: 320:81 error: the trait `core::ops::Fn<(char,), bool>` is not implemented for the type `|char| -> bool`
test2.rs:320             let vec: Vec<&str> = s.split(|c: char| matches!(c, '(' | ')' | ','))
                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:321:55: 321:67 error: the type of this value must be known in this context
test2.rs:321                                   .filter_map(|s| if !s.is_empty() { Some(s.trim_chars('\'')) }
                                                                   ^~~~~~~~~~~~
test2.rs:359:51: 359:58 error: type `&mut Box<translate::Entity>` does not implement any method in scope named `push`
test2.rs:359                 Entity::Group(ref mut vec) => vec.push(e),
                                                               ^~~~~~~
test2.rs:366:51: 366:85 error: type `&mut Box<translate::Entity>` does not implement any method in scope named `push`
test2.rs:366                 Entity::Group(ref mut vec) => vec.push(Entity::Inner(s.to_string())),
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 24 previous errors
```

Closes #18946 #19464
cc @P1start @jakub- @tomjakubowski @kballard @chris-morgan

9 years agoauto merge of #20917 : nick29581/rust/plugins, r=huonw
bors [Mon, 12 Jan 2015 06:50:21 +0000 (06:50 +0000)]
auto merge of #20917 : nick29581/rust/plugins, r=huonw

9 years agoFix testsuite errors
mdinger [Mon, 12 Jan 2015 06:01:44 +0000 (01:01 -0500)]
Fix testsuite errors

9 years agoImplement multi-line errors
mdinger [Mon, 12 Jan 2015 04:18:52 +0000 (23:18 -0500)]
Implement multi-line errors

9 years agoBacktick nits
mdinger [Wed, 7 Jan 2015 02:27:21 +0000 (21:27 -0500)]
Backtick nits

9 years agorustc_trans: Fix type projection debuginfo
Erick Tryzelaar [Mon, 12 Jan 2015 05:39:03 +0000 (21:39 -0800)]
rustc_trans: Fix type projection debuginfo

Closes #20797

9 years agoauto merge of #20889 : Manishearth/rust/trait-error, r=nikomatsakis
bors [Mon, 12 Jan 2015 04:45:18 +0000 (04:45 +0000)]
auto merge of #20889 : Manishearth/rust/trait-error, r=nikomatsakis

fixes #20783

r? @nikomatsakis

9 years agoauto merge of #20897 : barosl/rust/no-type-for-node-ice, r=nick29581
bors [Mon, 12 Jan 2015 02:40:20 +0000 (02:40 +0000)]
auto merge of #20897 : barosl/rust/no-type-for-node-ice, r=nick29581

If the type of a node cannot be determined due to a previous type error, a `no type for node` ICE occurs. This commit makes it return `ty_err` instead in such a case.

Fixes #20401.
Fixes #20506.
Fixes #20614.
Fixes #20752.
Fixes #20829.
Fixes #20846.
Fixes #20885.
Fixes #20886.
Fixes #20952.
Fixes #20970.

9 years agoMerge pull request #20968 from estsauver/20762
bors [Mon, 12 Jan 2015 00:21:32 +0000 (00:21 +0000)]
Merge pull request #20968 from estsauver/20762

Fix sentence fragment in librustc README

Reviewed-by: alexcrichton
9 years agoMerge pull request #20966 from Valloric/ownership-fix
bors [Mon, 12 Jan 2015 00:21:31 +0000 (00:21 +0000)]
Merge pull request #20966 from Valloric/ownership-fix

Fixing integer usage in ownership doc

Reviewed-by: steveklabnik
9 years agoMerge pull request #20956 from angst7/docfixes1
bors [Mon, 12 Jan 2015 00:21:31 +0000 (00:21 +0000)]
Merge pull request #20956 from angst7/docfixes1

replace deprecated uint references with u32 in trpl/looping.md

Reviewed-by: Gankro
9 years agoMerge pull request #20934 from tomjakubowski/patch-1
bors [Mon, 12 Jan 2015 00:21:30 +0000 (00:21 +0000)]
Merge pull request #20934 from tomjakubowski/patch-1

Escape a leading # in a doc comment

Reviewed-by: eddyb
9 years agoMerge pull request #20933 from gifnksm/patch-1
bors [Mon, 12 Jan 2015 00:21:30 +0000 (00:21 +0000)]
Merge pull request #20933 from gifnksm/patch-1

TRPL: `cargo build` doesn't run executables

Reviewed-by: alexcrichton
9 years agoMerge pull request #20930 from charmeleon/master
bors [Mon, 12 Jan 2015 00:21:29 +0000 (00:21 +0000)]
Merge pull request #20930 from charmeleon/master

Switching out range(0,10) example to 0..10. Tests fine

Reviewed-by: brson
9 years agoMerge pull request #20926 from xnil/patch-1
bors [Mon, 12 Jan 2015 00:21:29 +0000 (00:21 +0000)]
Merge pull request #20926 from xnil/patch-1

Hepburn romanization of さようなら

Reviewed-by: huonw
9 years agoMerge pull request #20920 from piyo/issue-20853
bors [Mon, 12 Jan 2015 00:21:28 +0000 (00:21 +0000)]
Merge pull request #20920 from piyo/issue-20853

Give mmap a page-aligned stack start address

Reviewed-by: Aatch
9 years agoMerge pull request #20915 from csouth3/hash-iters
bors [Mon, 12 Jan 2015 00:21:28 +0000 (00:21 +0000)]
Merge pull request #20915 from csouth3/hash-iters

Add ExactSizeIterator impls for Hash{Map, Set, Table}

Reviewed-by: Gankro
9 years agoMerge pull request #20905 from akiss77/pr-morestack-plt
bors [Mon, 12 Jan 2015 00:21:27 +0000 (00:21 +0000)]
Merge pull request #20905 from akiss77/pr-morestack-plt

Fix: GNU AArch64 assembler does not like @plt symbol suffix

Reviewed-by: alexcrichton
9 years agoMerge pull request #20903 from XMPPwocky/deadlink1
bors [Mon, 12 Jan 2015 00:21:27 +0000 (00:21 +0000)]
Merge pull request #20903 from XMPPwocky/deadlink1

Fix dead link in documentation (s/task/thread/)

Reviewed-by: Aatch
9 years agoMerge pull request #20902 from stevencrockett/master
bors [Mon, 12 Jan 2015 00:21:26 +0000 (00:21 +0000)]
Merge pull request #20902 from stevencrockett/master

reference: Small grammar fixes for correctness/consistency and updates for language changes.

Reviewed-by: steveklabnik
9 years agoMerge pull request #20899 from TeXitoi/fix-shootout-threadring
bors [Mon, 12 Jan 2015 00:21:25 +0000 (00:21 +0000)]
Merge pull request #20899 from TeXitoi/fix-shootout-threadring

fix shootout-threadring.rs

Reviewed-by: alexcrichton
9 years agoMerge pull request #20898 from sebras/trpl
bors [Mon, 12 Jan 2015 00:21:25 +0000 (00:21 +0000)]
Merge pull request #20898 from sebras/trpl

Cosmetic updates to TRPL text

Reviewed-by: steveklabnik
9 years agoMerge pull request #20895 from adregan/master
bors [Mon, 12 Jan 2015 00:21:25 +0000 (00:21 +0000)]
Merge pull request #20895 from adregan/master

Updates fixed-size suffix in 30 minute introduction

Reviewed-by: steveklabnik
9 years agoMerge pull request #20883 from apreiml/master
bors [Mon, 12 Jan 2015 00:21:24 +0000 (00:21 +0000)]
Merge pull request #20883 from apreiml/master

Update 7.2.9 Array expressions

Reviewed-by: steveklabnik
9 years agoMerge pull request #20881 from brookst/master
bors [Mon, 12 Jan 2015 00:21:24 +0000 (00:21 +0000)]
Merge pull request #20881 from brookst/master

Add new number literal suffixes to Vim syntax highlighting

Reviewed-by: alexcrichton
9 years agoMerge pull request #20877 from killercup/patch-4
bors [Mon, 12 Jan 2015 00:21:23 +0000 (00:21 +0000)]
Merge pull request #20877 from killercup/patch-4

Error Guide: Add Line Break to Robert Burns Quote

Reviewed-by: steveklabnik
9 years agoMerge pull request #20820 from sellibitze/closure-doc
bors [Mon, 12 Jan 2015 00:21:23 +0000 (00:21 +0000)]
Merge pull request #20820 from sellibitze/closure-doc

Closure documentation: Fix boxed closure left-over

Reviewed-by: steveklabnik
9 years agoMerge pull request #20415 from eddyb/unify-expected-return
bors [Mon, 12 Jan 2015 00:21:22 +0000 (00:21 +0000)]
Merge pull request #20415 from eddyb/unify-expected-return

rustc_typeck: unify expected return types with formal return types to propagate coercions through calls of generic functions.

Reviewed-by: nikomatsakis
9 years agoMake the compilation process more easily customisable
Nick Cameron [Sun, 11 Jan 2015 02:03:34 +0000 (15:03 +1300)]
Make the compilation process more easily customisable

9 years agoauto merge of #20935 : dotdash/rust/cpu_x86-64, r=luqmana
bors [Sun, 11 Jan 2015 22:15:52 +0000 (22:15 +0000)]
auto merge of #20935 : dotdash/rust/cpu_x86-64, r=luqmana

Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.

Refs #20777

9 years agoFix sentence fragment in librustc README
Earl St Sauver [Sun, 11 Jan 2015 21:53:53 +0000 (13:53 -0800)]
Fix sentence fragment in librustc README

9 years agoFixing integer usage in ownership doc
Strahinja Val Markovic [Sun, 11 Jan 2015 20:42:03 +0000 (12:42 -0800)]
Fixing integer usage in ownership doc

`int` doesn't exist anymore. Usage of its equivalent `isize` is
discouraged since its size is platform-dependent. `i32` is used instead
in the examples. Also, integer suffixes aren't needed in the examples
anymore so we can just write `5` instead of `5i`.

9 years agodocs
Manish Goregaokar [Sun, 11 Jan 2015 20:05:16 +0000 (01:35 +0530)]
docs

9 years agotests: update some compile-fail tests for the new behavior of type expectations.
Eduard Burtescu [Thu, 8 Jan 2015 16:39:17 +0000 (18:39 +0200)]
tests: update some compile-fail tests for the new behavior of type expectations.

9 years agorustc_typeck: unify expected return types with formal return types to propagate coerc...
Eduard Burtescu [Thu, 8 Jan 2015 16:25:52 +0000 (18:25 +0200)]
rustc_typeck: unify expected return types with formal return types to propagate coercions through calls of generic functions.

9 years agorustc_typeck: don't use double indirection to Expr's in check_argument_types.
Eduard Burtescu [Thu, 8 Jan 2015 16:26:36 +0000 (18:26 +0200)]
rustc_typeck: don't use double indirection to Expr's in check_argument_types.

9 years agorustc_typeck: make Expectation more composable by replacing map and map_to_option...
Eduard Burtescu [Fri, 2 Jan 2015 01:38:02 +0000 (03:38 +0200)]
rustc_typeck: make Expectation more composable by replacing map and map_to_option with to_option.

9 years agoGive where clauses priority over builtin rules. Fixes #20959.
Niko Matsakis [Sun, 11 Jan 2015 19:52:37 +0000 (14:52 -0500)]
Give where clauses priority over builtin rules. Fixes #20959.

9 years agoRename AtomicInt and AtomicUint
Steven Fackler [Sat, 10 Jan 2015 21:42:48 +0000 (13:42 -0800)]
Rename AtomicInt and AtomicUint

Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize

Closes #20893

[breaking-change]

9 years agoreplace deprecated uint references with u32
Matt Roche [Sun, 11 Jan 2015 18:55:23 +0000 (13:55 -0500)]
replace deprecated uint references with u32

Replaced uint references with u32 to prevent compiler warnings.

9 years agoNormalize the types of fields we project out of a struct or tuple struct.
Niko Matsakis [Sun, 11 Jan 2015 18:52:40 +0000 (13:52 -0500)]
Normalize the types of fields we project out of a struct or tuple struct.
Fixes #20954.

9 years agoauto merge of #20406 : TimDumol/rust/dlist-append-split-off, r=Gankro
bors [Sun, 11 Jan 2015 18:50:46 +0000 (18:50 +0000)]
auto merge of #20406 : TimDumol/rust/dlist-append-split-off, r=Gankro

Implements the `append()` and `split_off()` methods proposed by the collections reform part 2 RFC.

RFC: https://github.com/rust-lang/rfcs/pull/509
Tracking issue: https://github.com/rust-lang/rust/issues/19986

9 years agoFeature gate #[rustc_on_unimplemented]
Manish Goregaokar [Sun, 11 Jan 2015 15:23:24 +0000 (20:53 +0530)]
Feature gate #[rustc_on_unimplemented]

9 years agoauto merge of #20910 : sfackler/rust/show-impls, r=alexcrichton
bors [Sun, 11 Jan 2015 16:45:48 +0000 (16:45 +0000)]
auto merge of #20910 : sfackler/rust/show-impls, r=alexcrichton

A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.

I also altered `MultiWriter` to make it generic over Writers instead of
taking `Box<Writer>` trait objects. `Box<Writer>` implements `Writer` so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.

The change to `MultiWriter` may break code that uses it, but any fixes
should be easy.

[breaking-change]

r? @alexcrichton

9 years agoMerge remote-tracking branch 'rust/master'
Erick Rivas [Sun, 11 Jan 2015 16:43:49 +0000 (10:43 -0600)]
Merge remote-tracking branch 'rust/master'

9 years agoMerge branch 'master' of git://github.com/rust-lang/rust into rust
Erick Rivas [Sun, 11 Jan 2015 16:40:16 +0000 (10:40 -0600)]
Merge branch 'master' of git://github.com/rust-lang/rust into rust

9 years agoRename #[on_unimplemented] -> #[rustc_on_unimplemented]
Manish Goregaokar [Sun, 11 Jan 2015 12:58:06 +0000 (18:28 +0530)]
Rename #[on_unimplemented] -> #[rustc_on_unimplemented]

9 years agoRemove range function
Tim Brooks [Sun, 11 Jan 2015 14:37:24 +0000 (14:37 +0000)]
Remove range function

9 years agoRemove old number literal suffixes from Vim syntax
Tim Brooks [Sat, 10 Jan 2015 15:50:52 +0000 (15:50 +0000)]
Remove old number literal suffixes from Vim syntax

9 years agoauto merge of #20865 : killercup/rust/patch-3, r=alexcrichton
bors [Sun, 11 Jan 2015 14:35:46 +0000 (14:35 +0000)]
auto merge of #20865 : killercup/rust/patch-3, r=alexcrichton

This adds an early return to skip code blocks without IDs.

Fixes #20864.

9 years agostd: Remove fortune cookies from fatal runtime errors
Brian Anderson [Sun, 11 Jan 2015 13:50:10 +0000 (05:50 -0800)]
std: Remove fortune cookies from fatal runtime errors

Closes #13871

9 years agoAllow any integral to be used as Shr and Shl RHS
Simonas Kazlauskas [Sat, 10 Jan 2015 22:38:39 +0000 (00:38 +0200)]
Allow any integral to be used as Shr and Shl RHS

This is only relevant to the code that uses generics such as

    fn magic<T: Shl>(a: T) { a << 10u8; }

Fixes #20288

9 years agoMove error to typeck::check
Manish Goregaokar [Sun, 11 Jan 2015 12:47:46 +0000 (18:17 +0530)]
Move error to typeck::check

9 years agoauto merge of #20859 : mahkoh/rust/as_mut_vec, r=nikomatsakis
bors [Sun, 11 Jan 2015 12:15:46 +0000 (12:15 +0000)]
auto merge of #20859 : mahkoh/rust/as_mut_vec, r=nikomatsakis

Closes #20822

9 years agoDefault to "x86-64" as the target cpu for x86_64 builds
Björn Steinbrink [Sun, 11 Jan 2015 11:11:44 +0000 (12:11 +0100)]
Default to "x86-64" as the target cpu for x86_64 builds

Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.

Refs #20777

9 years agoMake errors allow for cross-crate issues
Manish Goregaokar [Sun, 11 Jan 2015 11:11:02 +0000 (16:41 +0530)]
Make errors allow for cross-crate issues

9 years agoPermit node types to be missing if type errors occurred previously
Barosl Lee [Sat, 10 Jan 2015 20:07:43 +0000 (05:07 +0900)]
Permit node types to be missing if type errors occurred previously

If the type of a node cannot be determined due to a previous type error,
a "no type for node" ICE occurs. This commit makes it return ty_err
instead in such a case.

Fixes #20401.
Fixes #20506.
Fixes #20614.
Fixes #20752.
Fixes #20829.
Fixes #20846.
Fixes #20885.
Fixes #20886.

9 years agoEscape a leading # in a doc comment
Tom Jakubowski [Sun, 11 Jan 2015 10:34:55 +0000 (02:34 -0800)]
Escape a leading # in a doc comment

rustdoc was rendering this as a header

9 years agoauto merge of #20925 : alexcrichton/rust/more-flaky-test, r=sfackler
bors [Sun, 11 Jan 2015 09:01:00 +0000 (09:01 +0000)]
auto merge of #20925 : alexcrichton/rust/more-flaky-test, r=sfackler

I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!

9 years ago`cargo build` doesn't run the executables
NAKASHIMA, Makoto [Sun, 11 Jan 2015 08:40:42 +0000 (17:40 +0900)]
`cargo build` doesn't run the executables

9 years agoSwitching out range(0,10) example to 0..10. Tests fine
Erick Rivas [Sun, 11 Jan 2015 08:15:29 +0000 (02:15 -0600)]
Switching out range(0,10) example to 0..10. Tests fine

9 years agotest: Use Thread::scoped in two more tests
Alex Crichton [Sun, 11 Jan 2015 06:56:01 +0000 (22:56 -0800)]
test: Use Thread::scoped in two more tests

I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!

9 years agoauto merge of #20755 : dotdash/rust/fca, r=Aatch
bors [Sun, 11 Jan 2015 06:55:33 +0000 (06:55 +0000)]
auto merge of #20755 : dotdash/rust/fca, r=Aatch

Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.

One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.

The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.

Fixes #20450 #20149 #16506 #13927

9 years agoCorrect romanization of さようなら
Carter Hinsley [Sun, 11 Jan 2015 06:53:34 +0000 (01:53 -0500)]
Correct romanization of さようなら

9 years agoAdd lint and test for malformed but unused #[on_unimplemented] attributes
Manish Goregaokar [Sun, 11 Jan 2015 04:19:39 +0000 (09:49 +0530)]
Add lint and test for malformed but unused #[on_unimplemented] attributes

9 years agoAdd ability to attach custom #[on_unimplemented] error messages for unimplemented...
Manish Goregaokar [Sat, 10 Jan 2015 18:21:27 +0000 (23:51 +0530)]
Add ability to attach custom #[on_unimplemented] error messages for unimplemented traits (fixes #20783)

9 years agoGive mmap a page-aligned stack start address
Clifford Caoile [Sun, 11 Jan 2015 03:52:50 +0000 (12:52 +0900)]
Give mmap a page-aligned stack start address

9 years agoAdd ExactSizeIterator impls for Hash{Map, Set, Table}
Chase Southwood [Sun, 11 Jan 2015 02:07:42 +0000 (20:07 -0600)]
Add ExactSizeIterator impls for Hash{Map, Set, Table}

This commit also changes the return types of all `size_hint()` impls
in these files from (uint, Option<uint>) to (usize, Option<usize>).

9 years agoImplement Show for types in std::io::{buffered,util}
Steven Fackler [Sun, 11 Jan 2015 01:32:54 +0000 (17:32 -0800)]
Implement Show for types in std::io::{buffered,util}

A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.

I also altered MultiWriter to make it generic over Writers instead of
taking Box<Writer> trait objects. Box<Writer> implements Writer so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.

The change to MultiWriter may break code that uses it, but any fixes
should be easy.

[breaking-change]