Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 21 pull requests #27219

Merged
merged 110 commits into from
Jul 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
441b994
simplify processing of ConstVal objects when not all variants are legal
Jul 13, 2015
0c9e3dc
Fix negate_unsigned feature gate check
nagisa Jul 13, 2015
2250215
Implement lint deprecation/removal…
nagisa Jul 15, 2015
ccf9050
Don't recurse down closures for duplicate-label checking
Manishearth Jul 17, 2015
6bdfb05
Clarify the usage of "hints" in const_eval.
eefriedman Jun 30, 2015
4567704
Fix rustdoc formatting of impls
wthrowe Jul 18, 2015
a219917
Fix doc comment parsing in macros.
Jul 15, 2015
1373c4f
Properly create debug info for functions
dotdash Jul 13, 2015
47128b8
Create correct debuginfo for closure function signatures
dotdash Jul 14, 2015
9175a16
Generate proper debug info for function pointers
dotdash Jul 13, 2015
b684826
add test for #20162
apasel422 Jul 19, 2015
34309cd
implement 'a:'static region bounds
Jul 6, 2015
8edcff5
return erased regions from fulfill_obligation
Jul 6, 2015
28ce509
clean-up find_bound_for_assoc_item
arielb1 Jul 19, 2015
bbeace6
Add test of impl formatting
wthrowe Jul 20, 2015
761e11e
fixes #27124 for openbsd
semarie Jul 20, 2015
ac33f15
fix `configure`: allow both `--enable-debug` and `--disable-debuginfo`
pnkfelix Jul 20, 2015
871ccfb
Add a test for #26468
dotdash Jul 20, 2015
0ca8e49
Convert negate_unsigned feature gate to a warning
nagisa Jul 20, 2015
9bb6545
add test for #14229
apasel422 Jul 20, 2015
4c73dbd
add test for #19404
apasel422 Jul 20, 2015
3d65c7f
Create proper debuginfo for closure variables
dotdash Jul 14, 2015
39d4faf
Auto merge of #27025 - dotdash:issue-26484, r=pnkfelix
bors Jul 20, 2015
31a62d3
s/has gained/has not gained/g
pfalabella Jul 20, 2015
7e9e389
std: Add IntoRaw{Fd,Handle,Socket} traits
alexcrichton Jul 16, 2015
013d47b
syntax: Suppress panic message on `fatal`
alexcrichton Jul 20, 2015
1855750
Auto merge of #27026 - nagisa:overflowing-unsigned, r=pnkfelix
bors Jul 20, 2015
7cb157e
Register new snapshots
alexcrichton Jul 17, 2015
a7e5c63
add test for #10436
apasel422 Jul 20, 2015
225ad17
impl Debug for Atomic types
arthurprs Jul 19, 2015
3ae7b72
Fix wording nit for E0253
AlisdairO Jul 20, 2015
27fc0f2
Document iterators in std::io
steveklabnik Jul 20, 2015
1e79917
Improve Debug impl for File on Windows
retep998 Jul 20, 2015
9191a78
Revert "Fix `missing_docs` lint for const and static."
brson Jul 20, 2015
686d326
Add diagnostics for E0172, fix inline error message for E0139
AlisdairO Jul 19, 2015
47265bb
Auto merge of #27064 - alexcrichton:into-raw-os, r=brson
bors Jul 20, 2015
7e7ec6b
Document structures in std::io::utils
steveklabnik Jul 20, 2015
2fe870a
Auto merge of #26831 - arielb1:lifetime-fixes, r=nikomatsakis
bors Jul 20, 2015
44dd247
doc: Clean up primitive short descriptions
brson Jul 17, 2015
8497c42
std: Create separate docs for the primitives
brson Jul 20, 2015
9e18326
Update docs for take and broadcast
steveklabnik Jul 20, 2015
ed49bad
Auto merge of #27056 - Eljay:doc-comments, r=nikomatsakis
bors Jul 20, 2015
fa28192
Write better docs for std::io
steveklabnik Jul 20, 2015
24c5e49
std: Fix compiling the standard library on i686-MSVC
alexcrichton Jul 20, 2015
118a5c4
Auto merge of #27129 - arthurprs:debug_atomic, r=alexcrichton
bors Jul 21, 2015
a3e78f4
Add test of cross-crate impl formatting
wthrowe Jul 20, 2015
778c89c
Address feedback
brson Jul 21, 2015
a29c834
Add travis config to TRPL: release channels
steveklabnik Jul 21, 2015
238765e
Auto merge of #27103 - wthrowe:doc_format, r=alexcrichton
bors Jul 21, 2015
48a1f1b
Auto merge of #27139 - pnkfelix:allow-disable-debuginfo, r=dotdash
bors Jul 21, 2015
f9f0e44
Auto merge of #27144 - semarie:openbsd-archive_format, r=alexcrichton
bors Jul 21, 2015
691ce23
Auto merge of #27150 - retep998:where-are-my-files, r=alexcrichton
bors Jul 21, 2015
247a0d1
Auto merge of #27153 - alexcrichton:flaky-tests, r=brson
bors Jul 21, 2015
007246c
Allow for space between each filemap in the codemap
nrc Jul 2, 2015
0e907fa
Provide a filemap ctor with line info
nrc Jul 2, 2015
bf34187
Test
nrc Jul 3, 2015
f47d20a
Use a span from the correct file for the inner span of a module
nrc Jul 6, 2015
e33b128
Auto merge of #26816 - nrc:zero-codemap, r=@jroesch
bors Jul 21, 2015
9957228
Guidance on Windows install re "Add to PATH"
Dangthrimble Jul 20, 2015
2afe47d
Auto merge of #27160 - brson:revdoc, r=huonw
bors Jul 21, 2015
fec23d9
Auto merge of #27168 - brson:stdprim, r=steveklabnik
bors Jul 21, 2015
4128583
This test attempts to exercise cyclic structure much of `std::collect…
pnkfelix Jul 21, 2015
90a3692
Auto merge of #27171 - steveklabnik:doc_std_io, r=brson
bors Jul 21, 2015
5dbddfb
Auto merge of #26935 - oli-obk:const_val_description, r=eddyb
bors Jul 21, 2015
d68b152
std: Be resilient to failure in pthread_getattr_np
alexcrichton Jul 16, 2015
cbdc52e
Expand a bit on thread::park spurious wakeups
steveklabnik Jul 7, 2015
0eb7303
Add E0403 error explanation
GuillaumeGomez Jul 17, 2015
cd385cb
Add E0405 error explanation
GuillaumeGomez Jul 17, 2015
bc79f20
Add E0404 error explanation
GuillaumeGomez Jul 17, 2015
9581154
Add E0407 error explanation
GuillaumeGomez Jul 17, 2015
c13295b
Add E0428 error explanation
GuillaumeGomez Jul 17, 2015
d2aee95
Expand documentation for IntoInnerError
steveklabnik Jul 20, 2015
2e919b4
Add E0433 error explanation
GuillaumeGomez Jul 17, 2015
21dfd24
Auto merge of #26856 - steveklabnik:gh26475, r=alexcrichton
bors Jul 21, 2015
e6d8434
add test for #14382
apasel422 Jul 20, 2015
a5c7b96
Add info about usage of 'unsafe' keyword in bindings to foreign inter…
Jul 21, 2015
48870d4
rust -> Rust
Jul 21, 2015
cf1e078
Klabnik nit-picks ;)
ticki Jul 21, 2015
ee2d3bc
Auto merge of #27073 - alexcrichton:less-proc-fs, r=brson
bors Jul 21, 2015
18f115c
update compile-fail test for #21174 to account for #27127
apasel422 Jul 21, 2015
39a780d
Auto merge of #27093 - Manishearth:closure-label-shadow, r=pnkfelix
bors Jul 21, 2015
c35b2bd
trans: Move rust_try into the compiler
alexcrichton Jul 20, 2015
d33cab1
Auto merge of #27172 - alexcrichton:snapshots, r=brson
bors Jul 22, 2015
9090420
Auto merge of #27185 - pnkfelix:test-cyclic-collections, r=alexcrichton
bors Jul 22, 2015
e22c6f7
Improve documentation for std::io::BufWriter
steveklabnik Jul 20, 2015
f2c7345
Path changed to %PATH%
Dangthrimble Jul 22, 2015
25281b1
Auto merge of #27176 - alexcrichton:fix-stock-llvm, r=brson
bors Jul 22, 2015
d4d4206
Auto merge of #26683 - eefriedman:const-eval-hint, r=pnkfelix
bors Jul 22, 2015
e31ad95
Improve documentation for std::io::LineWriter
steveklabnik Jul 20, 2015
bc4daf7
Rollup merge of #27084 - GuillaumeGomez:patch-2, r=brson
steveklabnik Jul 22, 2015
5a44f70
Rollup merge of #27127 - AlisdairO:diagnostics172, r=Manishearth
steveklabnik Jul 22, 2015
db0e0ef
Rollup merge of #27131 - apasel422:issue-20162, r=arielb1
steveklabnik Jul 22, 2015
0ac7438
Rollup merge of #27140 - dotdash:test-26468, r=luqmana
steveklabnik Jul 22, 2015
70bbdd7
Rollup merge of #27146 - apasel422:issue-14229, r=alexcrichton
steveklabnik Jul 22, 2015
cb5d9a3
Rollup merge of #27147 - apasel422:issue-19404, r=alexcrichton
steveklabnik Jul 22, 2015
6b0833a
Rollup merge of #27151 - pfalabella:patch-2, r=steveklabnik
steveklabnik Jul 22, 2015
2375ef5
Rollup merge of #27154 - apasel422:issue-10436, r=Gankro
steveklabnik Jul 22, 2015
239657c
Rollup merge of #27155 - steveklabnik:doc_std_io_buf_writer, r=alexcr…
steveklabnik Jul 22, 2015
b73c6fe
Rollup merge of #27156 - AlisdairO:diagnostics253, r=Manishearth
steveklabnik Jul 22, 2015
558008b
Rollup merge of #27157 - steveklabnik:doc_std_io_iterators, r=alexcri…
steveklabnik Jul 22, 2015
5f0c998
Rollup merge of #27158 - apasel422:issue-14382, r=alexcrichton
steveklabnik Jul 22, 2015
cc60f3f
Rollup merge of #27163 - steveklabnik:doc_std_io_cursor, r=alexcrichton
steveklabnik Jul 22, 2015
47f1286
Rollup merge of #27164 - steveklabnik:doc_io_utils, r=alexcrichton
steveklabnik Jul 22, 2015
6397ecb
Rollup merge of #27166 - steveklabnik:doc_std_io_linewriter, r=alexcr…
steveklabnik Jul 22, 2015
932f0bb
Rollup merge of #27167 - steveklabnik:doc_std_io_take, r=alexcrichton
steveklabnik Jul 22, 2015
a39a36a
Rollup merge of #27170 - steveklabnik:doc_std_io_intoinnererror, r=al…
steveklabnik Jul 22, 2015
068e7d7
Rollup merge of #27175 - steveklabnik:channels_plus_travis, r=alexcri…
steveklabnik Jul 22, 2015
7cacf83
Rollup merge of #27183 - Dangthrimble:master, r=steveklabnik
steveklabnik Jul 22, 2015
5665efd
Rollup merge of #27201 - Ticki:master, r=steveklabnik
steveklabnik Jul 22, 2015
5f04b1b
Rollup merge of #27202 - apasel422:issue-21174, r=alexcrichton
steveklabnik Jul 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ envopt() {
fi
}

enable_if_not_disabled() {
local OP=$1
local UOP=$(echo $OP | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
local ENAB_V="CFG_ENABLE_$UOP"
local EXPLICITLY_DISABLED="CFG_DISABLE_${UOP}_PROVIDED"
eval VV=\$$EXPLICITLY_DISABLED
if [ -z "$VV" ]; then
eval $ENAB_V=1
fi
}

to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
Expand Down Expand Up @@ -671,10 +682,12 @@ if [ -n "$CFG_ENABLE_DEBUG" ]; then
CFG_DISABLE_OPTIMIZE=1
CFG_DISABLE_OPTIMIZE_CXX=1
fi
CFG_ENABLE_DEBUG_ASSERTIONS=1
CFG_ENABLE_DEBUG_JEMALLOC=1
CFG_ENABLE_DEBUGINFO=1
CFG_ENABLE_LLVM_ASSERTIONS=1

# Set following variables to 1 unless setting already provided
enable_if_not_disabled debug-assertions
enable_if_not_disabled debug-jemalloc
enable_if_not_disabled debuginfo
enable_if_not_disabled llvm-assertions
fi

# OK, now write the debugging options
Expand Down
18 changes: 0 additions & 18 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ NATIVE_DEPS_miniz_$(1) = miniz.c
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
rust_android_dummy.c
NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S
ifeq ($$(findstring msvc,$(1)),msvc)
ifeq ($$(findstring i686,$(1)),i686)
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_32.ll
else
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_64.ll
endif
else
NATIVE_DEPS_rustrt_native_$(1) += rust_try.ll
endif
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S

Expand All @@ -76,14 +67,6 @@ NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S

RT_OUTPUT_DIR_$(1) := $(1)/rt

$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
$$(LLVM_CONFIG_$$(CFG_BUILD))
@mkdir -p $$(@D)
@$$(call E, compile: $$@)
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) \
-relocation-model=pic -o $$@ $$<

$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
@mkdir -p $$(@D)
@$$(call E, compile: $$@)
Expand Down Expand Up @@ -122,7 +105,6 @@ define THIRD_PARTY_LIB
OBJS_$(2)_$(1) := $$(NATIVE_DEPS_$(2)_$(1):%=$$(RT_OUTPUT_DIR_$(1))/%)
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.c=.o)
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.cpp=.o)
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.ll=.o)
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.S=.o)
NATIVE_$(2)_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),$(2))
$$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
Expand Down
8 changes: 4 additions & 4 deletions src/doc/trpl/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ libraries:
Note that frameworks are only available on OSX targets.

The different `kind` values are meant to differentiate how the native library
participates in linkage. From a linkage perspective, the rust compiler creates
participates in linkage. From a linkage perspective, the Rust compiler creates
two flavors of artifacts: partial (rlib/staticlib) and final (dylib/binary).
Native dynamic library and framework dependencies are propagated to the final
artifact boundary, while static library dependencies are not propagated at
Expand All @@ -350,9 +350,9 @@ artifact.
A few examples of how this model can be used are:

* A native build dependency. Sometimes some C/C++ glue is needed when writing
some rust code, but distribution of the C/C++ code in a library format is just
some Rust code, but distribution of the C/C++ code in a library format is just
a burden. In this case, the code will be archived into `libfoo.a` and then the
rust crate would declare a dependency via `#[link(name = "foo", kind =
Rust crate would declare a dependency via `#[link(name = "foo", kind =
"static")]`.

