Commit Graph

39743 Commits

Author SHA1 Message Date
Alex Crichton
d54bd9f29a std: Stabilize the io module
The new `std::io` module has had some time to bake now, and this commit
stabilizes its functionality. There are still portions of the module which
remain unstable, and below contains a summart of the actions taken.

This commit also deprecates the entire contents of the `old_io` module in a
blanket fashion. All APIs should now have a reasonable replacement in the
new I/O modules.

Stable APIs:

* `std::io` (the name)
* `std::io::prelude` (the name)
* `Read`
* `Read::read`
* `Read::{read_to_end, read_to_string}` after being modified to return a `usize`
  for the number of bytes read.
* `Write`
* `Write::write`
* `Write::{write_all, write_fmt}`
* `BufRead`
* `BufRead::{fill_buf, consume}`
* `BufRead::{read_line, read_until}` after being modified to return a `usize`
  for the number of bytes read.
* `BufReader`
* `BufReader::{new, with_capacity}`
* `BufReader::{get_ref, get_mut, into_inner}`
* `{Read,BufRead} for BufReader`
* `BufWriter`
* `BufWriter::{new, with_capacity}`
* `BufWriter::{get_ref, get_mut, into_inner}`
* `Write for BufWriter`
* `IntoInnerError`
* `IntoInnerError::{error, into_inner}`
* `{Error,Display} for IntoInnerError`
* `LineWriter`
* `LineWriter::{new, with_capacity}` - `with_capacity` was added
* `LineWriter::{get_ref, get_mut, into_inner}` - `get_mut` was added)
* `Write for LineWriter`
* `BufStream`
* `BufStream::{new, with_capacities}`
* `BufStream::{get_ref, get_mut, into_inner}`
* `{BufRead,Read,Write} for BufStream`
* `stdin`
* `Stdin`
* `Stdin::lock`
* `Stdin::read_line` - added method
* `StdinLock`
* `Read for Stdin`
* `{Read,BufRead} for StdinLock`
* `stdout`
* `Stdout`
* `Stdout::lock`
* `StdoutLock`
* `Write for Stdout`
* `Write for StdoutLock`
* `stderr`
* `Stderr`
* `Stderr::lock`
* `StderrLock`
* `Write for Stderr`
* `Write for StderrLock`
* `io::Result`
* `io::Error`
* `io::Error::last_os_error`
* `{Display, Error} for Error`

Unstable APIs:

(reasons can be found in the commit itself)

* `Write::flush`
* `Seek`
* `ErrorKind`
* `Error::new`
* `Error::from_os_error`
* `Error::kind`

Deprecated APIs

* `Error::description` - available via the `Error` trait
* `Error::detail` - available via the `Display` implementation
* `thread::Builder::{stdout, stderr}`

Changes in functionality:

* `old_io::stdio::set_stderr` is now a noop as the infrastructure for printing
  backtraces has migrated to `std::io`.
* The `ReadExt`, `WriteExt`, and `BufReadExt` extension traits were all removed
  by folding functionality into the corresponding trait.

[breaking-change]
2015-03-12 20:39:03 -07:00
bors
79dd393a4f Auto merge of #23229 - aturon:stab-path, r=alexcrichton
This commit stabilizes essentially all of the new `std::path` API. The
API itself is changed in a couple of ways (which brings it in closer
alignment with the RFC):

* `.` components are now normalized away, unless they appear at the
  start of a path. This in turn effects the semantics of e.g. asking for
  the file name of `foo/` or `foo/.`, both of which yield `Some("foo")`
  now. This semantics is what the original RFC specified, and is also
  desirable given early experience rolling out the new API.

* The `parent` method is now `without_file` and succeeds if, and only
  if, `file_name` is `Some(_)`. That means, in particular, that it fails
  for a path like `foo/../`. This change affects `pop` as well.

In addition, the `old_path` module is now deprecated.

[breaking-change]

r? @alexcrichton
2015-03-13 01:00:02 +00:00
Aaron Turon
42c4e481cd Stabilize std::path
This commit stabilizes essentially all of the new `std::path` API. The
API itself is changed in a couple of ways (which brings it in closer
alignment with the RFC):

