]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #10519 : nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r...
bors [Thu, 28 Nov 2013 11:51:32 +0000 (03:51 -0800)]
auto merge of #10519 : nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r=pnkfelix

See #8624 for details.

r? @pnkfelix

10 years agoTest that reborrowing contents of an `&'a mut &'b mut` pointer can only
Niko Matsakis [Sat, 16 Nov 2013 22:30:45 +0000 (17:30 -0500)]
Test that reborrowing contents of an `&'a mut &'b mut` pointer can only
be done for at most lifetime `'a`

Fixes #8624

10 years agoModify iterators to make them safe with the new rules.
Niko Matsakis [Sat, 16 Nov 2013 22:29:39 +0000 (17:29 -0500)]
Modify iterators to make them safe with the new rules.

10 years agoauto merge of #10694 : klutzy/rust/rustdoc-closure, r=alexcrichton
bors [Thu, 28 Nov 2013 05:02:52 +0000 (21:02 -0800)]
auto merge of #10694 : klutzy/rust/rustdoc-closure, r=alexcrichton

10 years agoauto merge of #10691 : g3xzh/rust/benchm, r=cmr
bors [Thu, 28 Nov 2013 03:47:15 +0000 (19:47 -0800)]
auto merge of #10691 : g3xzh/rust/benchm, r=cmr

I have written some benchmark tests to `push`, `push_many`, `join`,
`join_many` and `ends_with_path`.

Let me know what you think (@cmr).
Thanks in advance.

10 years agoauto merge of #10687 : alexcrichton/rust/issue-10686, r=thestinger
bors [Thu, 28 Nov 2013 02:32:30 +0000 (18:32 -0800)]
auto merge of #10687 : alexcrichton/rust/issue-10686, r=thestinger

Turns out android doesn't support LLVM's thread_local attribute and accompanying
implementation.

Closes #10686

10 years agoauto merge of #10621 : Florob/rust/unicode63, r=cmr
bors [Thu, 28 Nov 2013 00:47:14 +0000 (16:47 -0800)]
auto merge of #10621 : Florob/rust/unicode63, r=cmr

This update the unicode.rs file to the latest Unicode version released 2013-09-30.

10 years agoauto merge of #10642 : cmr/rust/strict_doccomment, r=alexcrichton
bors [Wed, 27 Nov 2013 23:32:18 +0000 (15:32 -0800)]
auto merge of #10642 : cmr/rust/strict_doccomment, r=alexcrichton

Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This
changes that, so that only `/// foo` and `/** foo ***/` are accepted. This
confuses many newcomers and it seems weird.

Also update the manual for these changes, and modernify the EBNF for comments.

Closes #10638

10 years agoBe more strict about doc comments
Corey Richardson [Mon, 25 Nov 2013 04:23:50 +0000 (23:23 -0500)]
Be more strict about doc comments

Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This
changes that, so that only `/// foo` and `/** foo ***/` are accepted. This
confuses many newcomers and it seems weird.

Also update the manual for these changes, and modernify the EBNF for comments.

Closes #10638

10 years agoFix handling of upper/lowercase, and whitespace
Florian Zeitz [Tue, 26 Nov 2013 05:15:45 +0000 (06:15 +0100)]
Fix handling of upper/lowercase, and whitespace

10 years agoUpdate Unicode data to version 6.3
Florian Zeitz [Sat, 23 Nov 2013 17:57:13 +0000 (18:57 +0100)]
Update Unicode data to version 6.3

10 years agoUpdate unicode.py to reflect language changes
Florian Zeitz [Sat, 23 Nov 2013 17:56:56 +0000 (18:56 +0100)]
Update unicode.py to reflect language changes

10 years agoauto merge of #10680 : alexcrichton/rust/relax-feature-gate, r=thestinger
bors [Wed, 27 Nov 2013 22:17:41 +0000 (14:17 -0800)]
auto merge of #10680 : alexcrichton/rust/relax-feature-gate, r=thestinger

Instead of forcibly always aborting compilation, allow usage of
 #[warn(unknown_features)] and related lint attributes to selectively abort
 compilation. By default, this lint is deny.

