summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2014-03-14auto merge of #12893 : alexcrichton/rust/cfg-not, r=luqmanabors-5/+24
The two commits have the details of the two fixes
2014-03-14auto merge of #12888 : aochagavia/rust/Fix-comment, r=alexcrichtonbors-9/+3
The old comment of as_mut_slice() did not describe the function correctly. The new one does. Also refactored option::iter() and option::mut_iter() to use as_ref() and as_mut() instead of match.
2014-03-14auto merge of #12878 : crabtw/rust/mips, r=alexcrichtonbors-43/+38
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure. By the way, the patched LLVM doesn't have MIPS split stack anymore. Should I file an issue about that?
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-869/+311
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-14auto merge of #12869 : thestinger/rust/cmp, r=brsonbors-9/+7
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-14cmp: switch `min` and `max` to `TotalOrd`Daniel Micay-9/+7
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-14debuginfo: Make limited-debuginfo test case more robust against GDB output ↵Michael Woerister-4/+4
variations. Fixes issue #12787.
2014-03-14std: Fix backtraces on arm linuxAlex Crichton-2/+13
On android, libgcc is missing the _Unwind_GetIP symbol because it's defined as a macro. This is the same case for arm linux, so this commit adds the necessary cfgs in place to use the "expanded macro" in rust for arm linux.
2014-03-14rustc: Fix cfg(not(a, b)) to be not(a && b)Alex Crichton-3/+11
Previously, the cfg attribute `cfg(not(a, b))` was translated to `(!a && !b)`, but this isn't very useful because that can already be expressed as `cfg(not(a), not(b))`. This commit changes the translation to `!(a && b)` which is more symmetrical of the rest of the `cfg` attribute. Put another way, I would expect `cfg(clause)` to be the opposite of `cfg(not(clause))`, but this is not currently the case with multiple element clauses.
2014-03-14Refactored iter and mut_iteraochagavia-8/+2
Replaced match by self.as_ref() and self.as_mut()
2014-03-14auto merge of #12880 : tedhorst/rust/master, r=alexcrichtonbors-8/+8
Fix a test that was missed in the chan/port renaming (PR #12815). This was missed because it is skipped on linux and windows, and the mac bots were moving at the time the PR landed.
2014-03-14Fixed comment of as_mut_slice (libstd/option.rs)aochagavia-1/+1
The old comment did not describe the function correctly
2014-03-14auto merge of #12764 : Kimundi/rust/partial_typehint, r=nikomatsakisbors-11/+236
# Summary This patch introduces the `_` token into the type grammar, with the meaning "infer this type". With this change, the following two lines become equivalent: ``` let x = foo(); let x: _ = foo(); ``` But due to its composability, it enables partial type hints like this: ``` let x: Bar<_> = baz(); ``` Using it on the item level is explicitly forbidden, as the Rust language does not enable global type inference by design. This implements the feature requested in https://github.com/mozilla/rust/issues/9508. # Things requiring clarification - The change to enable it is very small, but I have only limited understanding of the related code, so the approach here might be wrong. - In particular, while this patch works, it does so in a way not originally intended according to the code comments. - This probably needs more tests, or rather feedback for which tests are still missing. - I'm unsure how this interacts with lifetime parameters, and whether it is correct in regard to them. - Partial type hints on the right side of `as` like `&foo as *_` work in both a normal function contexts and in constexprs like `static foo: *int = &'static 123 as *_`. The question is whether this should be allowed in general. # Todo for this PR - The manual and tutorial still needs updating. # Bugs I'm unsure how to fix - Requesting inference for the top level of the right hand side of a `as` fails to infer correctly, even if all possible hints are given: ``` .../type_hole_1.rs:35:18: 35:22 error: the type of this value must be known in this context .../type_hole_1.rs:35 let a: int = 1u32 as _; ^~~~ ```
2014-03-14Added support for type placeholders (explicit requested typeMarvin Löbel-11/+236
inference in a type with `_` ). This enables partial type inference.
2014-03-14auto merge of #12875 : alexcrichton/rust/demangle-more-things, r=brsonbors-8/+60
Add some more infrastructure support for demangling `$`-sequences, as well as fixing demangling of closure symbol names if there's more than one closure in a function.
2014-03-14auto merge of #12874 : huonw/rust/printier-rustc, r=alexcrichtonbors-17/+32
rustc: make stack traces print for .span_bug/.bug. Previously a call to either of those to diagnostic printers would defer to the `fatal` equivalents, which explicitly silence the stderr printing, including a stack trace from `RUST_LOG=std::rt::backtrace`. This splits the bug printers out to their own diagnostic type so that things work properly. Also, this removes the `Ok(...)` that was being printed around the subtask's stderr output.
2014-03-14auto merge of #12871 : aochagavia/rust/Optimize-while_some, r=alexcrichtonbors-3/+6
The old 'while' needed to match 2 times for each iteration. With the new 'loop' there is just one match needed. I have also replaced 'blk' by 'f' to be more consistent with parameter names in other functions that are implemented for Option<T>
2014-03-14auto merge of #12867 : alexcrichton/rust/issue-12860, r=thestingerbors-31/+99
This switches a "tail call" to a manual loop to get around LLVM not optimizing to a tail call. Close #12860
2014-03-14auto merge of #12864 : huonw/rust/hash-docs, r=alexcrichtonbors-53/+53
collections: move hashmap's example to the struct. Most people go straight to the struct, not looking at the module, so the example was well hidden.
2014-03-13auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestingerbors-3/+79
lint: add lint for use of a `~[T]`. This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13fix a test that was missed in the chan/port renaming (PR #12815)Ted Horst-8/+8
2014-03-13auto merge of #12855 : alexcrichton/rust/shutdown, r=brsonbors-0/+78
This is something that is plausibly useful, and is provided by libuv. This is not currently surfaced as part of the `TcpStream` type, but it may possibly appear in the future. For now only the raw functionality is provided through the Rtio objects.
2014-03-14fix MIPS targetJyun-Yan You-43/+38
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-03-13auto merge of #12798 : pczarn/rust/inline-asm, r=alexcrichtonbors-54/+182
## read+write modifier '+' This small sugar was left out in the original implementation (#5359). When an output operand with the '+' modifier is encountered, we store the index of that operand alongside the expression to create and append an input operand later. The following lines are equivalent: ``` asm!("" : "+m"(expr)); asm!("" : "=m"(expr) : "0"(expr)); ``` ## misplaced options and clobbers give a warning It's really annoying when a small typo might change behavior without any warning. ``` asm!("mov $1, $0" : "=r"(x) : "r"(8u) : "cc" , "volatile"); //~^ WARNING expected a clobber, but found an option ``` ## liveness Fixed incorrect order of propagation. Sometimes it caused spurious warnings in code: `warning: value assigned to `i` is never read, #[warn(dead_assignment)] on by default` ~~Note: Rebased on top of another PR. (uses other changes)~~ * [x] Implement read+write * [x] Warn about misplaced options * [x] Fix liveness (`dead_assignment` lint) * [x] Add all tests
2014-03-14std: render the vec_ng docs.Huon Wilson-2/+4
These are wildly incomplete, but having something there is better than nothing, e.g. so that people know it exists, and many of the functions behaviour can be guessed from the name or by checking the source: it's knowing they exist at all that's the hard part.
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-1/+75
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13rustc: Prevent collisions in names of closuresAlex Crichton-1/+6
This commit goes back to using `gensym` to generate unique tokens to put into the names of closures, allowing closures to be able to get demangled in backtraces. Closes #12400
2014-03-13std: Demangle more escapes in backtracesAlex Crichton-7/+54
The rust compiler not only outputs symbols in the form that C++ does, but it also mangle symbols like '&' and '~' to special compiler-defined escape sequences. For convenience, these symbols are demangled when printing backtraces.
2014-03-14rustc: make stack traces print for .span_bug/.bug.Huon Wilson-17/+32
Previously a call to either of those to diagnostic printers would defer to the `fatal` equivalents, which explicitly silence the stderr printing, including a stack trace from `RUST_LOG=std::rt::backtrace`. This splits the bug printers out to their own diagnostic type so that things work properly. Also, this removes the `Ok(...)` that was being printed around the subtask's stderr output.
2014-03-13io: Bind to shutdown() for TCP streamsAlex Crichton-0/+78
This is something that is plausibly useful, and is provided by libuv. This is not currently surfaced as part of the `TcpStream` type, but it may possibly appear in the future. For now only the raw functionality is provided through the Rtio objects.
2014-03-13Fix and improve inline assembly.Piotr Czarnecki-54/+182
Read+write modifier Some documentation in asm.rs rpass and cfail tests
2014-03-13auto merge of #12815 : alexcrichton/rust/chan-rename, r=brsonbors-1891/+1736
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13Refactored while_some (libstd/option.rs)aochagavia-3/+6
The old 'while' needed to match 2 times for each iteration. With the new 'loop' there is just one match needed. I have also replaced 'blk' by 'f' to be more consistent with parameter names in other functions that are implemented for Option
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-1891/+1736
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13auto merge of #12573 : lbonn/rust/unrecurs, r=alexcrichtonbors-11/+85
As mentioned in #6109, ```mkdir_recursive``` doesn't really need to use recursive calls, so here is an iterative version. The other points of the proposed overhaul (renaming and existing permissions) still need to be resolved. I also bundled an iterative ```rmdir_recursive```, for the same reason. Please do not hesitate to provide feedback on style as this is my first code change in rust.
2014-03-13auto merge of #12561 : pzol/rust/char-case, r=alexcrichtonbors-1427/+1194
Added common and simple case folding, i.e. mapping one to one character mapping. For more information see http://www.unicode.org/faq/casemap_charprop.html Removed auto-generated dead code which wasn't used.
2014-03-13collections: Don't recurse in hashmap robin_hoodAlex Crichton-31/+99
This switches a "tail call" to a manual loop to get around LLVM not optimizing to a tail call. Close #12860
2014-03-13auto merge of #12238 : ktt3ja/rust/lifetime-error-msg, r=nikomatsakisbors-6/+772
For the following code snippet: ```rust struct Foo { bar: int } fn foo1(x: &Foo) -> &int { &x.bar } ``` This PR generates the following error message: ```rust test.rs:2:1: 4:2 note: consider using an explicit lifetime parameter as shown: fn foo1<'a>(x: &'a Foo) -> &'a int test.rs:2 fn foo1(x: &Foo) -> &int { test.rs:3 &x.bar test.rs:4 } test.rs:3:5: 3:11 error: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements test.rs:3 &x.bar ^~~~~~ ``` Currently it does not support methods.
2014-03-13auto merge of #12852 : itdaniher/rust/master, r=alexcrichtonbors-1/+1
This enables the lowering of llvm 64b intrinsics to hardware ops, resolving issues around `__kernel_cmpxchg64` on older kernels on ARM devices, and also enables use of the hardware floating point unit, resolving https://github.com/mozilla/rust/issues/10482.
2014-03-13auto merge of #12849 : nick29581/rust/doubles, r=alexcrichtonbors-0/+1
2014-03-13auto merge of #12610 : eddyb/rust/deref-now-auto, r=nikomatsakisbors-1100/+1632
Enables the dereference overloads introduced by #12491 to be applied wherever automatic dereferences would be used (field accesses, method calls and indexing).
2014-03-13Tweak commentsNiko Matsakis-12/+11
2014-03-13compile-fail: Beef up borrowck test to include some scenarios where we ↵Niko Matsakis-1/+21
borrow mutably twice in a row
2014-03-13Region + borrow checker support and tests for overloaded autoderef.Eduard Burtescu-24/+540
2014-03-13Apply @nikomatsakis' nits and comments patch.Eduard Burtescu-83/+149
2014-03-13Introduce a common recursion limit for auto-dereference and monomorphization.Eduard Burtescu-58/+56
2014-03-13Implement automatic overloaded dereference.Eduard Burtescu-921/+871
Closes #7141.
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-76/+59
Rc<RefCell<T>>.
2014-03-13auto merge of #12845 : eddyb/rust/vec-no-drop-flag, r=thestingerbors-0/+50
2014-03-13collections: move hashmap's example to the struct.Huon Wilson-53/+53
Most people go straight to the struct, not looking at the module, so the example was well hidden.