* `.` components are now normalized away, unless they appear at the
  start of a path. This in turn effects the semantics of e.g. asking for
  the file name of `foo/` or `foo/.`, both of which yield `Some("foo")`
  now. This semantics is what the original RFC specified, and is also
  desirable given early experience rolling out the new API.

* The `parent` function now succeeds if, and only if, the path has at
  least one non-root/prefix component. This change affects `pop` as
  well.

* The `Prefix` component now involves a separate `PrefixComponent`
  struct, to better allow for keeping both parsed and unparsed prefix data.

In addition, the `old_path` module is now deprecated.

Closes #23264

[breaking-change]
2015-03-12 16:38:58 -07:00
bors
c9b03c24ec Auto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakis
The end result is that common fields (id, name, attributes, etc.) are stored in now-structures `ImplItem` and `TraitItem`.
The signature of a method is no longer duplicated between methods with a body (default/impl) and those without, they now share `MethodSig`.

This is also a [breaking-change] because of minor bugfixes and changes to syntax extensions:
* `pub fn` methods in a trait no longer parse - remove the `pub`, it has no meaning anymore
* `MacResult::make_methods` is now `make_impl_items` and the return type has changed accordingly
* `quote_method` is gone, because `P<ast::Method>` doesn't exist and it couldn't represent a full method anyways - could be replaced by `quote_impl_item`/`quote_trait_item` in the future, but I do hope we realize how silly that combinatorial macro expansion is and settle on a single `quote` macro + some type hints - or just no types at all (only token-trees)