10 years agoUse the native tls implementation on android
Alex Crichton [Wed, 27 Nov 2013 04:23:56 +0000 (20:23 -0800)]
Use the native tls implementation on android

Turns out android doesn't support LLVM's thread_local attribute and accompanying
implementation.

Closes #10686

10 years agoauto merge of #10685 : ebiggers/rust/ascii_fixes, r=alexcrichton
bors [Wed, 27 Nov 2013 19:52:09 +0000 (11:52 -0800)]
auto merge of #10685 : ebiggers/rust/ascii_fixes, r=alexcrichton

is_digit() incorrectly returned false for '0'.
is_control() incorrectly returned true for ' ' (space).

10 years agoauto merge of #10662 : alexcrichton/rust/thread-detach, r=pcwalton
bors [Wed, 27 Nov 2013 17:57:05 +0000 (09:57 -0800)]
auto merge of #10662 : alexcrichton/rust/thread-detach, r=pcwalton

This has one commit from a separate pull request (because these commits depend on that one), but otherwise the extra details can be found in the commit messages. The `rt::thread` module has been generally cleaned up for everyday safe usage (and it's a bug if it's not safe).

10 years agoRelax restrictions on unknown feature directives
Alex Crichton [Tue, 26 Nov 2013 22:55:06 +0000 (14:55 -0800)]
Relax restrictions on unknown feature directives

Instead of forcibly always aborting compilation, allow usage of
 #[warn(unknown_features)] and related lint attributes to selectively abort
 compilation. By default, this lint is deny.

10 years agoImprove the rt::thread module
Alex Crichton [Tue, 26 Nov 2013 02:08:31 +0000 (18:08 -0800)]
Improve the rt::thread module

* Added doc comments explaining what all public functionality does.
* Added the ability to spawn a detached thread
* Added the ability for the procs to return a value in 'join'

10 years agorustdoc: Use new ||/proc syntax
klutzy [Wed, 27 Nov 2013 17:23:12 +0000 (02:23 +0900)]
rustdoc: Use new ||/proc syntax

10 years agoauto merge of #10693 : eddyb/rust/freeze-ast, r=thestinger
bors [Wed, 27 Nov 2013 16:07:56 +0000 (08:07 -0800)]
auto merge of #10693 : eddyb/rust/freeze-ast, r=thestinger

It's truly immutable now, which will allow us to remove some cloning in the parser and box parts of the AST in `Rc<T>` (if desired).

10 years agostd::ascii: Add tests for is_digit() and is_control()
Eric Biggers [Wed, 27 Nov 2013 15:54:54 +0000 (09:54 -0600)]
std::ascii:  Add tests for is_digit() and is_control()

10 years agoFreeze the AST by removing a couple of unused @mut ~[T] from token_tree.
Eduard Burtescu [Wed, 27 Nov 2013 15:48:58 +0000 (17:48 +0200)]
Freeze the AST by removing a couple of unused @mut ~[T] from token_tree.

10 years agoauto merge of #10684 : jld/rust/unstruct-unhack-typekind, r=alexcrichton
bors [Wed, 27 Nov 2013 14:17:40 +0000 (06:17 -0800)]
auto merge of #10684 : jld/rust/unstruct-unhack-typekind, r=alexcrichton

10 years agoauto merge of #10688 : bjz/rust/recv_iter, r=brson
bors [Wed, 27 Nov 2013 09:52:10 +0000 (01:52 -0800)]
auto merge of #10688 : bjz/rust/recv_iter, r=brson

I've noticed I use this pattern quite a bit:

~~~rust
do spawn {
    loop {
        match port.try_recv() {
            Some(x) => ...,
            None => ...,
        }
    }
}
~~~

The `RecvIterator`, returned from a default `recv_iter` method on the `GenericPort` trait, allows you to reduce this down to:

~~~rust
do spawn {
    for x in port.recv_iter() {
        ...
    }
}
~~~

As demonstrated in the tests, you can also access the port from within the `for` block for further `recv`ing and `peek`ing with no borrow errors, which is quite nice.

10 years agoAdd benchmark tests to path/posix
g3xzh [Wed, 27 Nov 2013 09:39:07 +0000 (11:39 +0200)]
Add benchmark tests to path/posix

