Commit Graph

24065 Commits

Author SHA1 Message Date
klutzy
b4ad3363f3 Add test for unknown attribute lint 2013-11-26 14:05:53 +09:00
klutzy
37f2f7173b rustc: Add lint for unknown attributes 2013-11-26 14:05:50 +09:00
bors
720bcd81de 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.
2013-11-25 20:32:22 -08:00
klutzy
365c44cb2d Add tests for attribute lint 2013-11-26 13:24:11 +09:00
klutzy
87b166d94a std: Remove unused attributes
This also enables two tests properly.
2013-11-26 13:24:11 +09:00
klutzy
1f7bfac9d2 rustc: Add lint for obsolete attributes
This also moves `#[auto_{en,de}code]` checker from syntax to lint.
2013-11-26 13:13:17 +09:00
klutzy
6ff697d393 rustc: Add lint for misplaced crate attributes 2013-11-26 13:13:17 +09:00
Jed Davis
0c04a26b3f Fix the usual check-fast scoping mistake. 2013-11-25 19:42:57 -08:00
Alex Crichton
ac59888d8f 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).
2013-11-25 17:55:41 -08:00
bors
ffaee0fd96 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.
2013-11-25 17:46:32 -08:00
bors
e632c440f8 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.
2013-11-25 13:11:43 -08:00
bors
6fe6a6f9df auto merge of #10657 : sanxiyn/rust/pat, r=cmr 2013-11-25 11:56:40 -08:00
Léo Testard
ae836c1e44 Implement IterBytes for Rc<T>. 2013-11-25 19:47:09 +01:00
Léo Testard
b6ab4f2485 Add an implementation of Encodable and Decodable for Rc. This will be needed to use Rc in place of @ in libsyntax. 2013-11-25 19:45:51 +01:00
Seo Sanghyeon
9028330f39 Take &Pat in visit_pat 2013-11-26 03:22:21 +09:00
bors
679a2c042f auto merge of #10653 : thestinger/rust/meaningless, r=huonw 2013-11-25 10:16:42 -08:00
bors
f1bec46e15 auto merge of #10648 : sfackler/rust/base64-test, r=alexcrichton
We want a 1000 element array, not a 2 element array
2013-11-25 06:56:40 -08:00
Seo Sanghyeon
eb5cbfebfd Take &Pat 2013-11-25 23:37:03 +09:00
Seo Sanghyeon
cd7a9b7234 Remove arms_have_move_bindings 2013-11-25 23:36:20 +09:00
bors
fffacb34fe 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
2013-11-25 05:46:37 -08:00
Daniel Micay
07e21c3c8c rm #[mutable_doc] 2013-11-25 07:44:47 -05:00
bors
1746c0269d auto merge of #10644 : cmr/rust/rustdoc_cfg, r=alexcrichton
Closes #10623
2013-11-25 03:42:40 -08:00
bors
40439516ec auto merge of #10643 : jorendorff/rust/master, r=alexcrichton 2013-11-25 02:27:01 -08:00
bors
55201ed858 auto merge of #10628 : huonw/rust/3614, r=alexcrichton
Fixes #3614.
2013-11-25 01:12:36 -08:00
Huon Wilson
e36cb0d5c1 syntax: parse inner attributes on impls.
Fixes #3614.
2013-11-25 19:18:44 +11:00
Steven Fackler
98f47aa67d Fix typo in base64 test
We want a 1000 element array, not a 2 element array
2013-11-25 00:10:31 -08:00
bors
ce32f72f1d 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
2013-11-24 23:56:46 -08:00
bors
07ad0ccadc 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
2013-11-24 22:47:10 -08:00
Jed Davis
8624d5b186 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.
2013-11-24 22:44:48 -08:00
Andreas Ots
20233b9848 std: IPv6 addresses are represented as eight groups of four HEXADECIMAL digits 2013-11-25 08:44:04 +02:00
Alex Crichton
6acf227cc8 Set uv's custom data before uv_read_start
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
2013-11-24 21:47:13 -08:00
bors
2cc1e16ac0 auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brson
The reasons for doing this are:

* The model on which linked failure is based is inherently complex
* The implementation is also very complex, and there are few remaining who
  fully understand the implementation
* There are existing race conditions in the core context switching function of
  the scheduler, and possibly others.
