]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agosyntax: Don't import the pp.rs enum variants into the namespace
Erick Tryzelaar [Wed, 14 Jan 2015 05:12:39 +0000 (21:12 -0800)]
syntax: Don't import the pp.rs enum variants into the namespace

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 agoBump to ensure llvm is rebuilt
Richo Healey [Wed, 14 Jan 2015 03:03:31 +0000 (19:03 -0800)]
Bump to ensure llvm is rebuilt

9 years agoClean up conditions for clobbers
Richo Healey [Wed, 14 Jan 2015 03:01:37 +0000 (19:01 -0800)]
Clean up conditions for clobbers

9 years agoGeneralise pointer width tests using pointer_width
Richo Healey [Wed, 14 Jan 2015 02:59:45 +0000 (18:59 -0800)]
Generalise pointer width tests using pointer_width

9 years agoRe-direct to the right place.
Steve Klabnik [Wed, 14 Jan 2015 01:52:27 +0000 (20:52 -0500)]
Re-direct to the right place.

Why redirect Tutorial -> Guide -> Book when you can just Tutorial -> Book?

Suggested here: http://www.reddit.com/r/rust/comments/2schav/is_it_possible_to_automatically_redirect/

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 agoUpdate grammar/verify.rs to work with recent master
Florian Hahn [Tue, 13 Jan 2015 23:20:53 +0000 (00:20 +0100)]
Update grammar/verify.rs to work with recent master

9 years agoPrefer GEP instructions over weird pointer casting
Björn Steinbrink [Tue, 13 Jan 2015 21:30:49 +0000 (22:30 +0100)]
Prefer GEP instructions over weird pointer casting

There are two places left where we used to only know the byte
size of/offset into an array and had to cast to i8 and back to get the
right addresses. But by now, we always know the sizes in terms of the
number of elements in the array. In fact we have to add an extra Mul
instruction so we can use the weird cast-to-u8 code. So we should really
just embrace our new knowledge and use simple GEPs to do the address
calculations.

Additionally, the pointer calculations in bind_subslice_pat don't handle
zero-sized types correctly, producing slices that point outside the
array that is being matched against. Using GEP fixes that as well.

Fixes #3729

9 years agoHandle question marks in model lexer, closes #15879
Florian Hahn [Tue, 13 Jan 2015 22:31:53 +0000 (23:31 +0100)]
Handle question marks in model lexer, closes #15879

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 agoUpdating email address for Rohit Joshi
Rohit Joshi [Tue, 13 Jan 2015 21:28:44 +0000 (16:28 -0500)]
Updating email address for Rohit Joshi

When I submitted a PR #20326, mistakenly was committed using my work email. Correct the email address.

9 years agoProvide example of generic inverse()
Steve Klabnik [Tue, 13 Jan 2015 20:42:38 +0000 (15:42 -0500)]
Provide example of generic inverse()

Fixes #17224

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 agoRemove unneeded box import in examples
Chase Southwood [Tue, 13 Jan 2015 18:56:10 +0000 (12:56 -0600)]
Remove unneeded box import in examples

9 years agoUse if-let in std::result documentation
Simonas Kazlauskas [Tue, 13 Jan 2015 18:25:13 +0000 (20:25 +0200)]
Use if-let in std::result documentation

This takes an opportunity to show yet-another-way of dealing with
Results and matching.

9 years agoFix a typo in std::result documentation
Simonas Kazlauskas [Tue, 13 Jan 2015 18:24:48 +0000 (20:24 +0200)]
Fix a typo in std::result documentation

9 years agoMake the Rust Book more mobile friendly
Seth Faxon [Tue, 13 Jan 2015 00:51:31 +0000 (16:51 -0800)]
Make the Rust Book more mobile friendly

9 years agoAdd notes about 32 vs 64 bit Windows
Steve Klabnik [Mon, 12 Jan 2015 21:00:03 +0000 (16:00 -0500)]
Add notes about 32 vs 64 bit Windows

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 agoSupport UFCS style calls to a method defined in `Trait` where `Self`
Niko Matsakis [Tue, 13 Jan 2015 14:17:07 +0000 (09:17 -0500)]
Support UFCS style calls to a method defined in `Trait` where `Self`
is bound to a trait object. Fixes #20676.

9 years agoReplace usage of deriving with derive in docs
Greg Chapple [Tue, 6 Jan 2015 10:56:14 +0000 (10:56 +0000)]
Replace usage of deriving with derive in docs

9 years agographviz-flowgraph tests: use new `--xpretty flowgraph,unlabelled` option.
Felix S. Klock II [Tue, 13 Jan 2015 12:46:29 +0000 (13:46 +0100)]
graphviz-flowgraph tests: use new `--xpretty flowgraph,unlabelled` option.