I have written some benchmark tests to `push`, `push_many`, `join`,
`join_many` and `ends_with_path`.

10 years agoauto merge of #10670 : eddyb/rust/node-u32, r=alexcrichton
bors [Wed, 27 Nov 2013 06:07:44 +0000 (22:07 -0800)]
auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichton

### Rationale
There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**.
Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**.

### Potential problems
Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it.

### Results
Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3).
Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference).
However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.

10 years agoClean up statically initialized data on shutdown
Alex Crichton [Tue, 26 Nov 2013 02:27:27 +0000 (18:27 -0800)]
Clean up statically initialized data on shutdown

Whenever the runtime is shut down, add a few hooks to clean up some of the
statically initialized data of the runtime. Note that this is an unsafe
operation because there's no guarantee on behalf of the runtime that there's no
other code running which is using the runtime.

This helps turn down the noise a bit in the valgrind output related to
statically initialized mutexes. It doesn't turn the noise down to 0 because
there are still statically initialized mutexes in dynamic_lib and
os::with_env_lock, but I believe that it would be easy enough to add exceptions
for those cases and I don't think that it's the runtime's job to go and clean up
that data.

10 years agoAdd an iterator for receiving messages from GenericPorts
Brendan Zabarauskas [Wed, 27 Nov 2013 05:10:12 +0000 (15:10 +1000)]
Add an iterator for receiving messages from GenericPorts

10 years agoShink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.
Eduard Burtescu [Wed, 27 Nov 2013 05:02:25 +0000 (07:02 +0200)]
Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.

10 years agoauto merge of #10679 : alexcrichton/rust/no-routine, r=pcwalton
bors [Wed, 27 Nov 2013 03:37:38 +0000 (19:37 -0800)]
auto merge of #10679 : alexcrichton/rust/no-routine, r=pcwalton

10 years agostd::ascii: Fix is_digit() and is_control()
Eric Biggers [Wed, 27 Nov 2013 02:13:25 +0000 (20:13 -0600)]
std::ascii:  Fix is_digit() and is_control()

is_digit() incorrectly returned false for '0'.
is_control() incorrectly returned true for ' ' (space).

10 years agoRemove enum struct return workaround from LLVM bindings.
Jed Davis [Tue, 26 Nov 2013 18:54:20 +0000 (10:54 -0800)]
Remove enum struct return workaround from LLVM bindings.

10 years agoauto merge of #10677 : jld/rust/type-enum-discrim-rm, r=alexcrichton
bors [Wed, 27 Nov 2013 01:32:45 +0000 (17:32 -0800)]
auto merge of #10677 : jld/rust/type-enum-discrim-rm, r=alexcrichton

10 years agoRemove unused std::routine
Alex Crichton [Tue, 26 Nov 2013 21:52:32 +0000 (13:52 -0800)]
Remove unused std::routine

10 years agoauto merge of #10649 : sfackler/rust/multi-macro, r=alexcrichton
bors [Tue, 26 Nov 2013 22:52:05 +0000 (14:52 -0800)]
auto merge of #10649 : sfackler/rust/multi-macro, r=alexcrichton

The majority of this change is modifying some of the `ast_visit` methods to return multiple values.

It's prohibitively expensive to allocate a `~[Foo]` every time a statement, declaration, item, etc is visited, especially since the vast majority will have 0 or 1 elements. I've added a `SmallVector` class that avoids allocation in the 0 and 1 element cases to take care of that.

10 years agoClean up SmallVector use a bit
Steven Fackler [Tue, 26 Nov 2013 04:02:15 +0000 (20:02 -0800)]
Clean up SmallVector use a bit

10 years agoSupport multiple item macros
Steven Fackler [Mon, 25 Nov 2013 07:08:53 +0000 (23:08 -0800)]
Support multiple item macros

Closes #4375

10 years agoAdd SmallVector to libsyntax
Steven Fackler [Mon, 25 Nov 2013 05:18:21 +0000 (21:18 -0800)]
Add SmallVector to libsyntax

10 years agoauto merge of #10312 : thestinger/rust/thread_local, r=alexcritchton
bors [Tue, 26 Nov 2013 21:32:43 +0000 (13:32 -0800)]
auto merge of #10312 : thestinger/rust/thread_local, r=alexcritchton

