Commit Graph

31242 Commits

Author SHA1 Message Date
bors
ade92c6e35 auto merge of #16188 : nham/rust/immut_slice_split_at, r=brson
This operation seems common enough that it would be convenient for it to be a standard method.
2014-08-05 03:21:27 +00:00
bors
4b54110c33 auto merge of #16187 : steveklabnik/rust/gh15830, r=alexcrichton
Fixes #15830.
2014-08-05 01:41:25 +00:00
bors
6bb72600cc auto merge of #16179 : SimonPersson/rust/master, r=brson
This should solve issue 14848 for ARM.
2014-08-05 00:01:28 +00:00
bors
463d6680d1 auto merge of #16110 : alexcrichton/rust/issue-15460, r=brson
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not
actually guaranteed to link the library at all. The reason for this is that if
the external library doesn't have any referenced symbols in the object generated
by rustc, the entire library is dropped by the linker.

For dynamic native libraries, this is solved by passing -lfoo for all downstream
compilations unconditionally. For static libraries in rlibs this is solved
because the entire archive is bundled in the rlib. The only situation in which
this was a problem was when a static native library was linked to a rust dynamic
library.

This commit brings the behavior of dylibs in line with rlibs by passing the
--whole-archive flag to the linker when linking native libraries. On OSX, this
uses the -force_load flag. This flag ensures that the entire archive is
considered candidate for being linked into the final dynamic library.

This is a breaking change because if any static library is included twice in the
same compilation unit then the linker will start emitting errors about duplicate
definitions now. The fix for this would involve only statically linking to a
library once.

Closes #15460
[breaking-change]
2014-08-04 22:21:25 +00:00
Steve Klabnik
acf66b1027 Clarify Argument docs.
Fixes #15830.
2014-08-04 18:05:10 -04:00
bors
9de20198ae auto merge of #16251 : apoelstra/rust/tcp-fix, r=alexcrichton
Replacement for PR #16208 (make sockaddr* struct padding explicit) to make PR #15763 (fix nested returns) merge without breaking TCP code.
2014-08-04 20:41:25 +00:00
Andrew Poelstra
30452d4cda Change everything returning libc::sockaddr_storage to use an &mut out-ptr instead
The BSD socket code does some cast tricks with the `libc::sockaddr*`
structs, which causes useful data to be stored in struct padding.
Since Load/Store instructions do not copy struct padding, this makes
these structures dangerous to pass or return by value.

In particular, https://github.com/rust-lang/rust/issues/15763 changes
return semantics so that a Load instruction is used, breaking the TCP
code. Once this PR is merged, that one should merge without error.
2014-08-04 12:52:58 -07:00
Alex Crichton
1ae1461fbf rustc: Link entire archives of native libraries
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not
actually guaranteed to link the library at all. The reason for this is that if
the external library doesn't have any referenced symbols in the object generated
by rustc, the entire library is dropped by the linker.

For dynamic native libraries, this is solved by passing -lfoo for all downstream
compilations unconditionally. For static libraries in rlibs this is solved
because the entire archive is bundled in the rlib. The only situation in which
this was a problem was when a static native library was linked to a rust dynamic
library.

This commit brings the behavior of dylibs in line with rlibs by passing the
--whole-archive flag to the linker when linking native libraries. On OSX, this
uses the -force_load flag. This flag ensures that the entire archive is
considered candidate for being linked into the final dynamic library.

This is a breaking change because if any static library is included twice in the
same compilation unit then the linker will start emitting errors about duplicate
definitions now. The fix for this would involve only statically linking to a
library once.

Closes #15460
[breaking-change]
2014-08-04 11:02:26 -07:00
bors
efe1f7ee9e auto merge of #15986 : Florob/rust/nfKc-new, r=alexcrichton
This adds a new `Recompositions` iterator, which performs canonical composition on the result of the `Decompositions` iterator (which is canonical or compatibility decomposition). In effect this implements Unicode normalization forms C and KC.
2014-08-04 17:06:19 +00:00
bors
31590bd349 auto merge of #16235 : cakebaker/rust/rename_modules_rs_to_main_rs, r=steveklabnik 2014-08-04 14:41:18 +00:00
Daniel Hofstetter
c586bf21aa Rename modules.rs to main.rs in guide 2014-08-04 16:23:46 +02:00
bors
795f6ae829 auto merge of #16213 : huonw/rust/more-token-numbers, r=pnkfelix
Using the Show impl for Names created global symbols with names like
`"str\"str\"(1027)"`. This adjusts strings, binaries and vtables to
avoid using that impl.
2014-08-04 07:01:10 +00:00
Huon Wilson
e753dbb431 rustc: use Name numbers rather than the Show impl for constants.
Using the Show impl for Names created global symbols with names like
`"str\"str\"(1027)"`. This adjusts strings, binaries and vtables to
avoid using that impl.