This makes the tests much easier to maintain; the particular details
of the labels attached to exiting scopes is not worth the effort
required to keep it up to date as things change in the compiler
internals.

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 agoFix test failures
Travis Watkins [Tue, 13 Jan 2015 11:43:30 +0000 (05:43 -0600)]
Fix test failures

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 agoReturn passed value from black_box
Travis Watkins [Sat, 3 Jan 2015 08:49:42 +0000 (02:49 -0600)]
Return passed value from black_box

By returning the passed value black_box can be used on data being
passed to a function being benchmarked. This ensures the compiler
does not optimize the function for the input which could result in
the entire function being optimized away.

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 agoVarious changes to Rust Introduction
Kevin Yap [Sun, 11 Jan 2015 23:41:59 +0000 (15:41 -0800)]
Various changes to Rust Introduction

- Make punctuation/formatting consistent with the changes made to "The
  Rust Programming Language" in #20782.
- Use title casing for "Safety and Speed" section.
- Reword some phrases to improve clarity.

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 agoadd test for issue #20575
Jorge Aparicio [Mon, 12 Jan 2015 23:40:19 +0000 (18:40 -0500)]
add test for issue #20575

closes #20575

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 agoAdd note about TLS lookups in random()
Steve Klabnik [Mon, 12 Jan 2015 22:57:28 +0000 (17:57 -0500)]
Add note about TLS lookups in random()

Fixes #16072

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 agoRemove dead link from make tips
Steve Klabnik [Mon, 12 Jan 2015 22:12:05 +0000 (17:12 -0500)]
Remove dead link from make tips

Fixes #17950

9 years agoadd --xpretty flowgraph,unlabelled variant.
Felix S. Klock II [Mon, 12 Jan 2015 21:42:12 +0000 (22:42 +0100)]
add --xpretty flowgraph,unlabelled variant.

9 years agoLink to a better place for msys2
Steve Klabnik [Mon, 12 Jan 2015 20:56:16 +0000 (15:56 -0500)]
Link to a better place for msys2

This is much more helpful.

9 years agoDon't use 'synonym' with regards to newtypes
Steve Klabnik [Mon, 12 Jan 2015 20:30:11 +0000 (15:30 -0500)]
Don't use 'synonym' with regards to newtypes

Fixes #20037.

9 years agoElaborate on destructuring let
Steve Klabnik [Mon, 12 Jan 2015 20:28:09 +0000 (15:28 -0500)]
Elaborate on destructuring let

Fixes #20471.

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 agoImprove example in the intro.
Steve Klabnik [Mon, 12 Jan 2015 16:34:42 +0000 (11:34 -0500)]
Improve example in the intro.

Thank you @bluss for the suggested implementation.

Fixes #20844

9 years agoImprove the ownership guide a tad
Steve Klabnik [Mon, 12 Jan 2015 18:48:59 +0000 (13:48 -0500)]
Improve the ownership guide a tad

Fixes #19924

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 agoVec's IntoIter should be Send/Sync when Vec is (fixes #21027)
Renato Zannon [Mon, 12 Jan 2015 19:12:20 +0000 (17:12 -0200)]
Vec's IntoIter should be Send/Sync when Vec is (fixes #21027)

9 years agoImprove clarity of paragraph in the pointer guide
Steve Klabnik [Mon, 12 Jan 2015 18:57:09 +0000 (13:57 -0500)]
Improve clarity of paragraph in the pointer guide

Fixes #19067

9 years agoRemove PDF link on 404 page
Steve Klabnik [Mon, 12 Jan 2015 18:16:07 +0000 (13:16 -0500)]
Remove PDF link on 404 page

Fixes #17368

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 agoEase parsing of an English sentence
Lauri Lehmijoki [Sun, 11 Jan 2015 07:57:16 +0000 (09:57 +0200)]
Ease parsing of an English sentence

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 agoClean up wording around uninitialized values.
Steve Klabnik [Mon, 12 Jan 2015 16:49:54 +0000 (11:49 -0500)]
Clean up wording around uninitialized values.

Fixes #20840

9 years agoLink to sections in the book's README.md
Steve Klabnik [Mon, 12 Jan 2015 15:59:21 +0000 (10:59 -0500)]
Link to sections in the book's README.md

Fixes #20852

9 years agoClean up unary operators in the reference
Steve Klabnik [Mon, 12 Jan 2015 15:52:24 +0000 (10:52 -0500)]
Clean up unary operators in the reference

Fixes #20876

9 years agoSmall fix in the book
Steve Klabnik [Mon, 12 Jan 2015 15:47:56 +0000 (10:47 -0500)]
Small fix in the book

Fixes #20914

9 years agoSmall grammar fix in the book
Steve Klabnik [Mon, 12 Jan 2015 15:45:32 +0000 (10:45 -0500)]
Small grammar fix in the book

Fixes #20993

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 agoFix text in TRPL macros guide to match the example
Alexander Korolkov [Sun, 11 Jan 2015 21:51:25 +0000 (00:51 +0300)]
Fix text in TRPL macros guide to match the example

