Commit Graph

20564 Commits

Author SHA1 Message Date
Alex Crichton
5aaaca0c6a Consolidate raw representations of rust values
This moves the raw struct layout of closures, vectors, boxes, and strings into a
new `unstable::raw` module. This is meant to be a centralized location to find
information for the layout of these values.

As safe method, `repr`, is provided to convert a rust value to its raw
representation. Unsafe methods to convert back are not provided because they are
rarely used and too numerous to write an implementation for each (not much of a
common pattern).
2013-07-26 09:53:03 -07:00
bors
544ef6cf35 auto merge of #8041 : dotdash/rust/const_if_else, r=huonw 2013-07-26 09:46:49 -07:00
bors
15ab6fde7f auto merge of #8039 : Xazax-hun/rust/master, r=brson
Added some more atomic operations. https://github.com/mozilla/rust/issues/7421
2013-07-26 08:02:06 -07:00
Philipp Brüschweiler
2a18c29d67 syntax: fix span for obsolete extern visibility error 2013-07-26 16:02:34 +02:00
bors
382b037252 auto merge of #8037 : graydon/rust/issue-6416, r=cmr
Errors only turn into failures in the parser when you force them.
2013-07-26 06:13:53 -07:00
bors
4c4cf003ea auto merge of #8031 : graydon/rust/emacs-mode-rewrite, r=catamorphism
The previous mode did a lot of very manual char-at-a-time parsing and was quite fragile and difficult to maintain. I talked to Marijn and he suggested I'd have better luck just rewriting it from scratch. This is the result of that effort; it seems to be faster, a bit easier on the eyes and more-or-less as well behaved when indenting. The algorithm is a bit different I suspect (it was hard to tell the previous one) but I tried to keep it simple and pleasant-looking.
2013-07-26 02:04:50 -07:00
Luqman Aden
df67942dcc libstd: Tests for {peer, socket}_name. 2013-07-26 05:02:53 -04:00
bors
5109ce691c auto merge of #7924 : alexcrichton/rust/opt-lang-xcrate2, r=thestinger
This is a reopening of #7874
2013-07-25 23:49:40 -07:00
Alex Crichton
09e49a8e6c Allow linking against crates with #[no_std]
Previously having optional lang_items caused an assertion failure at
compile-time, and then once that was fixed there was a segfault at runtime of
using a NULL crate-map (crates with no_std)
2013-07-25 19:23:17 -07:00
Luqman Aden
037bf3757c libstd: Implement some missing udp methods. 2013-07-25 22:21:46 -04:00
Luqman Aden
a5c6b85091 libstd: Implement some missing tcp methods. 2013-07-25 19:42:19 -04:00
Luqman Aden
005ea3b173 libstd: Add ToStr impl for IpAddr. 2013-07-25 18:27:18 -04:00
Steven Fackler
feb18fe8da Added default impls for container methods
A couple of implementations of Container::is_empty weren't exactly
self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-25 15:17:30 -07:00
Michael Woerister
d54615528c debuginfo: Fixed a few things for PR. 2013-07-25 23:05:56 +02:00
bors
0012b5008b auto merge of #8030 : thestinger/rust/iterator, r=huonw 2013-07-25 13:49:43 -07:00
Keegan McAllister
d0f54a5cfb Warn about unused RUST_LOG specs 2013-07-25 13:24:32 -07:00
Luqman Aden
d6e1a6b237 libstd: Get rid of duplication in {peer, socket}_name and remove extra *. 2013-07-25 15:50:19 -04:00
bors
b1f5b1ba5f auto merge of #8029 : emillon/rust/issue-6804, r=cmr
Hi,

As noted in #6804, a pattern that contains `NaN` will never match because `NaN != NaN`. This adds a warning for such a case. The first commit handles the basic case and the second one generalizes it to more complex patterns using `walk_pat`.
2013-07-25 10:55:47 -07:00
Michael Woerister
af7b87f69d debuginfo: Minor cleanup now possible with new snapshot. 2013-07-25 19:47:03 +02:00
Michael Woerister
02a0f2822e debuginfo: Support for destructured function arguments. 2013-07-25 19:47:03 +02:00
Michael Woerister
c9e51cef12 debuginfo: Support for function arguments. (WIP) 2013-07-25 19:47:03 +02:00
Michael Woerister
203f96f71d debuginfo: Implemented support for destructured locals.
Conflicts:
	src/librustc/middle/trans/debuginfo.rs
	src/test/debug-info/destructured-local.rs
2013-07-25 19:47:03 +02:00
Björn Steinbrink
7078ab7324 Generate branchless code when "if" can be evaluated at compile time
We already avoid the conditional branch, but still have an
unconditional branch in the generated code. Remove it.
2013-07-25 17:03:46 +02:00
Etienne Millon
f929a49d9c NaN patterns: indicate that is_NaN is a method 2013-07-25 16:40:59 +02:00
bors
baa649ede6 auto merge of #8027 : nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-1, r=pcwalton
Small step towards #4846. r? @msullivan
2013-07-25 07:37:45 -07:00
bors
4cf30729f0 auto merge of #8026 : poiru/rust/issue-8024, r=alexcrichton
Closes #8024.
2013-07-25 05:22:44 -07:00
Björn Steinbrink
e0685e22a3 Make omission of impossible if-else branches work with constants
Until now, we only optimized away impossible branches when there is a
literal true/false in the code. But since the LLVM IR builder already does
constant folding for us, we can trivially expand that to work with
constants as well.