This provides a building block for fast thread-local storage. It does
not change the safety semantics of `static mut`.

Closes #10310

10 years agoauto merge of #10581 : pcwalton/rust/dedo, r=pcwalton
bors [Tue, 26 Nov 2013 20:13:03 +0000 (12:13 -0800)]
auto merge of #10581 : pcwalton/rust/dedo, r=pcwalton

r? @alexcrichton

10 years agoadd a thread_local feature gate
Daniel Micay [Tue, 26 Nov 2013 19:21:22 +0000 (14:21 -0500)]
add a thread_local feature gate

10 years agoport the runtime to `#[thread_local]`
Daniel Micay [Wed, 6 Nov 2013 06:17:04 +0000 (01:17 -0500)]
port the runtime to `#[thread_local]`

10 years agoadd `#[thread_local]` attribute
Daniel Micay [Wed, 6 Nov 2013 05:38:08 +0000 (00:38 -0500)]
add `#[thread_local]` attribute

This provides a building block for fast thread-local storage. It does
not change the safety semantics of `static mut`.

Closes #10310

10 years agolibrustc: Fix merge fallout.
Patrick Walton [Sun, 24 Nov 2013 19:44:28 +0000 (11:44 -0800)]
librustc: Fix merge fallout.

10 years agoauto merge of #10673 : klutzy/rust/quite, r=alexcrichton
bors [Tue, 26 Nov 2013 18:57:01 +0000 (10:57 -0800)]
auto merge of #10673 : klutzy/rust/quite, r=alexcrichton

10 years agoRemove the unused obsolete enum_discrim type.
Jed Davis [Tue, 26 Nov 2013 18:49:41 +0000 (10:49 -0800)]
Remove the unused obsolete enum_discrim type.

10 years agoauto merge of #10664 : alexcrichton/rust/issue-10663, r=luqmana
bors [Tue, 26 Nov 2013 17:17:58 +0000 (09:17 -0800)]
auto merge of #10664 : alexcrichton/rust/issue-10663, r=luqmana

It turns out that libuv was returning ENOSPC to us in our usage of the
uv_ipX_name functions. It also turns out that there may be an off-by-one in
libuv. For now just add one to the buffer size and handle the return value
correctly.

Closes #10663

10 years agoCorrectly handle libuv errors in addrinfo calls
Alex Crichton [Tue, 26 Nov 2013 05:59:08 +0000 (21:59 -0800)]
Correctly handle libuv errors in addrinfo calls

It turns out that libuv was returning ENOSPC to us in our usage of the
uv_ipX_name functions. It also turns out that there may be an off-by-one in
libuv. For now just add one to the buffer size and handle the return value
correctly.

Closes #10663

10 years agolibstd: Fix Win32 and other bustage.
Patrick Walton [Fri, 22 Nov 2013 22:15:32 +0000 (14:15 -0800)]
libstd: Fix Win32 and other bustage.

10 years agolibrustc: Make `||` lambdas not infer to `proc`s
Patrick Walton [Fri, 22 Nov 2013 07:36:52 +0000 (23:36 -0800)]
librustc: Make `||` lambdas not infer to `proc`s

10 years agotest: Remove all remaining non-procedure uses of `do`.
Patrick Walton [Fri, 22 Nov 2013 03:20:48 +0000 (19:20 -0800)]
test: Remove all remaining non-procedure uses of `do`.

10 years agotest: Remove non-procedure uses of `do` from compiletest, libstd tests,
Patrick Walton [Fri, 22 Nov 2013 01:23:21 +0000 (17:23 -0800)]
test: Remove non-procedure uses of `do` from compiletest, libstd tests,
compile-fail tests, run-fail tests, and run-pass tests.

10 years agolibrustc: Remove non-procedure uses of `do` from librustc, librustdoc,
Patrick Walton [Thu, 21 Nov 2013 23:42:55 +0000 (15:42 -0800)]
librustc: Remove non-procedure uses of `do` from librustc, librustdoc,
and librustpkg.

10 years agolibsyntax: Remove all non-`proc` `do` syntax.
Patrick Walton [Thu, 21 Nov 2013 00:23:04 +0000 (16:23 -0800)]
libsyntax: Remove all non-`proc` `do` syntax.

