Commit Graph

1163 Commits

Author SHA1 Message Date
Patrick Walton
5d3559e645 librustc: Make self and static into keywords 2013-05-12 16:35:18 -07:00
bors
638b394a37 auto merge of #6427 : catamorphism/rust/issue-6319, r=nikomatsakis
r? @nikomatsakis In #6319, several people mentioned they ran into a "computing
fictitious type" ICE in trans. This turns out to be because some
of my recent changes to typeck::check::_match resulted in type errors
getting reported with ty_err as the expected type, which meant the errors
were suppressed, and typechecking incorrectly succeeded (since the errors
weren't recorded).

Changed the error messages in these cases not to use an expected type at all,
rather, printing out a string describing the type that was expected (which is
what the code originally did). The result is a bit repetitive and the
proliferation of error-reporting functions in typeck::infer is a bit annoying,
but I thought it was important to fix this now; more cleanup can happen later.
2013-05-12 10:34:38 -07:00
Corey Richardson
a279d65102 clean up the last bit of warnings 2013-05-11 20:36:47 -07:00
Tim Chevalier
ed41864464 Warning police 2013-05-11 20:36:44 -07:00
Tim Chevalier
cdb52c0201 rustc: Don't call type_error_message() with ty_err as the expected type
In #6319, several people mentioned they ran into a "computing
fictitious type" ICE in trans. This turns out to be because some
of my recent changes to typeck::check::_match resulted in type errors
getting reported with ty_err as the expected type, which meant the errors
were suppressed, and typechecking incorrectly succeeded (since the errors
weren't recorded).

Changed the error messages in these cases not to use an expected type at all,
rather, printing out a string describing the type that was expected (which is
what the code originally did). The result is a bit repetitive and the
proliferation of error-reporting functions in typeck::infer is a bit annoying,
but I thought it was important to fix this now; more cleanup can happen later.
2013-05-11 17:51:00 -07:00
bors
82164a1e45 auto merge of #6402 : kud1ing/rust/fixes, r=pcwalton 2013-05-11 16:49:40 -07:00
bors
8ca64a423b auto merge of #6397 : cantsin/rust/rusti-fixes, r=catamorphism
Fixes #6378

Don't pass the binary name to the LLVMRustExecuteJIT closure, otherwise it will leak memory; the binary name doesn't seem to be needed, anyhow.
2013-05-11 14:04:44 -07:00
bors
957251817b auto merge of #6389 : sonwow/rust/issue-3356, r=bstrie
Fix for #3356
2013-05-11 12:55:49 -07:00
bors
e478cedb0a auto merge of #6385 : huonw/rust/rustc-dtor-struct-match, r=nikomatsakis
**Caveat**: With the current commit, this check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s, and invalid/unsafe code compiles.

I don't know how to fix this, I experimented with some things to try to make let patterns and match patterns run on the same code (since this would presumably fix many of the other unsoundness issues of let-patterns, e.g. #6225), but I don't understand enough of the code. (I think I heard someone talking about a fix for `let` being in progress?)

Fixes #6344 and #6341.
2013-05-11 11:49:50 -07:00
bors
96de2b0273 auto merge of #6383 : huonw/rust/rustc-expand-then-strip, r=thestinger
This allows macros to create tests and benchmarks.

This is possibly unsound (I've got no idea, but it seemed to work), and being able to programmatically generate benchmarks to compare several implementations of similar algorithms is nice.
2013-05-11 10:52:52 -07:00
bors
18a47f9580 auto merge of #6384 : thomaslee/rust/issue-4202, r=catamorphism
This fixes the issue described in #4202.

From what I understood of the code, when we reexport a trait in a submodule using e.g. "pub use foo::SomeTrait", we were not previously making an effort to reexport the static methods on that trait.

I'm new to the Rust code base (and the Rust language itself) so my approach may not be kosher, but this patch works by changing the encoder to include the static methods associated with traits.

I couldn't see any tests for this area of the code, so I didn't really have any examples to go by. If tests are needed, I'm happy to work through that if I can get some assistance to do so.
2013-05-11 00:43:51 -07:00
bors
9f106a643e auto merge of #6260 : alexcrichton/rust/issue-3466-no-swap, r=pcwalton
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead.

I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
2013-05-10 20:35:00 -07:00
Alex Crichton
63c7e2f991 Remove the '<->' operator from the language 2013-05-10 22:51:06 -04:00
bors
c49cf8b330 auto merge of #6205 : brson/rust/flate, r=brson
r? @graydon

I don't think this is necessary in core.
2013-05-10 19:41:00 -07:00
bors
3e0400fb86 auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwalton
Closes #6183.

The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout.

The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10 17:56:02 -07:00
Alex Crichton
606bd75586 Fix merge "failures" 2013-05-10 19:20:21 -04:00
Brian Anderson
7652f3ddb8 Move flate from core to std 2013-05-10 16:00:26 -07:00
Lenny222
52610c3980 more back-ticks, less colons 2013-05-10 23:34:20 +02:00
bors
d546493096 auto merge of #6380 : pcwalton/rust/core-text-ice, r=pcwalton 2013-05-10 13:10:54 -07:00
James Tranovich
3db74ddd2e Fixes rusti crashes.
Don't pass the binary name to the LLVMRustExecuteJIT closure; doesn't
seem to be needed, anyhow.
2013-05-10 10:51:00 -07:00
Youngsoo Son
24ef88cee9 renamed str::from_slice to str::to_owned 2013-05-10 20:08:56 +09:00
Youngsoo Son
b7da975049 renamed vec::from_slice to vec::to_owned 2013-05-10 18:38:54 +09:00
bors
e9d0018abf auto merge of #6356 : dotdash/rust/strinterner, r=pcwalton
&str can be turned into @~str on demand, using to_owned(), so for
strings, we can create a specialized interner that accepts &str for
intern() and find() but stores and returns @~str.
2013-05-10 01:55:54 -07:00
Huon Wilson
f6743fea70 librustc: allow destructuring of structs with destructors if the pattern has no moves.
This check only works for `match`s, the checks (incorrectly) do not run for patterns in
`let`s.
2013-05-10 18:34:19 +10:00
bors
f04eb37c7e auto merge of #6347 : cmr/rust/unknown_module_resolve_error, r=catamorphism
This improves error reporting for the following class of imports:

```rust
use foo::bar;
```

Where foo, the topmost module, is unresolved. It now results in:

```text
/tmp/foo.rs:1:4: 1:7 error: unresolved import.  perhapsyou forgot an 'extern mod foo'?
/tmp/foo.rs:1 use foo::bar;
                  ^~~
/tmp/foo.rs:1:4: 1:12 error: failed to resolve import: foo::bar
/tmp/foo.rs:1 use foo::bar;
                  ^~~~~~~~
error: failed to resolve imports
error: aborting due to 3 previous errors
```

This is the first of a series of changes I plan on making to unresolved name error messages.
2013-05-10 00:52:52 -07:00
Alex Crichton
a87db3e2cd rustc: Use the new for protocol 2013-05-10 02:46:19 -04:00
Alex Crichton
0cde8ba684 Implement a new protocol for for loops that's much more easily composable 2013-05-10 02:46:18 -04:00
Tom Lee
9042e1e8de Include static methods on traits in reexports. 2013-05-09 23:00:03 -07:00
Patrick Walton
923450d00c librustc: Fix ICE in core-text resulting from dynamic borrowing. rs=blocking-servo 2013-05-09 19:39:07 -07:00
bors
ad8e236f32 auto merge of #6336 : nikomatsakis/rust/issue-6308-closure-bounds, r=nikomatsakis
Use a bitset to represent built-in bounds. There are several places in the language where only builtin bounds (aka kinds) will be accepted, e.g. on closures, destructor type parameters perhaps, and on trait types.

r? @brson
2013-05-09 17:50:21 -07:00
Corey Richardson
9cbab89076 fix formating and tests 2013-05-09 20:15:59 -04:00
bors
f547a671dc auto merge of #6373 : nikomatsakis/rust/issue-6355-perf-regression, r=graydon
Fix #6355 and #6272---we were not giving the correct index to the derefs that occur as part of the rooting process, resulting in extra copies and generally bogus behavior. Haven't quite produced the right test for this, but I thought I'd push the fix in the meantime. Test will follow shortly.

r? @graydon
2013-05-09 13:45:49 -07:00
Niko Matsakis
78520867b9 rustc: Add EnumSet tests 2013-05-09 16:28:25 -04:00
Corey Richardson
fa5baf399d Tweak error message
Recommendation of @kud1ing
2013-05-09 16:09:01 -04:00
Corey Richardson
d3ca9c61a0 Better error message for certain classes of unresolved imports 2013-05-09 16:08:53 -04:00
Niko Matsakis
e18ed77b72 Remove remnants of mutable fields from mem_categorization, borrowck. 2013-05-09 15:58:41 -04:00
Niko Matsakis
15164cc6a6 Issue the correct deref count for the implicit deref that occurs
as part of an autoslice operation (#6272).

Fixes #6272.
2013-05-09 15:58:02 -04:00
bors
7675856253 auto merge of #6354 : Aatch/rust/uninit-intrinsic, r=graydon
Adds an `uninit` intrinsic.

It's just an empty function, so llvm optimizes it down to nothing.

I changed all of the `init` intrinsic usages to `uninit` where it seemed appropriate to.
2013-05-09 12:37:00 -07:00
bors
7a4c6e587d auto merge of #6325 : sammykim/rust/lint-name, r=graydon
Fix #3525.
2013-05-09 08:54:38 -07:00
Niko Matsakis
dc2ca9d883 Refactor representation of bounds to separate out BuiltinBounds into
its own type. Use a bitset to represent built-in bounds. There
are several places in the language where only builtin bounds (aka kinds)
will be accepted, e.g. on closures, destructor type parameters perhaps,
and on trait types.
2013-05-09 11:39:06 -04:00
Björn Steinbrink
1393c3a3f4 Use a specialized string interner to reduce the need for owned strings
&str can be turned into @~str on demand, using to_owned(), so for
strings, we can create a specialized interner that accepts &str for
intern() and find() but stores and returns @~str.
2013-05-09 14:40:19 +02:00
bors
ca95e7f94e auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiyn
Hi there,

Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes.

Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`.

Thanks!

Sean
2013-05-09 03:51:32 -07:00
James Miller
050c744c23 Add uninit intrinsic 2013-05-09 22:23:38 +12:00
Youngmin Yoo
c02064d153 librustc: rename vec::each(var) to var.each 2013-05-09 14:20:04 +09:00
Huon Wilson
ea5c413427 Perform expansion before stripping/building a test harness.
This allows macros to create tests and benchmarks.
2013-05-09 15:15:54 +10:00
Sangeun Kim
1b4e375046 Add space 2013-05-09 10:44:27 +09:00
bors
3bbbb314ee auto merge of #6327 : z0w0/rust/rm-notest, r=brson
Makes it more consistent, imo.
2013-05-08 18:15:41 -07:00
Patrick Walton
3affc6ed40 librustc: Fix merge fallout. 2013-05-08 17:04:02 -07:00
Patrick Walton
16a0125e41 libcore: Fix tests. 2013-05-08 17:04:01 -07:00
Patrick Walton
49a66a5c5a librustc: Stop parsing modes and remove them entirely from the language 2013-05-08 17:04:01 -07:00