Commit Graph

40057 Commits

Author SHA1 Message Date
Brian Anderson
e9019101a8 Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
Brian Anderson
df290f127e Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00
Brian Anderson
7770ea706b rustdoc: Add #[doc(test(no_inject_crate))] attribute
So that collections doctests don't automatically fail themselves
by injecting `extern crate collections` when they are mostly
using the std facade.
2015-03-23 14:40:25 -07:00
Brian Anderson
3d365f6a01 rustdoc: interpret all leading feature attributes in examples as crate attributes
This makes it possible to write `#![feature(foo)]` in doc tests.
2015-03-23 14:40:25 -07:00
bors
809a554fca Auto merge of #23593 - Manishearth:rollup, r=Manishearth
(yay, no Saturday)
2015-03-23 00:37:35 +00:00
Manish Goregaokar
b4e9106a8a Rollup merge of #23590 - FuGangqiang:attr, r=alexcrichton 2015-03-23 04:54:27 +05:30
Manish Goregaokar
5b9e87b571 Rollup merge of #23576 - barosl:mutex-doc, r=alexcrichton 2015-03-23 04:54:27 +05:30
FuGangqiang
7ec80fa31c add lifetime for while and for expression 2015-03-23 04:54:27 +05:30
Manish Goregaokar
f5782faa06 Rollup merge of #23562 - steveklabnik:fix_book_numbers, r=alexcrichton
Rustbook already does this.
2015-03-23 04:54:27 +05:30
FuGangqiang
5836efdfe7 fix the attributes sytax 2015-03-23 04:54:27 +05:30
Manish Goregaokar
78b61be77d Rollup merge of #23555 - steveklabnik:environment, r=sanxiyn
As @sanxiyn says,
https://github.com/rust-lang/rust/pull/23527#issuecomment-83835448
2015-03-23 04:54:27 +05:30
Manish Goregaokar
420bf9dd44 Rollup merge of #23554 - Ms2ger:readme-rustc, r=steveklabnik 2015-03-23 04:54:26 +05:30
Manish Goregaokar
718fe3d9c5 Rollup merge of #23578 - fhahn:issue-22820-feature-gate-tests1, r=alexcrichton
...ures.

Namely:

 * `box_syntax`
 * `box_patterns`
 * `simd_ffi`
 * `macro_reexport`

cc #22820
2015-03-23 04:54:26 +05:30
Manish Goregaokar
d8baa010ab Rollup merge of #23570 - dotdash:issue23550, r=eddyb
Boolean values and small aggregates have a different type in args/allocas than
in SSA values but the intrinsics for volatile and atomic ops were
missing the necessary casts to handle that.

Fixes #23550
2015-03-23 04:54:26 +05:30
Manish Goregaokar
a91eece96b Rollup merge of #23559 - aturon:future-proof-map-index, r=Gankro
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in
order to future-proof the API against the eventual inclusion of an
`IndexSet` trait.

Ideally, we would eventually be able to support:

```rust
map[owned_key] = val;
map[borrowed_key].mutating_method(arguments);
&mut map[borrowed_key];
```

but to keep the design space as unconstrained as possible, we do not
currently want to support `IndexMut`, in case some other strategy will
eventually be needed.

Code currently using mutating index notation can use `get_mut` instead.

[breaking-change]

Closes #23448

r? @Gankro
2015-03-23 04:54:26 +05:30
bors
b0aad7dd4f Auto merge of #23361 - petrochenkov:refdst, r=jakub-
After this patch code like `let ref a = *"abcdef"` doesn't cause ICE anymore.
Required for #23121

There are still places in rustc_trans where pointers are always assumed to be thin. In particular, #19064 is not resolved by this patch.
2015-03-22 15:52:30 +00:00
Björn Steinbrink
d4ca1cffce Fix volatile / atomic ops on bools and small aggregates
Boolean values and small aggregates have a different type in
args/allocas than in SSA values but the intrinsics for volatile and
atomic ops were missing the necessary casts to handle that.

Fixes #23550
2015-03-21 10:46:52 +01:00
Florian Hahn
c48bb85702 Add tests checking that a number of feature gates are gating their features.
Namely:

 * `box_syntax`
 * `box_patterns`
 * `simd_ffi`
 * `macro_reexport`

 cc #22820