10 years agolibrustuv: Remove all non-`proc` uses of `do` from `libextra` and
Patrick Walton [Wed, 20 Nov 2013 23:46:49 +0000 (15:46 -0800)]
librustuv: Remove all non-`proc` uses of `do` from `libextra` and
`librustuv`.

10 years agolibstd: Remove all non-`proc` uses of `do` from libstd
Patrick Walton [Wed, 20 Nov 2013 22:17:12 +0000 (14:17 -0800)]
libstd: Remove all non-`proc` uses of `do` from libstd

10 years agolibsyntax: Remove the old-style borrowed closure type syntax from the
Patrick Walton [Wed, 20 Nov 2013 02:15:10 +0000 (18:15 -0800)]
libsyntax: Remove the old-style borrowed closure type syntax from the
language.

10 years agolibrustc: Remove remaining uses of `&fn()` in favor of `||`.
Patrick Walton [Wed, 20 Nov 2013 01:36:32 +0000 (17:36 -0800)]
librustc: Remove remaining uses of `&fn()` in favor of `||`.

10 years agotest: Remove most uses of `&fn()` from the tests.
Patrick Walton [Wed, 20 Nov 2013 00:34:19 +0000 (16:34 -0800)]
test: Remove most uses of `&fn()` from the tests.

10 years agoauto merge of #10668 : vky/rust/closure-doc-update, r=alexcrichton
bors [Tue, 26 Nov 2013 12:56:49 +0000 (04:56 -0800)]
auto merge of #10668 : vky/rust/closure-doc-update, r=alexcrichton

10 years agoTurn off attribute_usage warning on check-fast
klutzy [Tue, 26 Nov 2013 11:57:23 +0000 (20:57 +0900)]
Turn off attribute_usage warning on check-fast

10 years agoauto merge of #10660 : alexcrichton/rust/little-scope, r=pcwalton
bors [Tue, 26 Nov 2013 10:52:04 +0000 (02:52 -0800)]
auto merge of #10660 : alexcrichton/rust/little-scope, r=pcwalton

This moves the locking/waiting methods to returning an RAII struct instead of
relying on closures. Additionally, this changes the methods to all take
'&mut self' to discourage recursive locking. The new method to block is to call
`wait` on the returned RAII structure instead of calling it on the lock itself
(this enforces that the lock is held).

At the same time, this improves the Mutex interface a bit by allowing
destruction of non-initialized members and by allowing construction of an empty
mutex (nothing initialized inside).

10 years agoauto merge of #10622 : Kimundi/rust/str_de_iter, r=alexcrichton
bors [Tue, 26 Nov 2013 09:07:40 +0000 (01:07 -0800)]
auto merge of #10622 : Kimundi/rust/str_de_iter, r=alexcrichton

This PR removes almost all `_iter` suffixes in various APIs of the codebase that return Iterators, as discussed in #9440.

As a summarize for the intend behind this PR:

- Iterators are the recommended way to provide a potentially lazy list of values, no need to name them painfully verbose. If anything, functions that return a specific container type should have more verbose names.
- We have a static type system, so no need to encode the return value of a constructor function into its name.

Following is a possibly incomplete list of all renamings I performed in the codebase. For a few of them I'm a bit unsure whether the new name still properly expresses their functionality, so feedback would be welcome:

~~~
&str : word_iter()             -> words()
       line_iter()             -> lines()
       any_line_iter()         -> lines_any()
       iter()                  -> chars()
       char_offset_iter()      -> char_indices()
       byte_iter()             -> bytes()
       split_iter()            -> split()
       splitn_iter()           -> splitn()
       split_str_iter()        -> split_str()
       split_terminator_iter() -> split_terminator()
       matches_index_iter()    -> match_indices()
       nfd_iter()              -> nfd_chars()
       nfkd_iter()             -> nfkd_chars()

&[T] : split_iter()        -> split()
       splitn_iter()       -> splitn()
       window_iter()       -> windows()
       chunk_iter()        -> chunks()
       permutations_iter() -> permutations()