* It's unclear whether this model of linked failure maps well to a 1:1 threading
  model

Linked failure is often a desired aspect of tasks, but we would like to take a
much more conservative approach in re-implementing linked failure if at all.

Closes #8674
Closes #8318
Closes #8863
2013-11-24 21:32:13 -08:00
Alex Crichton
9fe8fc8836 Cache a task's stderr logger
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
2013-11-24 21:22:19 -08:00
Alex Crichton
acca9e3834 Remove linked failure from the runtime
The reasons for doing this are:

* The model on which linked failure is based is inherently complex
* The implementation is also very complex, and there are few remaining who
  fully understand the implementation
* There are existing race conditions in the core context switching function of
  the scheduler, and possibly others.
* It's unclear whether this model of linked failure maps well to a 1:1 threading
  model

Linked failure is often a desired aspect of tasks, but we would like to take a
much more conservative approach in re-implementing linked failure if at all.

Closes #8674
Closes #8318
Closes #8863
2013-11-24 21:21:12 -08:00
Corey Richardson
6fbe2a0c8b rustdoc: pass through --cfg to rustc
Closes #10623
2013-11-24 23:33:44 -05:00
Jason Orendorff
a7c1a4a985 Fix spelling of "vacuum" in one of the abort quotes. 2013-11-24 22:29:48 -06:00
bors
ca3274336e auto merge of #10639 : jix/rust/fix_find_mut_in_trie, r=thestinger
Make TrieMap/TrieSet's find_mut check the key for external nodes.
Without this find_mut sometimes returns a reference to another key when
querying for a non-present key.
2013-11-24 20:22:03 -08:00
bors
09eca11805 auto merge of #10637 : luqmana/rust/nmt, r=cmr
There's no need for it to be @mut.
2013-11-24 19:07:44 -08:00
Corey Richardson
ab19861037 Add a note for unclosed delimiters
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
2013-11-24 21:32:38 -05:00
bors
861cced119 auto merge of #10600 : ktt3ja/rust/add-doc, r=huonw
I received a lot of helpful explanations when I was going through rustc's middle-end code. I document some of them here.
2013-11-24 16:46:50 -08:00
Kiet Tran
9a4c8da501 Add comments to ast, ast_map, ty, and pat_util 2013-11-24 18:38:41 -05:00
Luqman Aden
2431ac3080 libextra: Remove @mut from term. 2013-11-24 18:22:50 -05:00
Jannis Harder
525878fc96 std::trie: Fix find_mut for non-present keys
Make TrieMap/TrieSet's find_mut check the key for external nodes.
Without this find_mut sometimes returns a reference to another key when
querying for a non-present key.
2013-11-25 00:09:40 +01:00
bors
b3ff24adaa auto merge of #10475 : astrieanna/rust/issue8763, r=alexcrichton
Issue #8763 is about improving a particular error message.

* added case & better error message for "impl trait for module"
* added compile-fail test trait-impl-for-module.rs
* updated copyright dates
* revised compile-fail test trait-or-new-type-instead
   (the error message for the modified test is still unclear, but that's a different bug https://github.com/mozilla/rust/issues/8767)
2013-11-24 10:17:03 -08:00
Leah Hanson
e1d1ad34f7 Fix issue #8763
* added case & better error message for "impl trait for module"
* used better way to print the module
* switched from //error-pattern to //~ ERROR
* added compile-fail test trait-impl-for-module.rs
* revised compile-fail test trait-or-new-type-instead
    (the error message for the modified test is still unclear, but that's a different bug)
* added FIXME to trait-or-new-type-instead
2013-11-24 11:14:27 -06:00
bors
01b5381703 auto merge of #10634 : LeoTestard/rust/rc-eq, r=cmr 2013-11-24 08:42:35 -08:00
Léo Testard
fdac9e470c Implement cmp traits for Rc<T> and add a ptr_eq method. 2013-11-24 17:29:44 +01:00
bors
ae91b81a6f auto merge of #10633 : cmr/rust/linker_opts, r=thestinger
r? @Luqmana
2013-11-24 05:56:28 -08:00
Corey Richardson
a8a6188a1a Use -O1 for non-GNU linkers 2013-11-24 08:50:16 -05:00
klutzy
472b618248 std::rt: Fix crate_map on Win64 2013-11-24 19:15:09 +09:00