Commit Graph

31354 Commits

Author SHA1 Message Date
Aaron Turon
68bde0a073 stabilize atomics (now atomic)
This commit stabilizes the `std::sync::atomics` module, renaming it to
`std::sync::atomic` to match library precedent elsewhere, and tightening
up behavior around incorrect memory ordering annotations.

The vast majority of the module is now `stable`. However, the
`AtomicOption` type has been deprecated, since it is essentially unused
and is not truly a primitive atomic type. It will eventually be replaced
by a higher-level abstraction like MVars.

Due to deprecations, this is a:

[breaking-change]
2014-08-04 16:03:21 -07: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
Brian Anderson
bcdc8fb812 rustdoc: Just "stability" instead of "stability dashboard"
The words "stability dashboard" take up too much space on small screens.
2014-08-04 14:37:07 -07:00
Brian Anderson
57e53d5c2f rustdoc: Emit keywords for all crate pages
cc #12466
2014-08-04 14:37:07 -07:00
Brian Anderson
2b0a15494a rustdoc: Put field instantiation in declaration order.
cc #12466
2014-08-04 14:37:06 -07:00
Brian Anderson
08d44f5512 rustdoc: Use more descriptive description metadata.
This text appears in and improves search results.

cc #12466
2014-08-04 14:37:06 -07:00
Conrad Kleinespel
c74d320662 libgetopts: tweak HasHarg/Occur docs. 2014-08-04 23:20:49 +02: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
Tim Joseph Dumol
a9979ada47 doc: Fix the 30-minute intro to use += operator.
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2014-08-05 02:02:41 +08: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
Ruud van Asseldonk
662f58f5a3 docs: Fix typo in tutorial. 2014-08-04 18:01:54 +02:00
Daniel Hofstetter
d0bd10b891 Rename guessing_game.rs to main.rs in guide 2014-08-04 16:41:37 +02: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
Michael Sproul
806e4f0b14 Gedit/GTKSourceView: Add macro syntax highlighting. 2014-08-04 11:28:37 +10: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
Tshepang Lekhonkhobe
349afcfa74 doc: make the sentence make more sense 2014-08-03 21:08:49 +02: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
OGINO Masanori
bf2d98e190 Remove the "NFKC clause" in the reference manual.
The reference manual said that code is interpreted as UTF-8 text and a
implementation will normalize it to NFKC. However, rustc doesn't do
any normalization now.

We may want to do any normalization for symbols, but normalizing whole
text seems harmful because doing so loses some sort of information even
if we choose a non-K variant of normalization.

I'd suggest removing "normalized to Unicode normalization form NFKC"
phrase for the present so that the manual represents the current state
properly. When we address the problem (with a RFC?), then the manual
should be updated.

Closes #12388.

Reference: https://github.com/rust-lang/rust/issues/2253

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-03 23:41:05 +09: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
Alex Crichton
2677e5f4a0 native: Fix utime() for windows
Apparently the units are in milliseconds, not in seconds!
2014-08-02 10:52:49 -07: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