Commit Graph

21888 Commits

Author SHA1 Message Date
bors
b161e09e03 auto merge of #8977 : pnkfelix/rust/fsk-followup-on-6009-rebased, r=alexcrichton
Fix #6009.  Rebased version of #8970.  Inherits review from alexcrichton.
2013-09-04 16:20:46 -07:00
bors
6c13b0f4f6 auto merge of #8935 : blake2-ppc/rust/reader-bytes, r=brson
An iterator that simply calls `.read_bytes()` each iteration.

I think choosing to own the Reader value and implementing Decorator to
allow extracting it is the most generically useful. The Reader type
variable can of course be some kind of reference type that implements
Reader.

In the generic form the `Bytes` iterator is well behaved itself and does not read ahead.
It performs abysmally on top of a FileStream, and much better if a buffering reader is inserted inbetween.
2013-09-04 14:20:46 -07:00
bors
60fba4d7d6 auto merge of #8880 : fhahn/rust/issue_8703, r=brson
I've started working on #8703.

RUST_LOG="::help" should work, I hope I'll be able to finish the rest this weekend.
2013-09-04 13:05:50 -07:00
bors
45c3ca72bc auto merge of #8855 : michaelwoerister/rust/captured_vars, r=jdm
This pull request includes
* support for variables captured in closures*,
* a fix for issue #8512: arguments of non-immediate type (structs, tuples, etc) passed by value can now be accessed correctly in GDB. (I managed to fix this by using `llvm::DIBuilder::createComplexVariable()`. ~~However, I am not sure if this relies on unstable implementation details of LLVM's debug info handling. I'll try to clarify this on the LLVM mailing list~~).
* simplification of the `debuginfo` module's public interface: the caller of functions like `create_local_var_metadata()` doesn't have to know and catch all cases when it mustn't call the function,
* a cleanup refactoring with unified handling for locals, [self] arguments, captured variables, and match bindings,
* and proper span information for self arguments.

\* However, see comment at 1d916ace13/src/test/debug-info/var-captured-in-nested-closure.rs (L62) . This is the same problem as with the fix for issue #8512 above: We are probably using `llvm.dbg.declare` in an unsupported way that works today but might not work after the next LLVM update.

Cheers,
Michael

Fixes #8512
Fixes #1341
2013-09-04 11:55:52 -07:00
Michael Woerister
5b94ae93f3 debuginfo: Fixed some merge fallout 2013-09-04 19:31:13 +02:00
bors
d1f90556f2 auto merge of #8901 : adridu59/rust/issue-8511, r=huonw
Android has no /tmp partition, cf. #8511.
2013-09-04 10:00:56 -07:00
Michael Woerister
c49eb075db debuginfo: Much improved handling of captured variables and by-value arguments. 2013-09-04 18:38:46 +02:00
Michael Woerister
e0b63b0e2a debuginfo: Fixed some merge fallout 2013-09-04 18:38:46 +02:00
Michael Woerister
6b2df76c24 debuginfo: Always copy args to allocas if debuginfo is enabled 2013-09-04 18:38:46 +02:00
Michael Woerister
c19f493129 debuginfo: Added test cases for structs, tuples, enums, etc passed by value.
Also updated documentation comments in debuginfo and renamed DebugContext to CrateDebugContext.
2013-09-04 18:38:46 +02:00
Michael Woerister
30375ccb30 debuginfo: Support for by-value arguments (still excluding some cases of self arguments) 2013-09-04 18:38:46 +02:00
Michael Woerister
b81ea86530 debuginfo: Support for variables captured in closures and closure type descriptions. 2013-09-04 18:38:46 +02:00
Felix S. Klock II
c326ff0c28 Another followup on #6009.
Odd that my earlier make checks did not catch this.
2013-09-04 18:08:02 +02:00
adridu59
50d4714d85 libstd/os: set tmp dir to /data/tmp on Android
Android has no /tmp partition, return /data/tmp instead. Cf. #8511.
2013-09-04 18:07:46 +02:00
bors
91922f04f8 auto merge of #8966 : FlaPer87/rust/issue/7473, r=bblum
Current access methods are nestable and unsafe. This patch renames
current methods implementation - prepends unsafe_ - and implements 2 new
methods that are both safe and un-nestable.