Fixes #15799.
2014-08-04 16:32:35 +10:00
bors
765a23f73d auto merge of #16233 : omasanori/rust/abs_sub, r=steveklabnik
Use proper argument names and unbackquote the word "zero" because it is not an identifier.
2014-08-04 05:16:35 +00:00
OGINO Masanori
3e6edee002 num: Fix the documentation of abs_sub.
Use proper argument names and unbackquote the word "zero" because it is
not an identifier.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-04 14:04:28 +09:00
bors
d3ac386ea9 auto merge of #16139 : michaelwoerister/rust/rlib-bc-versioning, r=alexcrichton
Before this commit, the LLVM IR of exported items was simply zip-compressed and stored as an object file inside rlib archives. This commit adds a header to this "object" containing a file identifier and a format version number so the compiler can deal with changes in the way bytecode objects are stored within rlibs.

While updating the format of bytecode objects, this commit also worksaround a problem in LLDB which could not handle odd-sized objects within archives before mid-2014.

Fixes #15950.
2014-08-04 01:31:09 +00:00
bors
25741603fe auto merge of #16215 : cakebaker/rust/remove_bin_section_from_toml, r=alexcrichton
According to the [source code](https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_new.rs#L31) <code>cargo new</code> doesn't generate a <code>[[bin]]</code> section in the <code>Cargo.toml</code>, hence removing it from the example.
2014-08-03 23:46:10 +00:00
Michael Woerister
ff0fa8f1d1 Use a versioning scheme for bytecode objects in rlibs.
Before this commit, the LLVM IR of exported items was simply zip-compressed and stored as an object file inside rlib archives. This commit adds a header to this "object" containing a file identifier and a format version number so the compiler can deal with changes in the way bytecode objects are stored within rlibs.

While updating the format of bytecode objects, this commit also worksaround a problem in LLDB which could not handle odd-sized objects within archives before mid-2014.
2014-08-03 20:27:06 +02:00
bors
d34e011b8e auto merge of #16209 : tomjakubowski/rust/rustdoc-html-changes, r=alexcrichton
This PR introduces a couple of minor changes to the rustdoc html templates:

1. The `<meta name="generator" content="rustdoc">` tag now appears in API documentation as well.
2. Adds a `rustdoc` class to the top-level `<body>` tag on all HTML pages.

The second point is a nice-to-have for those who would like to apply a user stylesheet to Rust documentation regardless of where it is hosted. Easier use of user stylesheets may alleviate much of the bikeshedding of personal taste on the rustdoc styles.
2014-08-03 17:01:06 +00:00
bors
8b9ab0d912 auto merge of #16212 : huonw/rust/unicode-gitignore, r=pnkfelix 2014-08-03 14:01:06 +00:00
Daniel Hofstetter
7ba9c44b94 Remove "bin" section from Cargo.toml 2014-08-03 14:19:05 +02:00
bors
845ff6567f auto merge of #16203 : Gankro/rust/vec_flow, r=alexcrichton
fixes #16200
2014-08-03 11:36:07 +00:00
bors
9a3b25fa98 auto merge of #16202 : db48x/rust/eq-for-time-tm, r=alexcrichton 2014-08-03 09:56:07 +00:00
bors
ed264286dd auto merge of #16198 : cakebaker/rust/remove_unused_tuple_struct, r=steveklabnik 2014-08-03 08:11:10 +00:00
Huon Wilson
c41c1edf3b gitignore: Add the autogenerated/downloaded unicode data files. 2014-08-03 17:32:53 +10:00
bors
ce01b4b1b7 auto merge of #16155 : huonw/rust/Ordering-reverse, r=alexcrichton
This flips the comparison and is designed to be used when sorting etc.
2014-08-03 06:31:09 +00:00
bors
055e25acbe auto merge of #16194 : omasanori/rust/gitignore, r=alexcrichton
I also sorted lines in .gitignore. The file might include some obsoleted lines but I left.
2014-08-03 04:51:10 +00:00
bors
46d1ee72ac auto merge of #16191 : DaGenix/rust/fix-aligned-access, r=alexcrichton
When I originally wrote the read_u32v_be() and write_u32_be() functions, I didn't consider memory alignment requirements of various architectures. Unfortunately, the current implementations may result in unaligned reads and writes. This doesn't impact x86 / x86_64, but it can cause a compiler crash on ARM. This pull requests rewrites those functions to make sure that all memory access is always correctly aligned.

This fix is a little bit academic - due to the way that LLVM aligns the structures that are passed as arguments to these functions, I believe that the end result is that all memory access happens to be aligned anyway. However, there is nothing in that code that actually enforces that, at least not explicitly. The new implementations are definitely slower than the existing ones. However, I don't believe that these functions are all that significant when looking at the overall performance of the compiler. I think getting rid of some unsafe code and removing a potential portability landmine justifies a very slight decrease in raw performance.
2014-08-03 03:06:12 +00:00
Tom Jakubowski
9b44dfc764 rustdoc: Add rustdoc class to <body> tag
This allows for easier application of user stylesheets to rustdocs no
matter where they are hosted.
2014-08-02 18:59:59 -07:00
Huon Wilson
7df277115a core: add a reverse method to Ordering.
This flips the comparison and is designed to be used when sorting etc.
2014-08-03 11:50:19 +10:00
Tom Jakubowski
1c6ee3f27d rustdoc: Add generator meta tag to API docs
This is consistent with the meta tag in Markdown docs run through
rustdoc.
2014-08-02 18:21:33 -07:00
bors
12306da80c auto merge of #16189 : steveklabnik/rust/gh15494, r=alexcrichton
Fixes #15494.
2014-08-03 01:21:08 +00:00
bors
4d4eb10230 auto merge of #16186 : steveklabnik/rust/guide_cargo_new, r=alexcrichton
Two commits here: one to add `cargo new` to the guide, and a second to mention the lockfile that Cargo now generates.
2014-08-02 23:36:09 +00:00
bors
756b7b23c4 auto merge of #16180 : jbcrail/rust/fix-comments, r=steveklabnik 2014-08-02 21:51:10 +00:00
bors
147d117cff auto merge of #16169 : Gankro/rust/simple-docs, r=cmr
<strike>Adds a simple/detailed toggle to api doc pages.
Detailed mode is the current behaviour, simple mode hides all doccomment details leaving only signatures for quick browsing.
</strike>
Adds [expand all] and [collapse all] "links" to all api doc pages. All doccomments are collapsed, leaving only signatures for quick browsing.

In addition, clicking on a <strike>function name</strike> function's [toggle details] link now toggles the visibility of the associated doccomment.

--------

# [Live Build Here](http://cg.scs.carleton.ca/~abeinges/doc/std/vec/struct.Vec.html)

This is something that's been bothering me, and I've seen some people mention in IRC before. The docs are *great* if you want a full in-depth look at an API, but *awful* if you want to scan them. This provides the ability to toggle complexity freely. Interacts perfectly well with noscript, since the static page is effectively unchanged. Collapsing is just hiding divs with css.

I'm not much of a designer, so design input welcome on the actual UX for toggling.

The actual javascript is *a bit* brittle to layout changes, but it always will be without adding lots of extra junk to the actual markup, which didn't seem worth it.
2014-08-02 20:06:11 +00:00
Alexis Beingessner
d9b2e6b74f fix underflow in vec swap_remove
fixes #16200
2014-08-02 14:50:29 -04:00
Daniel Brooks
cbf407c8d0 time::Tm should impl Eq in addition to PartialEq 2014-08-02 10:25:32 -07:00
bors
432042ac14 auto merge of #16183 : brson/rust/doctitles, r=alexcrichton 2014-08-02 17:21:09 +00:00
OGINO Masanori
821262f30e Use globs to ignore target directories.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-03 02:14:37 +09:00
OGINO Masanori
5ebda6d39d Sort .gitignore.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-03 02:14:37 +09:00
Alexis Beingessner
88fe6dfa31 Add hide/show detail toggles to rustdoc
All doccomments are now collapsable via a nearby [-] button
Adds [collapse all] and [expand all] buttons to the top of all api pages
Tweaks some layout to accomadate this
2014-08-02 13:12:12 -04:00
bors
032d5c1dcd auto merge of #16181 : brson/rust/colon, r=kballard 2014-08-02 15:36:09 +00:00
Daniel Hofstetter
867d8e6356 Remove unused tuple struct 2014-08-02 17:28:42 +02:00
bors
87bc22f587 auto merge of #16177 : nham/rust/collections_15294_eq_ord, r=alexcrichton
This implements:

 - Eq and Ord for DList, RingBuf, TreeMap and TreeSet
 - FromIterator and Extendable for BitvSet

cc #15294
2014-08-02 13:51:09 +00:00
bors
5bad333fec auto merge of #16175 : EduardoBautista/rust/fix-guessing-game-appearing-early, r=steveklabnik
Solves: https://github.com/rust-lang/rust/issues/16162
2014-08-02 12:06:09 +00:00
bors
1b44c5b0eb auto merge of #16165 : tinaun/rust/newcss, r=alexcrichton
remove unneeded `pre.rust a' selector

move transform into `.test-arrow`

fixes #16138
2014-08-02 10:21:11 +00:00
bors
020b91b436 auto merge of #16164 : anguslees/rust/rfc3999, r=alexcrichton
Fixes #16158
2014-08-02 08:36:09 +00:00
bors
5793b4211c auto merge of #16163 : anguslees/rust/strptime-str, r=alexcrichton
Also modernise a few constructs in match_strs().
2014-08-02 06:51:12 +00:00
Palmer Cox
fd69365ead Rewrite read_u32v_be() and write_u32_be() to make sure that all memory access is properly aligned 2014-08-02 01:21:02 -04:00
bors
71a42807ad auto merge of #16160 : EduardoBautista/rust/use-bang-at-end-of-hello-world, r=alexcrichton
Further into the guide "Hello, world!" is used instead of "Hello, world".
2014-08-02 05:06:11 +00:00