r? @nikomatsakis This is necessary (hopefully also sufficient) for associated constants.
2015-03-12 20:13:23 +00:00
bors
538840bc2d Auto merge of #23245 - alexcrichton:allow-warnings-again, r=aturon
These were suppressing lots of interesting warnings! Turns out there was also
quite a bit of dead code.
2015-03-12 17:39:30 +00:00
Alex Crichton
c933d44f7b std: Remove #[allow] directives in sys modules
These were suppressing lots of interesting warnings! Turns out there was also
quite a bit of dead code.
2015-03-12 10:23:27 -07:00
bors
206ee0e853 Auto merge of #23299 - mdinger:monospace_table, r=steveklabnik
The [literals table](http://doc.rust-lang.org/reference.html#characters-and-strings) now looks ugly but compact. Add back the monospace text.
2015-03-12 13:47:20 +00:00
bors
49f7550a25 Auto merge of #23162 - sfackler:debug-builders, r=alexcrichton
I've made some minor changes from the implementation attached to the RFC to try to minimize codegen. The methods now take `&Debug` trait objects rather than being parameterized and there are inlined stub methods that call to non-inlined methods to do the work.

r? @alexcrichton 

cc @huonw for the `derive(Debug)` changes.
2015-03-12 07:30:44 +00:00
bors
8715a65496 Auto merge of #23298 - Manishearth:rollup, r=Manishearth
None
2015-03-12 04:53:31 +00:00
mdinger
fb0ee646e9 Add monospace font back to literals table 2015-03-12 00:37:47 -04:00
Manish Goregaokar
419c0ff321 Rm unused feature 2015-03-12 09:16:36 +05:30
Manish Goregaokar
7f7a3cc29d Rollup merge of #23296 - shepmaster:explain-why-joinguard-is-must-use, r=alexcrichton 2015-03-12 09:15:06 +05:30
Manish Goregaokar
3d70c7042c Rollup merge of #23295 - johnz133:patch-1, r=steveklabnik
Changed the docs to reflect that
2015-03-12 09:14:59 +05:30
Manish Goregaokar
85d836a2b2 Rollup merge of #23279 - steveklabnik:gh23244, r=alexcrichton
Fixes #23244
2015-03-12 09:14:51 +05:30
Manish Goregaokar
cc6ef80fa4 Rollup merge of #23275 - aochagavia:constants, r=eddyb
Fixes #23260

r? @eddyb
2015-03-12 09:14:44 +05:30
Manish Goregaokar
e4e5640a6e Rollup merge of #23274 - rprichard:fix-21715, r=pnkfelix
* Consumers of handle_options assume the unstable options are defined in
   the getopts::Matches value if -Z unstable-options is set, but that's not
   the case if there weren't any actual unstable options. Fix this by
   always reparsing options when -Z unstable-options is set.

 * If both argument parsing attempts fail, print the error from the second
   attempt rather than the first. The error from the first is very poor
   whenever unstable options are present. e.g.:

       $ rustc hello.rs -Z unstable-options --show-span
       error: Unrecognized option: 'show-span'.
       $ rustc hello.rs -Z unstable-options --pretty --pretty
       error: Unrecognized option: 'pretty'.
       $ rustc hello.rs -Z unstable-options --pretty --bad-option
       error: Unrecognized option: 'pretty'.

 * On the second parse, add a separate pass to reject unstable options if
   -Z unstable-options wasn't specified.

Fixes #21715.
r? @pnkfelix
2015-03-12 09:14:38 +05:30
Manish Goregaokar
99dc60dc24 Rollup merge of #23270 - frewsxcv:patch-5, r=alexcrichton
Markdown requires a newline before bullet points, and since there's not one here, they'll get rendered incorrectly
2015-03-12 09:14:31 +05:30
Manish Goregaokar
6290a344a6 Rollup merge of #23263 - alexcrichton:stabilize-from-raw-parts, r=brson
These new APIs have had some time to bake now, and no pressing issues have come
up so they should be ok for stabilizing. Specifically, these two APIs were
stabilized:

* `slice::from_raw_parts`
* `slice::from_raw_parts_mut`
2015-03-12 09:14:26 +05:30
Manish Goregaokar
34d87b29f0 Rollup merge of #23257 - jmesmon:fix-debug, r=alexcrichton
configure: have --enable-debug set -C debug-assertions=on so `debug!()` works again
2015-03-12 09:14:21 +05:30
Manish Goregaokar
e4010d1bf6 Rollup merge of #23255 - dhuseby:master, r=alexcrichton
it turns out that jemalloc doesn't behave well on bitrig.  with jemalloc enabled i get some kernel errors related to sbrk failures.  with jemalloc disabled, the errors go away.  i am investigating, but in the mean time, we should just disable jemalloc by default on bitrig.
2015-03-12 09:14:16 +05:30
Manish Goregaokar
7a9ef60e60 Rollup merge of #23247 - tbu-:pr_core_iter_rm_isize, r=huonw 2015-03-12 09:14:08 +05:30
Manish Goregaokar
9e2cf11c89 Rollup merge of #23238 - mahkoh:nativecpu, r=dotdash 2015-03-12 09:14:03 +05:30
Manish Goregaokar
497f6b77c3 Rollup merge of #23234 - Ms2ger:doc-dynamic-dispatch, r=steveklabnik 2015-03-12 09:13:58 +05:30
Manish Goregaokar
21b024ae27 Rollup merge of #22769 - :rustdocfix, r=brson
Fixes #22325
2015-03-12 09:13:53 +05:30
Manish Goregaokar
0a74387b64 Rollup merge of #23297 - steveklabnik:examples, r=huonw
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-12 09:13:47 +05:30
Manish Goregaokar
2c251fa846 Rollup merge of #23294 - dotdash:coob, r=alexcrichton
Fixes #23291
2015-03-12 09:13:42 +05:30
John Zhang
e3b717c7ce Cargo build now builds to /target/debug/, changed the docs to reflect that.
Deleted trailing space in hello-cargo.md

Added note about build --release in hello-cargo

thanks to steven klabnik for pointing it out for me

edited out redundant wording
2015-03-11 19:46:55 -07:00
Steve Klabnik
64ab111b53 Example -> Examples
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11 21:11:40 -04:00
Jake Goulding
ac6cd90af1 Explain why immediately dropping a JoinGuard is not what you want to do 2015-03-11 20:10:52 -04:00
bors
425297a930 Auto merge of #23156 - GuillaumeGomez:remove-proc, r=alexcrichton
This is the implementation of the [RFC 584](https://github.com/rust-lang/rfcs/pull/584).
2015-03-11 23:51:30 +00:00
Björn Steinbrink
de67c3a5bb Fix LLVM assertion when out-of-bounds indexing in a constant
Fixes #23291
2015-03-12 00:38:22 +01:00
Eduard Burtescu
9da918548d syntax: move MethMac to MacImplItem and combine {Provided,Required}Method into MethodTraitItem. 2015-03-11 23:39:16 +02:00
Eduard Burtescu
ce10fa8d12 syntax: rename TypeMethod to MethodSig and use it in MethDecl. 2015-03-11 23:39:16 +02:00
Eduard Burtescu
f98b176314 syntax: gather common fields of impl & trait items into their respective types. 2015-03-11 23:39:16 +02:00
Eduard Burtescu
98491827b9 syntax: move indirection around {Trait,Impl}Item, from within. 2015-03-11 23:39:15 +02:00
Ms2ger
3ac89d372f Rewrite the dynamic dispatch section to focus on usage rather than implementation. 2015-03-11 21:37:01 +01:00
Adolfo Ochagavía
a83db81238 Update tests 2015-03-11 21:17:27 +01:00
Adolfo Ochagavía
47f1d6747c First-class struct and tuple constants
Fixes #23260
2015-03-11 21:17:25 +01:00
Steven Fackler
905a611b94 Switch to a specific feature 2015-03-11 12:58:01 -07:00
Cody P Schafer
100e1a93dc mk/tests: filter more possible debug-assertions 2015-03-11 15:25:32 -04:00
Guillaume Gomez
db726faf32 Change comment in parse-fail test 2015-03-11 19:46:19 +01:00
Steve Klabnik
8934c9b560 Add note about local documentation installation
Fixes #23244
2015-03-11 13:45:55 -04:00
Ryan Prichard
61004f88d1 Improve -Z unstable-options diagnostics and avoid an ICE
* Consumers of handle_options assume the unstable options are defined in
   the getopts::Matches value if -Z unstable-options is set, but that's not
   the case if there weren't any actual unstable options. Fix this by
   always reparsing options when -Z unstable-options is set.

 * If both argument parsing attempts fail, print the error from the second
   attempt rather than the first. The error from the first is very poor
   whenever unstable options are present. e.g.:

       $ rustc hello.rs -Z unstable-options --show-span
       error: Unrecognized option: 'show-span'.
       $ rustc hello.rs -Z unstable-options --pretty --pretty
       error: Unrecognized option: 'pretty'.
       $ rustc hello.rs -Z unstable-options --pretty --bad-option
       error: Unrecognized option: 'pretty'.

 * On the second parse, add a separate pass to reject unstable options if
   -Z unstable-options wasn't specified.

Fixes #21715.
r? @pnkfelix
2015-03-11 01:42:00 -07:00
Dave Huseby
33751ff8a7 adding latest bitrig snapshot manually 2015-03-10 23:39:50 -07:00
Dave Huseby
8e082f77cf disabling jemalloc on bitrig 2015-03-10 23:39:49 -07:00
Steven Fackler
4181d43c4b Remove inline silliness from debug builders
Turns out it's basically a wash, codegen wise.
2015-03-10 21:33:04 -07:00
bors
ae4812b613 Auto merge of #23256 - apasel422:bound, r=alexcrichton 2015-03-11 04:07:16 +00:00
Steven Fackler
3181213f91 Fix unstable span checks 2015-03-10 19:47:57 -07:00
Corey Farwell
d6492e2469 Fix markdown bullet points in function docs
Markdown requires a newline before bullet points, and since there's not one here, they'll get rendered incorrectly
2015-03-10 22:47:08 -04:00
bors
f899513a30 Auto merge of #23251 - tbu-:pr_rm_core_str_checked_add, r=alexcrichton 2015-03-11 01:39:49 +00:00