Fixes #7473
2013-09-04 08:50:57 -07:00
bors
67555d9bd4 auto merge of #8956 : thestinger/rust/test, r=huonw 2013-09-04 06:20:57 -07:00
Florian Hahn
e38739bb44 Convert rust_log.cpp to Rust, closes #8703 2013-09-04 14:18:56 +02:00
bors
51331f61f3 auto merge of #8974 : thestinger/rust/char, r=huonw
Closes #7609
2013-09-04 05:10:55 -07:00
Daniel Micay
62a3434529 stop treating char as an integer type
Closes #7609
2013-09-04 08:07:56 -04:00
Daniel Micay
28f36253b2 add test for tydesc name 2013-09-04 07:56:11 -04:00
bors
787f4c986c auto merge of #8976 : alexcrichton/rust/issue-5425, r=pnkfelix
Closes #5425
2013-09-04 03:20:56 -07:00
bors
142dab4e4f auto merge of #8960 : Kimundi/rust/master, r=alexcrichton
Changed ToStr impl for Ascii
Added ToStr impl for char
2013-09-04 01:35:58 -07:00
Alex Crichton
2c573e933b Don't die with an ICE on a blank library name
Closes #5425
2013-09-04 01:09:56 -07:00
Felix S. Klock II
6fbb64acbe Make non-pub condition! expand to non-pub mod. Fix #6009. 2013-09-04 10:05:10 +02:00
Felix S. Klock II
83e19d2ead Added explicit pub to several conditions. Enables completion of #6009. 2013-09-04 10:03:47 +02:00
bors
b659fe3e50 auto merge of #8951 : chris-morgan/rust/vim-update-highlighting, r=alexcrichton
Several changes with appropriate commit messages to explain them.

The final two commits, highlighting everything in the prelude, may be a little controversial. I think it's the sensible way forward with it.
2013-09-04 00:25:56 -07:00
Flaper Fesp
d0ad251376 Use MuextArc and RWArc in docstrings 2013-09-04 09:14:56 +02:00
bors
64ff315584 auto merge of #8950 : sanxiyn/rust/cross-xfail, r=brson 2013-09-03 23:15:56 -07:00
bors
1611e7b72a auto merge of #8943 : alexcrichton/rust/issue-8904, r=brson
We already do this for libstd tests automatically, and compiletest runs into the
same problems where when forking lots of processes lots of file descriptors are
created. On OSX we can use specific syscalls to raise the limits, in this
situation, though.

Closes #8904
2013-09-03 22:05:59 -07:00
bors
523701aad0 auto merge of #8942 : novalis/rust/fmt, r=alexcrichton 2013-09-03 20:56:19 -07:00
novalis
5977376b46 Test and document escaping on format!() 2013-09-03 23:39:58 -04:00
Chris Morgan
9f6180413d Silence fo+=j error for users of Vim < 7.3.541. 2013-09-04 13:33:40 +10:00
bors
383073883f auto merge of #8963 : jmgrosen/rust/issue-8881, r=alexcrichton 2013-09-03 19:46:42 -07:00
Marvin Löbel
8d610e1d2d Added ToStr impl for char
Changed ToStr impl for Ascii
2013-09-04 03:19:52 +02:00
Flaper Fesp
c0aa62c872 Fixed docs and styles 2013-09-04 02:28:16 +02:00
Flaper Fesp
408367ba6d Add a safe implementation of MutexArc::access* methods
Current access methods are nestable and unsafe. This patch renames
current methods implementation - prepends unsafe_ - and implements 2 new
methods that are both safe and un-nestable.

Fixes #7473
2013-09-04 01:13:56 +02:00
Flaper Fesp
b22861d16d Rename MutexArc access methods to unsafe_access 2013-09-04 01:12:23 +02:00
jmgrosen
4a18d46130 Fixes #8881. condition! imports parent's pub identifiers 2013-09-03 16:11:00 -07:00
bors
3c4e943881 auto merge of #8954 : anasazi/rust/tcp-acceptor, r=catamorphism
The Listener trait takes two type parameters, the type of connection and the type of Acceptor,
and specifies only one method, listen, which consumes the listener and produces an Acceptor.

The Acceptor trait takes one type parameter, the type of connection, and defines two methods.
The accept() method waits for an incoming connection attempt and returns the result.
The incoming() method creates an iterator over incoming connections and is a default method.

Example:

```rust
let listener = TcpListener.bind(addr); // Bind to a socket
let acceptor = listener.listen(); // Start the listener
for stream in acceptor.incoming() {
    // Process incoming connections forever (a failure will kill the task).
}
```