extra:bitv::Bitv :  rev_liter()    -> rev_iter()
                    common_iter()  -> commons()
                    outlier_iter() -> outliers()

extra::treemap::{...} : lower_bound_iter() -> lower_bound()
                        upper_bound_iter() -> upper_bound()

std::trie::{...} : bound_iter()       -> bound()
                   lower_bound_iter() -> lower_bound()
                   upper_bound_iter() -> upper_bound()

rustpkg::package_id::{...} : prefixes_iter() -> prefixes()

std::hashmap::{...} : difference_iter()           -> difference()
                      symmetric_difference_iter() -> symmetric_difference()
                      intersection_iter()         -> intersection()
                      union_iter()                -> union()

std::path::{posix, windows} : component_iter()     -> components()
                              str_component_iter() -> str_components()

... not showing all identical renamings for reverse versions
~~~

---

I'm also planning a few more changes, like removing all unnecessary `_rev` constructors (#9391), or reducing the `split` variants on `&str` to a more versatile and concise system.

10 years agoRemoved unneccessary `_iter` suffixes from various APIs
Marvin Löbel [Sat, 23 Nov 2013 10:18:51 +0000 (11:18 +0100)]
Removed unneccessary `_iter` suffixes from various APIs

10 years agoUpdating docs with updated closure syntax, `&fn` -> `||`
Vijay Korapaty [Tue, 26 Nov 2013 08:02:39 +0000 (00:02 -0800)]
Updating docs with updated closure syntax, `&fn` -> `||`

10 years agoauto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichton
bors [Tue, 26 Nov 2013 07:02:29 +0000 (23:02 -0800)]
auto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichton

This patchset fixes some parts broken on Win64.

This also adds `--disable-pthreads` flags to llvm on mingw-w64 archs (both 32-bit and 64-bit, not mingw) due to bad performance. See #8996 for discussion.

10 years agoauto merge of #10316 : klutzy/rust/attr-lint, r=cmr
bors [Tue, 26 Nov 2013 05:47:16 +0000 (21:47 -0800)]
auto merge of #10316 : klutzy/rust/attr-lint, r=cmr

This patchset makes warning if crate-level attribute is used at other places, obsolete attributed is used, or unknown attribute is used, since they are usually from mistakes.

Closes #3348

10 years agorustc: Add crate-level attribute lint
klutzy [Mon, 25 Nov 2013 15:22:40 +0000 (00:22 +0900)]
rustc: Add crate-level attribute lint

10 years agorustc: Update obsolete attribute list
klutzy [Mon, 25 Nov 2013 14:17:01 +0000 (23:17 +0900)]
rustc: Update obsolete attribute list

10 years agoAdd test for unknown attribute lint
klutzy [Mon, 11 Nov 2013 08:51:27 +0000 (17:51 +0900)]
Add test for unknown attribute lint

10 years agorustc: Add lint for unknown attributes
klutzy [Mon, 11 Nov 2013 06:21:51 +0000 (15:21 +0900)]
rustc: Add lint for unknown attributes

10 years agoauto merge of #10652 : jld/rust/enum-unstruct, r=thestinger
bors [Tue, 26 Nov 2013 04:32:22 +0000 (20:32 -0800)]
auto merge of #10652 : jld/rust/enum-unstruct, r=thestinger

This is needed so that the FFI works as expected on platforms that don't
flatten aggregates the way the AMD64 ABI does, especially for `#[repr(C)]`.

This moves more of `type_of` into `trans::adt`, because the type might
or might not be an LLVM struct.

Closes #10308.

10 years agoAdd tests for attribute lint
klutzy [Wed, 6 Nov 2013 06:30:19 +0000 (15:30 +0900)]
Add tests for attribute lint

10 years agostd: Remove unused attributes
klutzy [Wed, 6 Nov 2013 03:16:47 +0000 (12:16 +0900)]
std: Remove unused attributes

This also enables two tests properly.

10 years agorustc: Add lint for obsolete attributes
klutzy [Wed, 6 Nov 2013 03:16:19 +0000 (12:16 +0900)]
rustc: Add lint for obsolete attributes

This also moves `#[auto_{en,de}code]` checker from syntax to lint.

