Commit Graph

20573 Commits

Author SHA1 Message Date
Luqman Aden
e82394013d librustc: Respect no_mangle attribute on statics. 2013-07-26 23:41:22 -04:00
Tim Chevalier
7079ec6e2e docs: Talk about tags that aren't versions in the "Package identifiers" section 2013-07-26 20:06:41 -07:00
bors
4989799799 auto merge of #7986 : alexcrichton/rust/raw-repr, r=brson
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, `unwrap`, 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).

This is progress on #6790. I tried to get a nice interface for a trait to implement in the raw module, but I was unable to come up with one. The hard part is that there are so many different directions to go from one way to another that it's difficult to find a pattern to follow to implement a trait with. Someone else might have some better luck though.
2013-07-26 19:46:36 -07:00
Alex Crichton
b782d42cba Deny all warnings by default in doc tests
Allow some common ones that are good for examples, however.
2013-07-26 18:04:20 -07:00
bors
5c4cd30f80 auto merge of #7979 : crnobog/rust/auxfiles-path-windows, r=cmr 2013-07-26 17:49:40 -07:00
Michael Sullivan
f5721c9334 Eliminate unused variable warnings. 2013-07-26 16:42:03 -07:00
Michael Sullivan
8582fde150 Improve the camel case warning a bit. 2013-07-26 16:42:03 -07:00
Tim Chevalier
c8780511b9 rustpkg: Don't assume a non-numeric refspec is a tag
Just pass it directly to git, without prefixing it with tags/
2013-07-26 12:31:53 -07:00
bors
44808fcee6 auto merge of #7820 : pnkfelix/rust/fill-in-some-missing-rustc-lib-dependences, r=graydon
r? anyone

Fix #8057

This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place.  (I encountered
the problem in practice; its not just theoretical.)

As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple.  (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)

When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.

In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"

----

In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:

    TSREQ$(1)_T_$(2)_H_$(3)
    $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
    $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))

with:

    SREQ$(1)_T_$(2)_H_$(3)

which is equivalent to the above, as defined in Makefile.in

----

Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.

(It could well be that I should have gone ahead and done the same in
 other cases where I saw TSREQ was missing, and put SREQ in those
 cases as well.  But this seemed like a good measure for now, without
 needing to tax my understanding of the overall makefile
 infrastructure much further.)
2013-07-26 11:34:46 -07:00
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