Regardless of the flavor of output for the crate, the native static library
Expand All @@ -361,7 +361,7 @@ A few examples of how this model can be used are:

* A normal dynamic dependency. Common system libraries (like `readline`) are
available on a large number of systems, and often a static copy of these
libraries cannot be found. When this dependency is included in a rust crate,
libraries cannot be found. When this dependency is included in a Rust crate,
partial targets (like rlibs) will not link to the library, but when the rlib
is included in a final target (like a binary), the native library will be
linked in.
Expand Down
15 changes: 13 additions & 2 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The first step to using Rust is to install it! There are a number of ways to
install Rust, but the easiest is to use the `rustup` script. If you're on Linux
or a Mac, all you need to do is this:
or a Mac, all you need to do is this:

> Note: you don't need to type in the `$`s, they just indicate the start of
> each command. You’ll see many tutorials and examples around the web that
Expand All @@ -25,6 +25,12 @@ $ sh rustup.sh
[insecurity]: http://curlpipesh.tumblr.com

If you're on Windows, please download the appropriate [installer][install-page].
**NOTE:** By default, the Windows installer will not add Rust to the %PATH%
system variable. If this is the only version of Rust you are installing and you
want to be able to run it from the command line, click on "Advanced" on the
install dialog and on the "Product Features" page ensure "Add to PATH" is
installed on the local hard drive.