Closes #8689
2013-09-03 14:56:22 -07:00
bors
b4ff0bca4c auto merge of #8921 : huonw/rust/stability, r=brson
Significant progress on #6875, enough that I'll open new bugs and turn that into a metabug when this lands.

Description & example in the commit message.
2013-09-03 12:22:16 -07:00
blake2-ppc
913d1b48ad rt::io: Rename Bytes to ByteIterator and add note about iteration 2013-09-03 20:06:45 +02:00
bors
7ee90a002a auto merge of #8934 : sfackler/rust/bufreader, r=brson 2013-09-03 11:01:17 -07:00
bors
dee9d7f97f auto merge of #8945 : alexcrichton/rust/ifmt-dont-move, r=thestinger 2013-09-03 09:50:58 -07:00
Chris Morgan
2bc408f3e3 Update highlighting for prelude changes. 2013-09-04 02:38:41 +10:00
Chris Morgan
c4b180aa9c Highlight everything in the prelude in Vim.
This is a rather more extensive change than the last, but *ever* so much
easier to maintain reasonably, as there's then something to track
directly.
2013-09-04 02:34:23 +10:00
Chris Morgan
afbf908ff4 Update a handful of keywords highlighted in Vim.
I added a few and removed a few and corrected a couple, all with
reference to the prelude. It ends up a slightly arbitrary decision
precisely what ends up in and what doesn't, unfortunately.
2013-09-04 02:34:23 +10:00
Chris Morgan
15f05dc581 Modernise some Vim syntax highlighting.
- Remove highlighting of ``L"..."`` (obsolete syntax)
- Remove backslash at end of line being a line continuation always
  (obsolete syntax; this only affects comments, actually)
- Add highlighting for backslash at end of line and leading whitespace
  on the following line inside a string (a genuine line continuation)
2013-09-04 02:34:22 +10:00
bors
c14daba3b2 auto merge of #8947 : thestinger/rust/name, r=huonw
Storing the type name in the `tydesc` aims to avoid the need to pass a type name in almost every single visitor method.

It would likely be much saner for `repr` to simply be passed the `TyDesc` corresponding to the function or just the type name, but this is good enough for now.
2013-09-03 08:06:04 -07:00
Huon Wilson
506f69aed7 Implement support for indicating the stability of items.
There are 6 new compiler recognised attributes: deprecated, experimental,
unstable, stable, frozen, locked (these levels are taken directly from
Node's "stability index"[1]). These indicate the stability of the
item to which they are attached; e.g. `#[deprecated] fn foo() { .. }`
says that `foo` is deprecated.

This comes with 3 lints for the first 3 levels (with matching names) that
will detect the use of items marked with them (the `unstable` lint
includes items with no stability attribute). The attributes can be given
a short text note that will be displayed by the lint. An example:

    #[warn(unstable)]; // `allow` by default

    #[deprecated="use `bar`"]
    fn foo() { }

    #[stable]
    fn bar() { }

    fn baz() { }

    fn main() {
        foo(); // "warning: use of deprecated item: use `bar`"

        bar(); // all fine

        baz(); // "warning: use of unmarked item"
    }

The lints currently only check the "edges" of the AST: i.e. functions,
methods[2], structs and enum variants. Any stability attributes on modules,
enums, traits and impls are not checked.

[1]: http://nodejs.org/api/documentation.html
[2]: the method check is currently incorrect and doesn't work.
2013-09-04 00:12:27 +10:00
bors
1ac8e8885b auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonw
The message of the first commit explains (edited for changed trait name):

The trait `ExactSize` is introduced to solve a few small niggles:

* We can't reverse (`.invert()`) an enumeration iterator
* for a vector, we have `v.iter().position(f)` but `v.rposition(f)`.
* We can't reverse `Zip` even if both iterators are from vectors

`ExactSize` is an empty trait that is intended to indicate that an
iterator, for example `VecIterator`, knows its exact finite size and
reports it correctly using `.size_hint()`. Only adaptors that preserve
this at all times, can expose this trait further. (Where here we say
finite for fitting in uint).

---

It may seem complicated just to solve these small "niggles",
(It's really the reversible enumerate case that's the most interesting)
but only a few core iterators need to implement this trait.

While we gain more capabilities generically for some iterators,
it becomes a tad more complicated to figure out if a type has
the right trait impls for it.
2013-09-03 06:56:05 -07:00