2015-03-21 10:18:28 +01:00
Barosl Lee
84b14c5dc9 Fix documentation for std::sync::mutex: into_guard -> into_inner 2015-03-21 14:38:23 +09:00
bors
ecf8c64e1b Auto merge of #23470 - alexcrichton:less-prelude, r=aturon
This commit removes the reexports of `old_io` traits as well as `old_path` types
and traits from the prelude. This functionality is now all deprecated and needs
to be removed to make way for other functionality like `Seek` in the `std::io`
module (currently reexported as `NewSeek` in the io prelude).

Closes #23377
Closes #23378
2015-03-21 05:25:21 +00:00
Alex Crichton
212e03181e std: Remove old_io/old_path from the prelude
This commit removes the reexports of `old_io` traits as well as `old_path` types
and traits from the prelude. This functionality is now all deprecated and needs
to be removed to make way for other functionality like `Seek` in the `std::io`
module (currently reexported as `NewSeek` in the io prelude).

Closes #23377
Closes #23378
2015-03-20 20:07:19 -07:00
bors
e2fa53e593 Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichton
because then the call to `unwrap()` will not print the error object.
2015-03-20 23:16:47 +00:00
bors
68d6941563 Auto merge of #23267 - alexcrichton:issue-20012, r=aturon
This reverts commit aec67c2.

Closes #20012

This is temporarily rebased on #23245 as it would otherwise conflict, the last commit is the only one relevant to this PR though.
2015-03-20 20:19:42 +00:00
Steve Klabnik
9acdcba3d5 Remove manual numbers from TRPL
Rustbook already does this.
2015-03-20 15:27:55 -04:00
Alex Crichton
1cc9718fde Revert "Revert "std: Re-enable at_exit()""
This reverts commit aec67c2ee0.
2015-03-20 10:56:27 -07:00
Aaron Turon
5fe0bb743a Future-proof indexing on maps: remove IndexMut
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in
order to future-proof the API against the eventual inclusion of an
`IndexSet` trait.

Ideally, we would eventually be able to support:

```rust
map[owned_key] = val;
map[borrowed_key].mutating_method(arguments);
&mut map[borrowed_key];
```

but to keep the design space as unconstrained as possible, we do not
currently want to support `IndexMut`, in case some other strategy will
eventually be needed.

Code currently using mutating index notation can use `get_mut` instead.

[breaking-change]

Closes #23448
2015-03-20 10:46:31 -07:00
bors
3900c089a1 Auto merge of #23471 - sae-bom:aarch64-linux-android, r=alexcrichton
Resolved #21773. (Aarch64 test has been broken again)
r? @alexcrichton
2015-03-20 17:45:15 +00:00
bors
ecdf792d1d Auto merge of #23537 - steveklabnik:gh22551, r=alexcrichton
Fixes #22551