[install-page]: http://www.rust-lang.org/install.html

Expand Down Expand Up @@ -87,6 +93,11 @@ rustc 1.0.0 (a59de37e9 2015-05-13)

If you did, Rust has been installed successfully! Congrats!

If you didn't and you're on Windows, check that Rust is in your %PATH% system
variable. If it isn't, run the installer again, select "Change" on the "Change,
repair, or remove installation" page and ensure "Add to PATH" is installed on
the local hard drive.

This installer also installs a copy of the documentation locally, so you can
read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location.
On Windows, it's in a `share/doc` directory, inside wherever you installed Rust
Expand All @@ -101,5 +112,5 @@ resources include [the user’s forum][users], and

[irc]: irc://irc.mozilla.org/#rust
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
[users]: http://users.rust-lang.org/
[users]: http://users.rust-lang.org/
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
23 changes: 23 additions & 0 deletions src/doc/trpl/release-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,26 @@ This will help alert the team in case there’s an accidental regression.
Additionally, testing against nightly can catch regressions even sooner, and so
if you don’t mind a third build, we’d appreciate testing against all channels.

As an example, many Rust programmers use [Travis](https://travis-ci.org/) to
test their crates, which is free for open source projects. Travis [supports
Rust directly][travis], and you can use a `.travis.yml` file like this to
test on all channels:

```yaml
language: rust
rust:
- nightly
- beta
- stable

matrix:
allow_failures:
- rust: nightly
```

[travis]: http://docs.travis-ci.com/user/languages/rust/

With this configuration, Travis will test all three channels, but if something
breaks on nightly, it won’t fail your build. A similar configuration is
recommended for any CI system, check the documentation of the one you’re
using for more details.
10 changes: 7 additions & 3 deletions src/doc/trpl/unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ that you normally can not do. Just three. Here they are:

That’s it. It’s important that `unsafe` does not, for example, ‘turn off the
borrow checker’. Adding `unsafe` to some random Rust code doesn’t change its
semantics, it won’t just start accepting anything.
semantics, it won’t just start accepting anything. But it will let you write
things that _do_ break some of the rules.

But it will let you write things that _do_ break some of the rules. Let’s go
over these three abilities in order.
You will also encounter the `unsafe` keyword when writing bindings to foreign
(non-Rust) interfaces. You're encouraged to write a safe, native Rust interface
around the methods provided by the library.

Let’s go over the basic three abilities listed, in order.

## Access or update a `static mut`

Expand Down
17 changes: 0 additions & 17 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,3 @@ pub fn oom() -> ! {
// allocate.
unsafe { core::intrinsics::abort() }
}

// FIXME(#14344): When linking liballoc with libstd, this library will be linked
// as an rlib (it only exists as an rlib). It turns out that an
// optimized standard library doesn't actually use *any* symbols
// from this library. Everything is inlined and optimized away.
// This means that linkers will actually omit the object for this
// file, even though it may be needed in the future.
//
// To get around this for now, we define a dummy symbol which
// will never get inlined so the stdlib can call it. The stdlib's
// reference to this symbol will cause this library's object file
// to get linked in to libstd successfully (the linker won't
// optimize it out).
#[doc(hidden)]
#[unstable(feature = "issue_14344_fixme")]
#[cfg(stage0)]
pub fn fixme_14344_be_sure_to_link_to_collections() {}
7 changes: 0 additions & 7 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ pub mod btree_set {
pub use btree::set::*;
}


// FIXME(#14344) this shouldn't be necessary
#[doc(hidden)]
#[unstable(feature = "issue_14344_fixme")]
#[cfg(stage0)]
pub fn fixme_14344_be_sure_to_link_to_collections() {}

#[cfg(not(test))]
mod std {
pub use core::ops; // RangeFull
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Utilities for slice manipulation
//! A dynamically-sized view into a contiguous sequence, `[T]`.
//!
//! The `slice` module contains useful code to help work with slice values.
//! Slices are a view into a block of memory represented as a pointer and a
//! length.
//!
Expand Down Expand Up @@ -78,7 +77,8 @@
//! iterators.
//! * Further methods that return iterators are `.split()`, `.splitn()`,
//! `.chunks()`, `.windows()` and more.
#![doc(primitive = "slice")]
//!
//! *[See also the slice primitive type](../primitive.slice.html).*
#![stable(feature = "rust1", since = "1.0.0")]

// Many of the usings in this module are only used in the test configuration.
Expand Down
38 changes: 3 additions & 35 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Unicode string manipulation (the `str` type).
//! Unicode string slices
//!
//! Rust's `str` type is one of the core primitive types of the language. `&str`
//! is the borrowed string type. This type of string can only be created from
//! other strings, unless it is a `&'static str` (see below). It is not possible
//! to move out of borrowed strings because they are owned elsewhere.
//!
//! # Examples
//!
//! Here's some code that uses a `&str`:
//!
//! ```
//! let s = "Hello, world.";
//! ```
//!
//! This `&str` is a `&'static str`, which is the type of string literals.
//! They're `'static` because literals are available for the entire lifetime of
//! the program.
//!
//! You can get a non-`'static` `&str` by taking a slice of a `String`:
//!
//! ```
//! let some_string = "Hello, world.".to_string();
//! let s = &some_string;
//! ```
//!
//! # Representation
//!
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as
//! a stream of UTF-8 bytes. All [strings](../../reference.html#literals) are
//! guaranteed to be validly encoded UTF-8 sequences. Additionally, strings are
//! not null-terminated and can thus contain null bytes.
//!
//! The actual representation of `str`s have direct mappings to slices: `&str`
//! is the same as `&[u8]`.
//! *[See also the `str` primitive type](../primitive.str.html).*


#![doc(primitive = "str")]
#![stable(feature = "rust1", since = "1.0.0")]

// Many of the usings in this module are only used in the test configuration.
Expand Down
3 changes: 0 additions & 3 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,23 +979,20 @@ impl ops::Index<ops::RangeFull> for String {
}
}

#[cfg(not(stage0))]
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
impl ops::IndexMut<ops::Range<usize>> for String {
#[inline]
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut str {
&mut self[..][index]
}
}
#[cfg(not(stage0))]
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
impl ops::IndexMut<ops::RangeTo<usize>> for String {
#[inline]
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut str {
&mut self[..][index]
}
}
#[cfg(not(stage0))]
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
impl ops::IndexMut<ops::RangeFrom<usize>> for String {
#[inline]
Expand Down
3 changes: 2 additions & 1 deletion src/libcore/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
//! Implementations of things like `Eq` for fixed-length arrays
//! up to a certain length. Eventually we should able to generalize
//! to all lengths.
//!
//! *[See also the array primitive type](../primitive.array.html).*

#![doc(primitive = "array")]
#![unstable(feature = "fixed_size_array",
reason = "traits and impls are better expressed through generic \
integer constants")]
Expand Down
21 changes: 21 additions & 0 deletions src/libcore/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ use intrinsics;
use cell::UnsafeCell;