10 years agorustc: Add lint for misplaced crate attributes
klutzy [Mon, 4 Nov 2013 15:35:56 +0000 (00:35 +0900)]
rustc: Add lint for misplaced crate attributes

10 years agoFix the usual check-fast scoping mistake.
Jed Davis [Tue, 26 Nov 2013 03:42:57 +0000 (19:42 -0800)]
Fix the usual check-fast scoping mistake.

10 years agoMove LittleLock to using RAII
Alex Crichton [Tue, 26 Nov 2013 01:55:41 +0000 (17:55 -0800)]
Move LittleLock to using RAII

This moves the locking/waiting methods to returning an RAII struct instead of
relying on closures. Additionally, this changes the methods to all take
'&mut self' to discourage recursive locking. The new method to block is to call
`wait` on the returned RAII structure instead of calling it on the lock itself
(this enforces that the lock is held).

At the same time, this improves the Mutex interface a bit by allowing
destruction of non-initialized members and by allowing construction of an empty
mutex (nothing initialized inside).

10 years agoauto merge of #10650 : andreasots/rust/ipv6-is-in-hex, r=alexcrichton
bors [Tue, 26 Nov 2013 01:46:32 +0000 (17:46 -0800)]
auto merge of #10650 : andreasots/rust/ipv6-is-in-hex, r=alexcrichton

Without this the assert in <tt>rust_malloc_ip6_addr</tt> is triggered as it expects a correctly formatted IPv6 address.

10 years agoauto merge of #10658 : LeoTestard/rust/serialize-rc, r=cmr
bors [Mon, 25 Nov 2013 21:11:43 +0000 (13:11 -0800)]
auto merge of #10658 : LeoTestard/rust/serialize-rc, r=cmr