Refs #7834
2013-07-25 12:17:31 +02:00
bors
906264b50f auto merge of #8015 : msullivan/rust/default-methods, r=nikomatsakis
Lots of changes to vtable resolution, handling of super/self method calls in default methods. Fix a lot of trait inheritance bugs.

r? @nikomatsakis
2013-07-25 03:07:44 -07:00
Björn Steinbrink
75a08622e8 Add a function to check whether a ValueRef is a constant 2013-07-25 12:06:57 +02:00
Luqman Aden
e2bb32bea1 libstd: Handle IPv4-Mapped/Compatible IPv6 addresses. 2013-07-25 05:57:52 -04:00
Luqman Aden
ac40d5323d libstd: Fix errors when rtdebug! is not a noop. 2013-07-25 05:57:52 -04:00
Luqman Aden
61e741cf71 libstd: Implement {peer, socket}_name for new rt tcp & udp. 2013-07-25 05:57:52 -04:00
Gábor Horváth
7cc8f4bae0 Added some more atomic operations. 2013-07-25 10:46:31 +02:00
Graydon Hoare
c3417b88aa syntax: Fix #6416 by aborting on errors after test parse. 2013-07-25 01:06:38 -07:00
bors
b30a16c9ae auto merge of #8020 : pnkfelix/rust/fsk-issue7898-dont-propagate-cfg-debug-to-tests, r=huonw
Remove directive, if present, from CFG_RUSTC_FLAGS.

r? @huonw 

Fix #7898.

(One alternative tack is to build up distinct CFG_TEST_RUSTC_FLAGS
alongside CFG_RUSTC_FLAGS; but currently debug is the only --cfg flag
ever added to CFG_RUSTC_FLAGS; the other contents of CFG_RUSTC_FLAGS
are a mix of -Z flags and a few other switches like O, which seem to
make sense to propogate to the tests.)
2013-07-25 00:46:37 -07:00
Alex Crichton
7fd23e4fe2 Convert uses of transmute which don't need it 2013-07-24 23:12:28 -07:00
bors
ba9c3ebc02 auto merge of #8000 : kemurphy/rust/enum-intvar, r=huonw 2013-07-24 22:04:38 -07:00
Kevin Murphy
6f253419ee Move/delete old tests that change behavior 2013-07-25 00:00:56 -04:00
Kevin Murphy
e9233d55c8 Add test for uint and negative literals as discriminants 2013-07-24 23:54:40 -04:00
Kevin Murphy
1c3dc294ce Allow uint discriminants and store them as such
Infers type of constants used as discriminants and ensures they are
integral, instead of forcing them to be a signed integer.

Also, stores discriminant values as uint instead of int interally and
deals with related fallout.

Fixes issue #7994
2013-07-24 23:54:40 -04:00
Michael Sullivan
f37c7cd306 Fix vtable resolution for self to search supertraits. Closes #7661. 2013-07-24 20:07:51 -07:00
bors
467d381d3a auto merge of #7931 : blake2-ppc/rust/chain-mut-ref, r=pcwalton
First, clean up the uses of "None" and "Some" to always use consistent title case matching the variant names.

Add .chain_mut_ref() which is a missing method. A use case example for this method is extraction of an optional value from an Option\<Container\> value.
2013-07-24 19:25:38 -07:00
Tim Chevalier
bfac584a03 rustpkg: Handle non-numeric versions; some cleanup
Package IDs can now be of the form a/b/c#FOO, where (if a/b/c is
a git repository) FOO is any tag in the repository. Non-numeric
tags only match against package IDs with the same tag, and aren't
compared linearly like numeric versions.

While I was at it, refactored the code that calls `git clone`,
and segregated build output properly for different packages.
2013-07-24 18:42:14 -07:00
Tim Chevalier
d7c4a10fba rustpkg: Clean up usage messages for install 2013-07-24 18:39:25 -07:00
Graydon Hoare
581b3db3b3 rewrite rust-mode to use font-lock-mode and emacs builtin syntax analysis 2013-07-24 17:11:04 -07:00
bors
4a726f0573 auto merge of #8006 : emillon/rust/issue-6060, r=pcwalton
Hello,

I made a tiny change to `tidy.py` so that it uses a regexp to find `// NOTE` comments. I could not find an easy way to write an automated test for this but if this is needed and possible I'd be happy to write one.
Please note that it also removes extra empty lines that appear after each of these warnings (I believe that there were not wanted).

On the performance side, `make tidy` is now a bit slower (running it 10 times in a row takes 71s on my machine, 65s before) but I don't think that it is performance sensitive.

Thanks!
2013-07-24 16:49:36 -07:00
Daniel Micay
ba41755069 improve container/iterator tutorial 2013-07-24 18:44:16 -04:00
Daniel Micay
4517e39125 rm default method lint
default methods are enabled by default, so there's not much point in
keeping around a lint to report them as being experimental
2013-07-24 18:44:16 -04:00
Daniel Micay
ce1db94647 rm unused upcall_exchange_free 2013-07-24 18:44:16 -04:00
Etienne Millon
fdd71bece2 Generalize NaN pattern detection using walk_pat 2013-07-24 23:20:57 +02:00