use default::Default;
use fmt;

/// A boolean type which can be safely shared between threads.
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1089,3 +1090,23 @@ pub fn fence(order: Ordering) {
}
}
}

macro_rules! impl_Debug {
($($t:ident)*) => ($(
#[stable(feature = "atomic_debug", since = "1.3.0")]
impl fmt::Debug for $t {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple(stringify!($t)).field(&self.load(Ordering::SeqCst)).finish()
}
}
)*);
}

impl_Debug!{ AtomicUsize AtomicIsize AtomicBool }

#[stable(feature = "atomic_debug", since = "1.3.0")]
impl<T> fmt::Debug for AtomicPtr<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("AtomicPtr").field(&self.load(Ordering::SeqCst)).finish()
}
}
1 change: 0 additions & 1 deletion src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//! For more details, see ::rustc_unicode::char (a.k.a. std::char)

#![allow(non_snake_case)]
#![doc(primitive = "char")]
#![stable(feature = "core_char", since = "1.2.0")]

use iter::Iterator;
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

// FIXME: #6220 Implement floating point formatting

#![allow(unsigned_negation)]

use prelude::*;

use fmt;
Expand Down
6 changes: 6 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,10 @@ extern "rust-intrinsic" {
/// Returns the value of the discriminant for the variant in 'v',
/// cast to a `u64`; if `T` has no discriminant, returns 0.
pub fn discriminant_value<T>(v: &T) -> u64;

/// Rust's "try catch" construct which invokes the function pointer `f` with
/// the data pointer `data`, returning the exception payload if an exception
/// is thrown (aka the thread panics).
#[cfg(not(stage0))]
pub fn try(f: fn(*mut u8), data: *mut u8) -> *mut u8;
}
Loading