('grammar' wasn't really used in the chapter at all)
2015-03-20 15:02:55 +00:00
Steve Klabnik
af09763cc1 Add AST to the glossary
Fixes #22551
2015-03-20 10:55:51 -04:00
Steve Klabnik
8f0de740f8 environment variables -> environment
As @sanxiyn says,
https://github.com/rust-lang/rust/pull/23527#issuecomment-83835448
2015-03-20 10:53:51 -04:00
Ms2ger
3bdb5c3078 Make librustc's markdown README.txt claim to be markdown.
This allows github to render it with formatting.
2015-03-20 13:29:13 +01:00
Ms2ger
41a7177d6a Update librustc's README.txt for some code changes and reformat it. 2015-03-20 13:29:01 +01:00
bors
cbc660bd1c Auto merge of #23522 - steveklabnik:gh22518, r=Manishearth
When investigating #22518, this chapter is really the only part that has `rand`, and the rest still works without it. We should have some examples like this, but for now, it's more important to be right than perfect.
2015-03-20 11:29:12 +00:00
Oliver Schneider
b4a1e59146 don't use Result::ok just to be able to use unwrap/unwrap_or 2015-03-20 08:19:13 +01:00
bors
0834bd1b3d Auto merge of #23548 - Manishearth:rollup, r=Manishearth 2015-03-20 07:12:39 +00:00
Manish Goregaokar
6107e4c0b8 Rollup merge of #23534 - steveklabnik:remove_sched_threads, r=alexcrichton
As @alexcrichton says, this was really a libgreen thing, and isn't
relevant now.

As this removes a technically-public function, this is a

[breaking-change]
2015-03-20 12:43:15 +05:30
Manish Goregaokar
0711006694 Rollup merge of #23532 - steveklabnik:gh22002, r=alexcrichton
Fixes #22002
2015-03-20 12:43:14 +05:30
Manish Goregaokar
83a95b0de9 Rollup merge of #23527 - steveklabnik:gh16330, r=alexcrichton
Fixes #16330

My troff is probably poor, so make sure that all looks okay.
2015-03-20 12:43:14 +05:30
Manish Goregaokar
17f3f3e3e6 Rollup merge of #23526 - mbrubeck:uppercase, r=steveklabnik
`uppercase` and `lowercase` are currently named `to_uppercase` and `to_lowercase`. Also adds a link to the `char` type documentation which has much more detail on these iterators.
2015-03-20 12:43:14 +05:30
Manish Goregaokar
2ac03bceb4 Rollup merge of #23518 - farcaller:fix_quote_method, r=eddyb
This fixes several use cases that were broken after #23265 landed.
2015-03-20 12:43:13 +05:30
Manish Goregaokar
c785e7e2a1 Rollup merge of #23510 - lgvz:makefile, r=Manishearth
The wiki doesn't seem to exist
2015-03-20 12:43:13 +05:30
Manish Goregaokar
90e7f472f7 Rollup merge of #23499 - mbrubeck:doc-edit, r=huonw
Multiple people have been suprised by this aspect of read_line's behavior, which is not obvious from the docs.
2015-03-20 12:43:13 +05:30
Manish Goregaokar
dbe084b5bf Rollup merge of #23447 - kjpgit:kjp/pointerexample, r=steveklabnik
These two borrowing examples were confusing/misleading.  This changes it
to more clearly show how you _can_ borrow a box, and also uses & instead
of &*.
2015-03-20 12:43:12 +05:30
Manish Goregaokar
1ceb26b48c Rollup merge of #22631 - aepsil0n:issue-22098, r=aturon
Fixes #22098.
2015-03-20 12:43:12 +05:30
Manish Goregaokar
baf6b3a35d Rollup merge of #23531 - steveklabnik:gh21709, r=alexcrichton
Fixes #21709
2015-03-20 12:43:12 +05:30
Manish Goregaokar
17c1a46a7d Rollup merge of #23529 - steveklabnik:gh23426, r=alexcrichton
Fixes #23426
2015-03-20 12:43:11 +05:30
Manish Goregaokar
e2d32b74ec Rollup merge of #23525 - steveklabnik:test_tasks, r=alexcrichton
We don't use 'task' anymore, these are now threads.

Because this changes the name of a compiler option, this is

[breaking-change]

I think this is small enough to not need an RFC, nor a period of accepting both. If we want to take both for a while, I can change the patch.
2015-03-20 12:43:11 +05:30
Manish Goregaokar
3e433738fb Rollup merge of #23504 - alexcrichton:parse-error-not-unit, r=aturon
The IP and socket address types all had `FromStr` implemented but the
implementations were not marked stable, nor was the error type returned ready to
be properly stabilized.

This commit marks the implementations of `FromStr` as stable and also renamed
the `ParseError` structure to `AddrParseError`. The error is now also an opaque
structure that cannot be constructed outside the standard library.

cc #22949
[breaking-change]
2015-03-20 12:43:11 +05:30
bors
fda8673531 Auto merge of #23504 - alexcrichton:parse-error-not-unit, r=aturon
The IP and socket address types all had `FromStr` implemented but the
implementations were not marked stable, nor was the error type returned ready to
be properly stabilized.

This commit marks the implementations of `FromStr` as stable and also renamed
the `ParseError` structure to `AddrParseError`. The error is now also an opaque
structure that cannot be constructed outside the standard library.

cc #22949
[breaking-change]
2015-03-20 04:30:04 +00:00
bors
e98e391337 Auto merge of #23254 - jbcrail:saturating-math-docs, r=steveklabnik
This was added for #23241.
2015-03-20 01:35:54 +00:00