]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRollup merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:43:44 +0000 (05:13 +0530)]
Rollup merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton

 Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor interprets both lines as the same paragraph and includes both into the short summary resulting in
![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)

9 years agoAuto merge of #23313 - barosl:match-specialize-ice, r=jakub-
bors [Sun, 15 Mar 2015 00:39:54 +0000 (00:39 +0000)]
Auto merge of #23313 - barosl:match-specialize-ice, r=jakub-

The arity of `ref x` is always 1, so it needs to be dereferenced before being compared with some other type whose arity is not 1.

Fixes #23009.

9 years agoAuto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichton
bors [Sat, 14 Mar 2015 22:07:25 +0000 (22:07 +0000)]
Auto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichton

This adds search by type (for functions/methods) support to Rustdoc. Target issue is at https://github.com/rust-lang/rfcs/issues/658.

I've described my approach here: https://github.com/rust-lang/rfcs/issues/658#issuecomment-76484200. I'll copy the text in here as well:

---

Hi, it took me longer than I wished, but I have implemented this in a not-too-complex way that I think can be extended to support more complex features (like the ones mentioned [here](https://github.com/rust-lang/rust/issues/12866#issuecomment-66945317)).

The idea is to generate a JSON representation of the types of methods/functions in the existing index, and then make the JS understand when it should look by type (and not by name).

I tried to come up with a JSON representation that can be extended to support generics, bounds, ref/mut annotations and so on. Here are a few samples:

Function:

```rust
fn to_uppercase(c: char) -> char
```

```json
{
    "inputs": [
        {"name": "char"}
    ],
    "output": {
        "name": "char",
    }
}
```

Method (implemented or defined in trait):

```rust
// in struct Vec
// self is considered an argument as well
fn capacity(&self) -> usize
```

```json
{
    "inputs": [
        {"name": "vec"}
    ],
    "output": {
        "name": "usize"
    }
}
```

This simple format can be extended by adding more fields, like `generic: bool`, a `bounds` mapping and so on.

I have a working implementation in https://github.com/rust-lang/rust/compare/master...mihneadb:rustdoc-search-by-type. You can check out a live demo [here](http://data.mihneadb.net/doc/std/index.html?search=charext%20-%3E%20char).

![screenshot from 2015-02-28 00 54 00](https://cloud.githubusercontent.com/assets/643127/6422722/7e5374ee-bee4-11e4-99a6-9aac3c9d5068.png)

The feature list is not that long:
- search by types (you *can* use generics as well, as long as you use the exact name - e.g. [`vec,t -> `](http://data.mihneadb.net/doc/std/index.html?search=vec%2C%20t%20-%3E))
- order of arguments does not matter
- `self` is took into account as well (e.g. search for `vec -> usize`)
- does not use "complex" annotations (e.g. you don't search for `&char -> char` but for `char -> char`)

My goal is to get a working, minimal "base" merged so that others can build upon it. How should I proceed? Do I open a PR (badly in need of code review since this is my first non "hello world"-ish rust code)?

---

9 years agoAdd support to search functions by type to rustdoc.
Mihnea Dobrescu-Balaur [Wed, 25 Feb 2015 23:03:06 +0000 (01:03 +0200)]
Add support to search functions by type to rustdoc.

9 years agoAuto merge of #23357 - Manishearth:oops, r=Manishearth
bors [Sat, 14 Mar 2015 16:59:06 +0000 (16:59 +0000)]
Auto merge of #23357 - Manishearth:oops, r=Manishearth

Oops, merged #21468 by accident.

9 years agocheck_match: Dereference `ref x` before comparing it and some other type
Barosl Lee [Wed, 11 Mar 2015 16:36:52 +0000 (01:36 +0900)]
check_match: Dereference `ref x` before comparing it and some other type

The arity of `ref x` is always 1, so it needs to be dereferenced before
being compared with some other type whose arity is not 1.

Fixes #23009.

9 years agoSplit rustdoc summary lines in a smarter way
Simonas Kazlauskas [Fri, 13 Mar 2015 22:45:39 +0000 (00:45 +0200)]
Split rustdoc summary lines in a smarter way

Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor would interpret both lines as the same paragraph and include both into the short summary.

9 years agoAuto merge of #23333 - oli-obk:slice_from_raw_parts, r=alexcrichton
bors [Sat, 14 Mar 2015 08:55:31 +0000 (08:55 +0000)]
Auto merge of #23333 - oli-obk:slice_from_raw_parts, r=alexcrichton

at least that's what the docs say: http://doc.rust-lang.org/std/slice/fn.from_raw_parts.html

A few situations got prettier. In some situations the mutability of the resulting and source pointers differed (and was cast away by transmute), the mutability matches now.

9 years agoRevert "Extend dead code lint to detect more unused enum variants"
Manish Goregaokar [Sat, 14 Mar 2015 06:44:32 +0000 (12:14 +0530)]
Revert "Extend dead code lint to detect more unused enum variants"

This reverts commit b042ffc4a768c2bd6d7588b1b2f47af22669c2cb.

Conflicts:
src/librustc/middle/pat_util.rs

9 years agoRevert "Remove dead code flagged by lint"
Manish Goregaokar [Sat, 14 Mar 2015 06:44:03 +0000 (12:14 +0530)]
Revert "Remove dead code flagged by lint"

This reverts commit bce7a6f4a9edd23c73bf4fc390db3037895c1850.

9 years agoAuto merge of #22948 - rprichard:simple-panic-opt, r=alexcrichton
bors [Sat, 14 Mar 2015 01:04:37 +0000 (01:04 +0000)]
Auto merge of #22948 - rprichard:simple-panic-opt, r=alexcrichton

Reduce code size overhead from core::panicking::panic

core::panicking::panic currently creates an Arguments structure using
format_args!("{}", expr), which formats the expr str using the Display::fmt.
Display::fmt pulls in Formatter::pad, which then also pulls in string-related
code for truncation and padding.

If core::panicking::panic instead creates an Arguments structure with a string
piece, it is possible that the Display::fmt function for str can be optimized
out of the program.

In my testing with a 32-bit x86 bare metal program, the change tended to save
between ~100 bytes and ~5500 bytes, depending on what other panic* functions
the program invokes and whether the panic_fmt lang item uses the Arguments
value.

9 years agoAuto merge of #23292 - alexcrichton:stabilize-io, r=aturon
bors [Fri, 13 Mar 2015 20:22:16 +0000 (20:22 +0000)]
Auto merge of #23292 - alexcrichton:stabilize-io, r=aturon

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.
* `ReadExt`
* `Write`
* `Write::write`
* `Write::{write_all, write_fmt}`
* `WriteExt`
* `BufRead`
* `BufRead::{fill_buf, consume}`
* `BufRead::{read_line, read_until}` after being modified to return a `usize`
  for the number of bytes read.
* `BufReadExt`
* `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`.

[breaking-change]

9 years agoAuto merge of #23337 - Manishearth:rollup, r=Manishearth
bors [Fri, 13 Mar 2015 17:49:15 +0000 (17:49 +0000)]
Auto merge of #23337 - Manishearth:rollup, r=Manishearth

r? @Manishearth

9 years agoFallout of std::old_io deprecation
Alex Crichton [Wed, 11 Mar 2015 22:24:14 +0000 (15:24 -0700)]
Fallout of std::old_io deprecation

9 years agorm unused import
Manish Goregaokar [Fri, 13 Mar 2015 14:22:18 +0000 (19:52 +0530)]
rm unused import

9 years agoFix def -> PathResolution
Manish Goregaokar [Fri, 13 Mar 2015 14:21:09 +0000 (19:51 +0530)]
Fix def -> PathResolution

9 years agoRollup merge of #21468 - sanxiyn:dead-variant, r=
Manish Goregaokar [Fri, 13 Mar 2015 12:42:05 +0000 (18:12 +0530)]
Rollup merge of #21468 - sanxiyn:dead-variant, r=

 This implements a wish suggested in #17410, detecting enum variants that are never constructed, even in the presence of `#[derive(Clone)]`. The implementation is general and not specific to `#[derive(Clone)]`.

r? @jakub-

9 years agoRollup merge of #23324 - rprichard:fix-freebsd, r=brson
Manish Goregaokar [Fri, 13 Mar 2015 12:41:57 +0000 (18:11 +0530)]
Rollup merge of #23324 - rprichard:fix-freebsd, r=brson

 Currently, target.mk passes -L \"\" when LLVM_STDCPP_LOCATION_$(2) is empty.

This fixes #23287.

9 years agoRollup merge of #23322 - dotdash:jemalloc_attrs, r=brson
Manish Goregaokar [Fri, 13 Mar 2015 12:41:51 +0000 (18:11 +0530)]
Rollup merge of #23322 - dotdash:jemalloc_attrs, r=brson

 When this attribute is applied to a function, its return value gets the
noalias attribute, which is how you tell LLVM that the function returns
a \"new\" pointer that doesn't alias anything accessible to the caller,
i.e. it acts like a memory allocator.

Plain malloc doesn't need this attribute because LLVM already knows
about malloc and adds the attribute itself.

9 years agoRollup merge of #23321 - apasel422:hash, r=alexcrichton
Manish Goregaokar [Fri, 13 Mar 2015 12:41:46 +0000 (18:11 +0530)]
Rollup merge of #23321 - apasel422:hash, r=alexcrichton

 It is no longer possible to specialize on the `Hasher` because it moved to a method-level type parameter.

9 years agoRollup merge of #23317 - tanadeau:fix-formatting-and-grammar, r=steveklabnik
Manish Goregaokar [Fri, 13 Mar 2015 12:41:40 +0000 (18:11 +0530)]
Rollup merge of #23317 - tanadeau:fix-formatting-and-grammar, r=steveklabnik

 Fixed grammar errors (incorrect uses of commas and \"you're\" instead of \"your\") and broke up a long line.

r? @steveklabnik

9 years agoRollup merge of #23312 - gkoz:ptr_from_box_docs, r=steveklabnik
Manish Goregaokar [Fri, 13 Mar 2015 12:41:34 +0000 (18:11 +0530)]
Rollup merge of #23312 - gkoz:ptr_from_box_docs, r=steveklabnik

 Show how to get a pointer without destroying the box.
Use `boxed::into_raw` instead of `mem::transmute`.

I removed the `let my_num: *const i32 = mem::transmute(my_num);` case altogether because we own the box, a `*mut` pointer is good anywhere a `*const` is needed, `from_raw` takes a mutable pointer and casting from a `*const` caused an ICE.

9 years agoRollup merge of #23328 - alexcrichton:rustdoc-default-impl, r=brson
Manish Goregaokar [Fri, 13 Mar 2015 12:41:27 +0000 (18:11 +0530)]
Rollup merge of #23328 - alexcrichton:rustdoc-default-impl, r=brson

 This adds a special code path for impls which are listed as default impls to
ensure that they're loaded correctly.

9 years agoRollup merge of #23325 - brson:beta, r=alexcrichton
Manish Goregaokar [Fri, 13 Mar 2015 12:41:21 +0000 (18:11 +0530)]
Rollup merge of #23325 - brson:beta, r=alexcrichton

 This is the second time I've made this typo.

9 years agoRollup merge of #23310 - michaelwoerister:gdb-std-pp, r=alexcrichton
Manish Goregaokar [Fri, 13 Mar 2015 12:41:13 +0000 (18:11 +0530)]
Rollup merge of #23310 - michaelwoerister:gdb-std-pp, r=alexcrichton

 ```rust
Rust:  let slice: &[i32] = &[0, 1, 2, 3];
GDB:   $1 = &[i32](len: 4) = {0, 1, 2, 3}

Rust:  let vec = vec![4, 5, 6, 7];
GDB:   $2 = Vec<u64>(len: 4, cap: 4) = {4, 5, 6, 7}

Rust:  let str_slice = \"IAMA string slice!\";
GDB:   $3 = \"IAMA string slice!\"

Rust:  let string = \"IAMA string!\".to_string();
GDB:   $4 = \"IAMA string!\"
```
Neat!

9 years agoRollup merge of #23307 - michaelwoerister:lldb-vec-pp-bug, r=alexcrichton
Manish Goregaokar [Fri, 13 Mar 2015 12:41:07 +0000 (18:11 +0530)]
Rollup merge of #23307 - michaelwoerister:lldb-vec-pp-bug, r=alexcrichton

 Fixes #22656. Also adds a nice pretty printer for `Vec`.

9 years agofix tests
Oliver Schneider [Fri, 13 Mar 2015 12:09:34 +0000 (13:09 +0100)]
fix tests

9 years agoAuto merge of #23307 - michaelwoerister:lldb-vec-pp-bug, r=alexcrichton
bors [Fri, 13 Mar 2015 11:44:47 +0000 (11:44 +0000)]
Auto merge of #23307 - michaelwoerister:lldb-vec-pp-bug, r=alexcrichton

Fixes #22656. Also adds a nice pretty printer for `Vec`.

9 years agoslice::from_raw_parts is preferred over transmuting a fresh raw::Slice
Oliver Schneider [Fri, 13 Mar 2015 08:56:18 +0000 (09:56 +0100)]
slice::from_raw_parts is preferred over transmuting a fresh raw::Slice

9 years agorustdoc: Fix ICE with cross-crate default impls
Alex Crichton [Fri, 13 Mar 2015 02:15:52 +0000 (19:15 -0700)]
rustdoc: Fix ICE with cross-crate default impls

This adds a special code path for impls which are listed as default impls to
ensure that they're loaded correctly.

9 years agostd: Stabilize the `io` module
Alex Crichton [Wed, 11 Mar 2015 21:16:46 +0000 (14:16 -0700)]
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]

9 years agoAdd an "allocator" attribute to mark functions as allocators
Björn Steinbrink [Fri, 13 Mar 2015 02:19:30 +0000 (03:19 +0100)]
Add an "allocator" attribute to mark functions as allocators

When this attribute is applied to a function, its return value gets the
noalias attribute, which is how you tell LLVM that the function returns
a "new" pointer that doesn't alias anything accessible to the caller,
i.e. it acts like a memory allocator.

Plain malloc doesn't need this attribute because LLVM already knows
about malloc and adds the attribute itself.

9 years agoAuto merge of #23229 - aturon:stab-path, r=alexcrichton
bors [Fri, 13 Mar 2015 01:00:02 +0000 (01:00 +0000)]
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

9 years agoFix naming of beta artifacts again
Brian Anderson [Fri, 13 Mar 2015 00:37:51 +0000 (17:37 -0700)]
Fix naming of beta artifacts again

9 years agoStabilize std::path
Aaron Turon [Mon, 9 Mar 2015 15:49:10 +0000 (08:49 -0700)]
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]

9 years agoremove mention of specialization from `Hash` trait
Andrew Paseltiner [Thu, 12 Mar 2015 22:09:52 +0000 (18:09 -0400)]
remove mention of specialization from `Hash` trait

It is no longer possible to specialize on the `Hasher` because it moved
to a method-level type parameter.

9 years agoFixed several grammar errors and broke up very long line.
Trent Nadeau [Thu, 12 Mar 2015 21:00:35 +0000 (17:00 -0400)]
Fixed several grammar errors and broke up very long line.

9 years agoAuto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakis
bors [Thu, 12 Mar 2015 20:13:23 +0000 (20:13 +0000)]
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.

9 years agoUpdate the ways to get a pointer from a box
Gleb Kozyrev [Thu, 12 Mar 2015 15:09:26 +0000 (17:09 +0200)]
Update the ways to get a pointer from a box

Show how to get a pointer without destroying the box.
Use `boxed::into_raw` instead of `mem::transmute`.

9 years agoAuto merge of #23245 - alexcrichton:allow-warnings-again, r=aturon
bors [Thu, 12 Mar 2015 17:39:30 +0000 (17:39 +0000)]
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.

9 years agostd: Remove #[allow] directives in sys modules
Alex Crichton [Tue, 10 Mar 2015 03:04:35 +0000 (20:04 -0700)]
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.

9 years agodebuginfo: Add GDB pretty printers for slices, Vec<>, and String.
Michael Woerister [Thu, 12 Mar 2015 16:05:44 +0000 (17:05 +0100)]
debuginfo: Add GDB pretty printers for slices, Vec<>, and String.

9 years agoAuto merge of #23299 - mdinger:monospace_table, r=steveklabnik
bors [Thu, 12 Mar 2015 13:47:20 +0000 (13:47 +0000)]
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.

9 years agodebuginfo: Make LLDB pretty printer correctly handle zero-sized fields.
Michael Woerister [Thu, 12 Mar 2015 11:18:15 +0000 (12:18 +0100)]
debuginfo: Make LLDB pretty printer correctly handle zero-sized fields.

9 years agoAvoid passing -L "" to rustc.
Ryan Prichard [Thu, 12 Mar 2015 11:09:12 +0000 (04:09 -0700)]
Avoid passing -L "" to rustc.

Currently, target.mk passes -L "" when LLVM_STDCPP_LOCATION_$(2) is empty.

This fixes #23287.

9 years agoAuto merge of #23162 - sfackler:debug-builders, r=alexcrichton
bors [Thu, 12 Mar 2015 07:30:44 +0000 (07:30 +0000)]
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.

9 years agoAuto merge of #23298 - Manishearth:rollup, r=Manishearth
bors [Thu, 12 Mar 2015 04:53:31 +0000 (04:53 +0000)]
Auto merge of #23298 - Manishearth:rollup, r=Manishearth

None

9 years agoAdd monospace font back to literals table
mdinger [Thu, 12 Mar 2015 04:24:48 +0000 (00:24 -0400)]
Add monospace font back to literals table

9 years agoRm unused feature
Manish Goregaokar [Wed, 11 Mar 2015 09:13:37 +0000 (14:43 +0530)]
Rm unused feature

9 years agoRollup merge of #23296 - shepmaster:explain-why-joinguard-is-must-use, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:45:06 +0000 (09:15 +0530)]
Rollup merge of #23296 - shepmaster:explain-why-joinguard-is-must-use, r=alexcrichton

9 years agoRollup merge of #23295 - johnz133:patch-1, r=steveklabnik
Manish Goregaokar [Thu, 12 Mar 2015 03:44:59 +0000 (09:14 +0530)]
Rollup merge of #23295 - johnz133:patch-1, r=steveklabnik

 Changed the docs to reflect that

9 years agoRollup merge of #23279 - steveklabnik:gh23244, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:44:51 +0000 (09:14 +0530)]
Rollup merge of #23279 - steveklabnik:gh23244, r=alexcrichton

 Fixes #23244

9 years agoRollup merge of #23275 - aochagavia:constants, r=eddyb
Manish Goregaokar [Thu, 12 Mar 2015 03:44:44 +0000 (09:14 +0530)]
Rollup merge of #23275 - aochagavia:constants, r=eddyb

 Fixes #23260

r? @eddyb

9 years agoRollup merge of #23274 - rprichard:fix-21715, r=pnkfelix
Manish Goregaokar [Thu, 12 Mar 2015 03:44:38 +0000 (09:14 +0530)]
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

9 years agoRollup merge of #23270 - frewsxcv:patch-5, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:44:31 +0000 (09:14 +0530)]
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

9 years agoRollup merge of #23263 - alexcrichton:stabilize-from-raw-parts, r=brson
Manish Goregaokar [Thu, 12 Mar 2015 03:44:26 +0000 (09:14 +0530)]
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`

9 years agoRollup merge of #23257 - jmesmon:fix-debug, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:44:21 +0000 (09:14 +0530)]
Rollup merge of #23257 - jmesmon:fix-debug, r=alexcrichton

 configure: have --enable-debug set -C debug-assertions=on so `debug!()` works again

9 years agoRollup merge of #23255 - dhuseby:master, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:44:16 +0000 (09:14 +0530)]
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.

9 years agoRollup merge of #23247 - tbu-:pr_core_iter_rm_isize, r=huonw
Manish Goregaokar [Thu, 12 Mar 2015 03:44:08 +0000 (09:14 +0530)]
Rollup merge of #23247 - tbu-:pr_core_iter_rm_isize, r=huonw

9 years agoRollup merge of #23238 - mahkoh:nativecpu, r=dotdash
Manish Goregaokar [Thu, 12 Mar 2015 03:44:03 +0000 (09:14 +0530)]
Rollup merge of #23238 - mahkoh:nativecpu, r=dotdash

9 years agoRollup merge of #23234 - Ms2ger:doc-dynamic-dispatch, r=steveklabnik
Manish Goregaokar [Thu, 12 Mar 2015 03:43:58 +0000 (09:13 +0530)]
Rollup merge of #23234 - Ms2ger:doc-dynamic-dispatch, r=steveklabnik

9 years agoRollup merge of #22769 - :rustdocfix, r=brson
Manish Goregaokar [Thu, 12 Mar 2015 03:43:53 +0000 (09:13 +0530)]
Rollup merge of #22769 - :rustdocfix, r=brson

 Fixes #22325

9 years agoRollup merge of #23297 - steveklabnik:examples, r=huonw
Manish Goregaokar [Thu, 12 Mar 2015 03:43:47 +0000 (09:13 +0530)]
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

9 years agoRollup merge of #23294 - dotdash:coob, r=alexcrichton
Manish Goregaokar [Thu, 12 Mar 2015 03:43:42 +0000 (09:13 +0530)]
Rollup merge of #23294 - dotdash:coob, r=alexcrichton

 Fixes #23291

9 years agoCargo build now builds to /target/debug/, changed the docs to reflect that.
John Zhang [Wed, 11 Mar 2015 23:48:32 +0000 (16:48 -0700)]
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

9 years agoExample -> Examples
Steve Klabnik [Thu, 12 Mar 2015 01:11:40 +0000 (21:11 -0400)]
Example -> Examples

This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown

9 years agoExplain why immediately dropping a JoinGuard is not what you want to do
Jake Goulding [Thu, 12 Mar 2015 00:10:52 +0000 (20:10 -0400)]
Explain why immediately dropping a JoinGuard is not what you want to do

9 years agoAuto merge of #23156 - GuillaumeGomez:remove-proc, r=alexcrichton
bors [Wed, 11 Mar 2015 23:51:30 +0000 (23:51 +0000)]
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).

9 years agoFix LLVM assertion when out-of-bounds indexing in a constant
Björn Steinbrink [Wed, 11 Mar 2015 23:19:37 +0000 (00:19 +0100)]
Fix LLVM assertion when out-of-bounds indexing in a constant

Fixes #23291

9 years agosyntax: move MethMac to MacImplItem and combine {Provided,Required}Method into Method...
Eduard Burtescu [Wed, 11 Mar 2015 21:38:58 +0000 (23:38 +0200)]
syntax: move MethMac to MacImplItem and combine {Provided,Required}Method into MethodTraitItem.

9 years agosyntax: rename TypeMethod to MethodSig and use it in MethDecl.
Eduard Burtescu [Wed, 11 Mar 2015 06:38:27 +0000 (08:38 +0200)]
syntax: rename TypeMethod to MethodSig and use it in MethDecl.

9 years agosyntax: gather common fields of impl & trait items into their respective types.
Eduard Burtescu [Tue, 10 Mar 2015 10:28:44 +0000 (12:28 +0200)]
syntax: gather common fields of impl & trait items into their respective types.

9 years agosyntax: move indirection around {Trait,Impl}Item, from within.
Eduard Burtescu [Thu, 5 Mar 2015 02:48:54 +0000 (04:48 +0200)]
syntax: move indirection around {Trait,Impl}Item, from within.

9 years agoRewrite the dynamic dispatch section to focus on usage rather than implementation.
Ms2ger [Mon, 9 Mar 2015 23:17:01 +0000 (00:17 +0100)]
Rewrite the dynamic dispatch section to focus on usage rather than implementation.

9 years agoUpdate tests
Adolfo Ochagavía [Wed, 11 Mar 2015 09:57:12 +0000 (10:57 +0100)]
Update tests

9 years agoFirst-class struct and tuple constants
Adolfo Ochagavía [Sun, 8 Mar 2015 15:41:28 +0000 (16:41 +0100)]
First-class struct and tuple constants

Fixes #23260

9 years agoSwitch to a specific feature
Steven Fackler [Wed, 11 Mar 2015 19:58:01 +0000 (12:58 -0700)]
Switch to a specific feature

9 years agomk/tests: filter more possible debug-assertions
Cody P Schafer [Wed, 11 Mar 2015 19:03:25 +0000 (15:03 -0400)]
mk/tests: filter more possible debug-assertions

9 years agoChange comment in parse-fail test
Guillaume Gomez [Wed, 11 Mar 2015 18:46:19 +0000 (19:46 +0100)]
Change comment in parse-fail test

9 years agoAdd note about local documentation installation
Steve Klabnik [Wed, 11 Mar 2015 17:45:55 +0000 (13:45 -0400)]
Add note about local documentation installation

Fixes #23244

9 years agoImprove -Z unstable-options diagnostics and avoid an ICE
Ryan Prichard [Wed, 11 Mar 2015 08:42:00 +0000 (01:42 -0700)]
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

9 years agoadding latest bitrig snapshot manually
Dave Huseby [Tue, 10 Mar 2015 17:59:46 +0000 (10:59 -0700)]
adding latest bitrig snapshot manually

9 years agodisabling jemalloc on bitrig
Dave Huseby [Tue, 10 Mar 2015 17:20:05 +0000 (10:20 -0700)]
disabling jemalloc on bitrig

9 years agoRemove core::panicking::panic's dependence on str's Display::fmt impl
Ryan Prichard [Mon, 2 Mar 2015 01:25:23 +0000 (17:25 -0800)]
Remove core::panicking::panic's dependence on str's Display::fmt impl

Display::fmt for str calls into Formatter::pad, which is modest in size
and also pulls in string-related functions for its truncation and padding
abilities.  For size-critical programs (e.g. embedded), this call site
may be the only reason Formatter::pad is linked into the output.

9 years agoRemove inline silliness from debug builders
Steven Fackler [Wed, 11 Mar 2015 04:33:04 +0000 (21:33 -0700)]
Remove inline silliness from debug builders

Turns out it's basically a wash, codegen wise.

9 years agoAuto merge of #23256 - apasel422:bound, r=alexcrichton
bors [Wed, 11 Mar 2015 04:07:16 +0000 (04:07 +0000)]
Auto merge of #23256 - apasel422:bound, r=alexcrichton

9 years agoFix unstable span checks
Steven Fackler [Wed, 11 Mar 2015 02:47:57 +0000 (19:47 -0700)]
Fix unstable span checks

9 years agoFix markdown bullet points in function docs
Corey Farwell [Wed, 11 Mar 2015 02:47:08 +0000 (22:47 -0400)]
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

9 years agoAuto merge of #23251 - tbu-:pr_rm_core_str_checked_add, r=alexcrichton
bors [Wed, 11 Mar 2015 01:39:49 +0000 (01:39 +0000)]
Auto merge of #23251 - tbu-:pr_rm_core_str_checked_add, r=alexcrichton

9 years agoRemove ProcType and ProcExp
Guillaume Gomez [Tue, 10 Mar 2015 23:09:42 +0000 (00:09 +0100)]
Remove ProcType and ProcExp

9 years agoAuto merge of #23126 - alexcrichton:char-third-pass, r=aturon
bors [Tue, 10 Mar 2015 22:45:10 +0000 (22:45 +0000)]
Auto merge of #23126 - alexcrichton:char-third-pass, r=aturon

This commit performs another pass over the `std::char` module for stabilization.
Some minor cleanup is performed such as migrating documentation from libcore to
libunicode (where the `std`-facing trait resides) as well as a slight
reorganiation in libunicode itself. Otherwise, the stability modifications made
are:

* `char::from_digit` is now stable
* `CharExt::is_digit` is now stable
* `CharExt::to_digit` is now stable
* `CharExt::to_{lower,upper}case` are now stable after being modified to return
  an iterator over characters. While the implementation today has not changed
  this should allow us to implement the full set of case conversions in unicode
  where some characters can map to multiple when doing an upper or lower case
  mapping.
* `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not
  having to worry about characters expanding to more characters when you just
  want the whole string to get into upper or lower case.

This is a breaking change due to the change in the signatures of the
`CharExt::to_{upper,lower}case` methods. Code can be updated to use functions
like `flat_map` or `collect` to handle the difference.

[breaking-change]

Closes #20333

9 years agostd: Stabilize more of the `char` module
Alex Crichton [Fri, 6 Mar 2015 02:23:57 +0000 (18:23 -0800)]
std: Stabilize more of the `char` module

This commit performs another pass over the `std::char` module for stabilization.
Some minor cleanup is performed such as migrating documentation from libcore to
libunicode (where the `std`-facing trait resides) as well as a slight
reorganiation in libunicode itself. Otherwise, the stability modifications made
are:

* `char::from_digit` is now stable
* `CharExt::is_digit` is now stable
* `CharExt::to_digit` is now stable
* `CharExt::to_{lower,upper}case` are now stable after being modified to return
  an iterator over characters. While the implementation today has not changed
  this should allow us to implement the full set of case conversions in unicode
  where some characters can map to multiple when doing an upper or lower case
  mapping.
* `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not
  having to worry about characters expanding to more characters when you just
  want the whole string to get into upper or lower case.

This is a breaking change due to the change in the signatures of the
`CharExt::to_{upper,lower}case` methods. Code can be updated to use functions
like `flat_map` or `collect` to handle the difference.

[breaking-change]

9 years agoRemove proc keyword
Guillaume Gomez [Sat, 7 Mar 2015 23:58:45 +0000 (00:58 +0100)]
Remove proc keyword

9 years agostd: Stabilize slice::from_raw_parts
Alex Crichton [Tue, 10 Mar 2015 20:45:08 +0000 (13:45 -0700)]
std: Stabilize slice::from_raw_parts

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`

9 years agoAuto merge of #23249 - tbu-:pr_rm_core_str_macros, r=alexcrichton
bors [Tue, 10 Mar 2015 20:20:15 +0000 (20:20 +0000)]
Auto merge of #23249 - tbu-:pr_rm_core_str_macros, r=alexcrichton

9 years agoconfigure: have --enable-debug set -C debug-assertions=on so `debug!()` works again
Cody P Schafer [Mon, 9 Mar 2015 20:33:48 +0000 (16:33 -0400)]
configure: have --enable-debug set -C debug-assertions=on so `debug!()` works again

9 years agoderive common traits for `collections::Bound`
Andrew Paseltiner [Tue, 10 Mar 2015 17:50:35 +0000 (13:50 -0400)]
derive common traits for `collections::Bound`

9 years agoAuto merge of #23250 - liigo:plain-summary-line, r=alexcrichton
bors [Tue, 10 Mar 2015 17:20:43 +0000 (17:20 +0000)]
Auto merge of #23250 - liigo:plain-summary-line, r=alexcrichton

this feature was broken by mistake some days ago: @2b11a80
(line 2201: https://github.com/rust-lang/rust/commit/2b11a80#diff-05c3c8b7c08a25764218b8c18d8204b7L2201)

r? @alexcrichton

9 years agoAuto merge of #23028 - Munksgaard:get_attrs_opt, r=eddyb
bors [Tue, 10 Mar 2015 14:50:40 +0000 (14:50 +0000)]
Auto merge of #23028 - Munksgaard:get_attrs_opt, r=eddyb

This is more flexible and less error-prone. `get_attrs` and
`get_attrs_opt` can be used on many more items than the old `get_attrs`
could.

This is all courtesy of @huonw, and directly taken from here:
https://github.com/rust-lang/rust/pull/22348/files#diff-0f85fcb07fb739876892e633fa0e2be6R5575

Also thanks to @Manishearth for pointing it out to me.

9 years agoget_attrs: use tcx.map.attrs
Philip Munksgaard [Wed, 4 Mar 2015 14:47:28 +0000 (15:47 +0100)]
get_attrs: use tcx.map.attrs

This is more flexible and less error-prone. `get_attrs` can now be used
on many more types of items.