Implement various traits (IterBytes and extra's Encodable and Decodable) for Rc<T> when T alreay implements the trait.

10 years agoauto merge of #10657 : sanxiyn/rust/pat, r=cmr
bors [Mon, 25 Nov 2013 19:56:40 +0000 (11:56 -0800)]
auto merge of #10657 : sanxiyn/rust/pat, r=cmr

10 years agoImplement IterBytes for Rc<T>.
Léo Testard [Mon, 25 Nov 2013 18:47:09 +0000 (19:47 +0100)]
Implement IterBytes for Rc<T>.

10 years agoAdd an implementation of Encodable and Decodable for Rc. This will be needed to use...
Léo Testard [Mon, 25 Nov 2013 18:35:03 +0000 (19:35 +0100)]
Add an implementation of Encodable and Decodable for Rc. This will be needed to use Rc in place of @ in libsyntax.

10 years agoTake &Pat in visit_pat
Seo Sanghyeon [Mon, 25 Nov 2013 18:22:21 +0000 (03:22 +0900)]
Take &Pat in visit_pat

10 years agoauto merge of #10653 : thestinger/rust/meaningless, r=huonw
bors [Mon, 25 Nov 2013 18:16:42 +0000 (10:16 -0800)]
auto merge of #10653 : thestinger/rust/meaningless, r=huonw

10 years agoauto merge of #10648 : sfackler/rust/base64-test, r=alexcrichton
bors [Mon, 25 Nov 2013 14:56:40 +0000 (06:56 -0800)]
auto merge of #10648 : sfackler/rust/base64-test, r=alexcrichton

We want a 1000 element array, not a 2 element array

10 years agoTake &Pat
Seo Sanghyeon [Mon, 25 Nov 2013 14:37:03 +0000 (23:37 +0900)]
Take &Pat

10 years agoRemove arms_have_move_bindings
Seo Sanghyeon [Mon, 25 Nov 2013 14:36:20 +0000 (23:36 +0900)]
Remove arms_have_move_bindings

10 years agoauto merge of #10646 : alexcrichton/rust/issue-10645, r=luqmana
bors [Mon, 25 Nov 2013 13:46:37 +0000 (05:46 -0800)]
auto merge of #10646 : alexcrichton/rust/issue-10645, r=luqmana

This is a behavioral difference in libuv between different platforms in
different situations. It turns out that libuv on windows will immediately
allocate a buffer instead of waiting for data to be ready. What this implies is
that we must have our custom data set on the handle before we call
uv_read_start.

I wish I knew of a way to test this, but this relies to being on the windows
platform *and* reading from a true TTY handle which only happens when this is
actually attached to a terminal. I have manually verified this works.

Closes #10645

10 years agorm #[mutable_doc]
Daniel Micay [Mon, 25 Nov 2013 12:44:47 +0000 (07:44 -0500)]
rm #[mutable_doc]

10 years agoauto merge of #10644 : cmr/rust/rustdoc_cfg, r=alexcrichton
bors [Mon, 25 Nov 2013 11:42:40 +0000 (03:42 -0800)]
auto merge of #10644 : cmr/rust/rustdoc_cfg, r=alexcrichton

Closes #10623

10 years agoAdd [mut_]shift_ref/[mut_]pop_ref functions, which return a pointer to the first...
Niko Matsakis [Sat, 16 Nov 2013 22:29:19 +0000 (17:29 -0500)]
Add [mut_]shift_ref/[mut_]pop_ref functions, which return a pointer to the first/last item in the slice and modify the slice to exclude the returned item. Useful when writing iterators over mutable references.

10 years agoauto merge of #10643 : jorendorff/rust/master, r=alexcrichton
bors [Mon, 25 Nov 2013 10:27:01 +0000 (02:27 -0800)]
auto merge of #10643 : jorendorff/rust/master, r=alexcrichton

10 years agoauto merge of #10628 : huonw/rust/3614, r=alexcrichton
bors [Mon, 25 Nov 2013 09:12:36 +0000 (01:12 -0800)]
auto merge of #10628 : huonw/rust/3614, r=alexcrichton

Fixes #3614.

10 years agosyntax: parse inner attributes on impls.
Huon Wilson [Sun, 24 Nov 2013 00:48:46 +0000 (11:48 +1100)]
syntax: parse inner attributes on impls.

Fixes #3614.

10 years agoFix typo in base64 test
Steven Fackler [Mon, 25 Nov 2013 08:10:31 +0000 (00:10 -0800)]
Fix typo in base64 test

We want a 1000 element array, not a 2 element array

10 years agoauto merge of #10641 : cmr/rust/close_delims, r=alexcrichton
bors [Mon, 25 Nov 2013 07:56:46 +0000 (23:56 -0800)]
auto merge of #10641 : cmr/rust/close_delims, r=alexcrichton

Currently, the parser doesn't give any context when it finds an unclosed
delimiter and it's not EOF. Report the most recent unclosed delimiter, to help
the user along.

Closes #10636

10 years agoauto merge of #10635 : alexcrichton/rust/issue-10626, r=cmr
bors [Mon, 25 Nov 2013 06:47:10 +0000 (22:47 -0800)]
auto merge of #10635 : alexcrichton/rust/issue-10626, r=cmr

This is both useful for performance (otherwise logging is unbuffered), but also
useful for correctness. Because when a task is destroyed we can't block the task
waiting for the logger to close, loggers are opened with a 'CloseAsynchronously'
specification. This causes libuv do defer the call to close() until the next
turn of the event loop.

If you spin in a tight loop around printing, you never yield control back to the
libuv event loop, meaning that you simply enqueue a large number of close
requests but nothing is actually closed. This queue ends up never getting
closed, meaning that if you keep trying to create handles one will eventually
fail, which the runtime will attempt to print the failure, causing mass
destruction.

Caching will provide better performance as well as prevent creation of too many
handles.

Closes #10626

10 years agoRepresent C-like enums with a plain LLVM integer, not a struct.
Jed Davis [Fri, 22 Nov 2013 09:16:17 +0000 (01:16 -0800)]
Represent C-like enums with a plain LLVM integer, not a struct.

This is needed so that the FFI works as expected on platforms that don't
flatten aggregates the way the AMD64 ABI does, especially for `#[repr(C)]`.

This moves more of `type_of` into `trans::adt`, because the type might
or might not be an LLVM struct.

10 years agostd: IPv6 addresses are represented as eight groups of four HEXADECIMAL digits
Andreas Ots [Mon, 25 Nov 2013 05:55:58 +0000 (07:55 +0200)]
std: IPv6 addresses are represented as eight groups of four HEXADECIMAL digits