Also, update description of macro invocation syntax:
after https://github.com/rust-lang/rust/pull/20563 there is
a number of additional limitations on macro syntax.

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 agoUpdate #[deriving] documentation.
Huon Wilson [Mon, 12 Jan 2015 13:00:19 +0000 (00:00 +1100)]
Update #[deriving] documentation.

Syntax and a few fixed bugs etc.

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 agoRemove usage and reference of feature(globs) from the book
Cam Jackson [Mon, 12 Jan 2015 12:06:03 +0000 (23:06 +1100)]
Remove usage and reference of feature(globs) from the book

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 agoPurge references to Rust tasks from TRPL.
Paul Crowley [Sat, 10 Jan 2015 09:45:51 +0000 (09:45 +0000)]
Purge references to Rust tasks from TRPL.

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 agoiOS: fixed install phase
Valerii Hiora [Wed, 25 Jun 2014 12:33:49 +0000 (15:33 +0300)]
iOS: fixed install phase

It was broken as tried to copy dylibs which are actually never been
built for iOS

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 agopowerpc: Fix extraneous include in rt support
Richo Healey [Sun, 11 Jan 2015 04:35:22 +0000 (20:35 -0800)]
powerpc: Fix extraneous include in rt support

9 years agopowerpc: Fix missing include in cabi_powerpc
Richo Healey [Sun, 11 Jan 2015 04:35:10 +0000 (20:35 -0800)]
powerpc: Fix missing include in cabi_powerpc

9 years agopowerpc: definition support for libc
Richo Healey [Sat, 10 Jan 2015 05:38:14 +0000 (21:38 -0800)]
powerpc: definition support for libc

9 years agopowerpc: rough platform support
Richo Healey [Sat, 10 Jan 2015 04:38:53 +0000 (20:38 -0800)]
powerpc: rough platform support

9 years agopowerpc: pthread support
Richo Healey [Sat, 10 Jan 2015 04:33:29 +0000 (20:33 -0800)]
powerpc: pthread support

9 years agopowerpc: Fixup more stack work
Richo Healey [Sat, 10 Jan 2015 04:28:48 +0000 (20:28 -0800)]
powerpc: Fixup more stack work

9 years agopowerpc: add cdefs for linux
Richo Healey [Sat, 10 Jan 2015 04:27:46 +0000 (20:27 -0800)]
powerpc: add cdefs for linux

This borrowed entirely from the mips definitions, and should be
revisited after it lands while testing.

9 years agopowerpc: Janky segmented stack support
Richo Healey [Sat, 10 Jan 2015 04:26:10 +0000 (20:26 -0800)]
powerpc: Janky segmented stack support

9 years agopowerpc: Add unwinder size REVISIT
Richo Healey [Sat, 10 Jan 2015 04:20:57 +0000 (20:20 -0800)]
powerpc: Add unwinder size REVISIT

9 years agopowerpc: Add libstd utils
Richo Healey [Sat, 10 Jan 2015 04:20:15 +0000 (20:20 -0800)]
powerpc: Add libstd utils

9 years agopowerpc: Teach trans about powerpc
Richo Healey [Sat, 10 Jan 2015 04:13:23 +0000 (20:13 -0800)]
powerpc: Teach trans about powerpc

9 years agopowerpc: initialize llvm
Richo Healey [Sat, 10 Jan 2015 04:03:37 +0000 (20:03 -0800)]
powerpc: initialize llvm

9 years agopowerpc: Add backend support for powerpc
Richo Healey [Sat, 10 Jan 2015 04:00:29 +0000 (20:00 -0800)]
powerpc: Add backend support for powerpc

9 years agopowerpc: Tell liballoc about power alignment
Richo Healey [Sat, 10 Jan 2015 03:54:55 +0000 (19:54 -0800)]
powerpc: Tell liballoc about power alignment

9 years agopowerpc: Document the existance of powerpc
Richo Healey [Sat, 10 Jan 2015 03:53:47 +0000 (19:53 -0800)]
powerpc: Document the existance of powerpc

9 years agopowerpc: Use toolchain assembler on power
Richo Healey [Sat, 10 Jan 2015 03:52:58 +0000 (19:52 -0800)]
powerpc: Use toolchain assembler on power

9 years agopowerpc: Build llvm for powerpc
Richo Healey [Sat, 10 Jan 2015 03:52:18 +0000 (19:52 -0800)]
powerpc: Build llvm for powerpc

9 years agopowerpc: Add platform configuration
Richo Healey [Sat, 10 Jan 2015 03:51:51 +0000 (19:51 -0800)]
powerpc: Add platform configuration

9 years agopowerpc: Add support to configure
Richo Healey [Sat, 10 Jan 2015 03:49:54 +0000 (19:49 -0800)]
powerpc: Add support to configure

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 agoRemove unused import.
Joseph Crail [Mon, 12 Jan 2015 04:08:26 +0000 (23:08 -0500)]
Remove unused import.

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.