Commit Graph

40254 Commits

Author SHA1 Message Date
Ches Martin
92294e7aed guide: Improvements to language covering enums 2015-03-21 05:32:26 +07:00
Ches Martin
0c040b07f0 guide: minor copy edits 2015-03-21 05:32:07 +07: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
Flavio Percoco
04d57729fc fix fallout 2015-03-20 16:48:15 +01:00
Flavio Percoco
38dbcb2e37 Check trait unsafety for defaulted traits 2015-03-20 16:43:11 +01:00
Flavio Percoco
01d24297eb Feature gate defaulted traits 2015-03-20 16:43:11 +01:00
Flavio Percoco
9ae144f055 Add default impls for Send/Sync 2015-03-20 16:43:11 +01: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
Felix S. Klock II
61ff823c63 Test suite for overflowing shift operators.
Note the tests have been revised to match new semantics for 8- and
16-bit values.
2015-03-20 11:26:09 +01:00
Felix S. Klock II
19fef72a8c Added panic-on-overflow for rhs of left and right shift expressions.
This includes a slight refactoring of the `cast_shift_rhs` and related
functions in `trans::base`, so that I can call them from much later in
the compiler's control flow (so that we can clearly dilineate where
automatic conversions of the RHS occur, versus where we check it).

The rhs-checking and fallback-masking is generalized to 8- and 16-bit
values, and the fallback-masking is turned on unconditionally.

Fix #10183.

Is this a [breaking-change]?  I would argue it is not; it only adds a
strict definition to what was previously undefined behavior; however,
there might be code that was e.g. assuming that `1_i8 << 17` yields 0.
(This happens in certain contexts and at certain optimization levels.)
2015-03-20 11:25:20 +01: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
Steve Klabnik
71321ff33f Remove rt::default_sched_threads and RUST_THREADS.
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]

Conflicts:
	src/libtest/lib.rs
2015-03-20 05:36:07 +05:30
Manish Goregaokar
4294327886 Rollup merge of #23254 - jbcrail:saturating-math-docs, r=steveklabnik
This was added for #23241.
2015-03-20 05:30:12 +05:30
Manish Goregaokar
97f03e7ad9 Rollup merge of #23489 - michaelwoerister:span-artihmetic-overflow-bug, r=alexcrichton
This should solve issues #23115, #23469, and #23407.

As the title says, this is just a workaround. The underlying problem is that macro expansion can produce invalid spans. I've opened issue #23480 so we don't forget about that.
2015-03-20 05:30:06 +05:30
Jake Goulding
c6ca2205ea StrExt::splitn should not require a DoubleEndedSearcher
Closes #23262
2015-03-19 19:25:22 -04:00
Jake Goulding
6a5148bda1 Introduce rsplit 2015-03-19 19:25:22 -04:00
Steve Klabnik
b4a72a403a Document environment variables
Fixes #16330
2015-03-19 19:19:29 -04:00
bors
f4e0ce66a3 Auto merge of #23489 - michaelwoerister:span-artihmetic-overflow-bug, r=alexcrichton
This should solve issues #23115, #23469, and #23407.

As the title says, this is just a workaround. The underlying problem is that macro expansion can produce invalid spans. I've opened issue #23480 so we don't forget about that.
2015-03-19 22:37:02 +00:00
Steve Klabnik
3e3408de0f Comment on when ReadDir is Err
Fixes #23426
2015-03-19 18:21:39 -04:00
Steve Klabnik
d081b241ff Reference Drop in FFI chapter
Fixes #22002
2015-03-19 18:11:35 -04:00
Steve Klabnik
109803f6d5 Remove incorrect statement about raw pointers.
Fixes #21709
2015-03-19 18:06:54 -04:00
Matt Brubeck
973b788f40 Update docs for ToUppercase/ToLowercase structs
`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-19 13:34:18 -07:00
Steve Klabnik
7cbc42849f RUST_TEST_TASKS -> RUST_TEST_THREADS
We don't use 'task' anymore, these are now threads.

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

[breaking-change]
2015-03-19 15:42:56 -04:00
Steve Klabnik
0249603c20 Remove the Guessing Game from the book
Fixes #22518
2015-03-19 15:19:20 -04:00
bors
7f53b943f9 Auto merge of #23430 - alexcrichton:io-error, r=aturon
This commit stabilizes the `ErrorKind` enumeration which is consumed by and
generated by the `io::Error` type. The purpose of this type is to serve as a
cross-platform namespace to categorize errors into. Two specific issues are
addressed as part of this stablization:

* The naming of each variant was scrutinized and some were tweaked. An example
  is how `FileNotFound` was renamed to simply `NotFound`. These names should not
  show either a Unix or Windows bias and the set of names is intended to grow
  over time. For now the names will likely largely consist of those errors
  generated by the I/O APIs in the standard library.

* The mapping of OS error codes onto kinds has been altered. Coalescing no
  longer occurs (multiple error codes become one kind). It is intended that each
  OS error code, if bound, corresponds to only one `ErrorKind`. The current set
  of error kinds was expanded slightly to include some networking errors.

This commit also adds a `raw_os_error` function which returns an `Option<i32>`
to extract the underlying raw error code from the `Error`.

Closes #16666

[breaking-change]
2015-03-19 19:15:22 +00:00