]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton
bors [Sat, 30 Jul 2016 20:04:30 +0000 (13:04 -0700)]
Auto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton

Only export #[no_mangle] extern symbols during LTO

Fixes #34985

7 years agoAuto merge of #35117 - aravind-pg:path, r=alexcrichton
bors [Sat, 30 Jul 2016 17:11:33 +0000 (10:11 -0700)]
Auto merge of #35117 - aravind-pg:path, r=alexcrichton

On Windows, ensure PATH does not contain invalid character `"`

Fixes #34959.

r? @alexcrichton

7 years agoAuto merge of #35127 - Manishearth:rollup, r=Manishearth
bors [Sat, 30 Jul 2016 11:35:39 +0000 (04:35 -0700)]
Auto merge of #35127 - Manishearth:rollup, r=Manishearth

Rollup of 8 pull requests

- Successful merges: #35049, #35058, #35063, #35080, #35090, #35094, #35104, #35106
- Failed merges:

7 years agoRollup merge of #35106 - xen0n:issue-35082, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichton

syntax_ext: format: fix ICE with bad named arguments

Fixes #35082 by guarding against a new case of malformed invocation not previously covered.

r? @alexcrichton

7 years agoRollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik

Rewrite `collections::LinkedList::append` doc example.

None

7 years agoRollup merge of #35094 - mcarton:multispan, r=jonathandturner
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35094 - mcarton:multispan, r=jonathandturner

Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f80577d38ec35fcebd64d5970b15f78.

That commit removed the only way to make a suggestion with more than one substitute. That feature is not used directly by rustc but exists and is used by Clippy. Bring it back until we come up with a better solution (suggestions don't use span labels, so it would make sense for them to use their own type).
Rational there: https://github.com/Manishearth/rust-clippy/pull/1119.

r? @jonathandturner
Cc @Manishearth

7 years agoRollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb

intravisit: Fold functionality of IdVisitor into the regular Visitor.

7 years agoRollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis

Rename _ to {integer} and {float} for unknown numeric types

This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down.

Example:
```rust
fn main() {
    let x: String = 4;
}
```

Before:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `_`

error: aborting due to previous error
```

after:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `{integer}`

error: aborting due to previous error
```
```

7 years agoRollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc

resolve: Exclude inaccessible names from single imports

If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

r? @nrc

7 years agoRollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton

Add non-panicking abs() functions to all signed integer types.

Currently, calling abs() on one of the signed integer types might panic (in
debug mode at least) because the absolute value of the largest negative value
can not be represented in that signed type. Unlike all other integer
operations, there is currently not a non-panicking version on this function.
This seems to just be an oversight in the design, therefore just adding it now.

7 years agoRollup merge of #35049 - knight42:add-test, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35049 - knight42:add-test, r=alexcrichton

Add a test for AddAssign on String

Fix #35047

7 years agoAuto merge of #35051 - japaric:backtrace, r=alexcrichton
bors [Sat, 30 Jul 2016 07:08:24 +0000 (00:08 -0700)]
Auto merge of #35051 - japaric:backtrace, r=alexcrichton

rustbuild: make backtraces (RUST_BACKTRACE) optional

but keep them enabled by default to maintain the status quo.

When disabled shaves ~56KB off every x86_64-unknown-linux-gnu
binary.

To disable backtraces you have to use a config.toml (see
src/bootstrap/config.toml.example for details) when building rustc/std:

$ python bootstrap.py --config=config.toml

---

r? @alexcrichton
cc rust-lang/rfcs#1417

7 years agoAuto merge of #35032 - vadimcn:rusty-ehabi, r=alexcrichton
bors [Sat, 30 Jul 2016 03:29:43 +0000 (20:29 -0700)]
Auto merge of #35032 - vadimcn:rusty-ehabi, r=alexcrichton

Implement ARM personality routine in Rust.

Remove the `eh_personality_catch` lang item.
Use a simplified version of `cfg_if!` in libunwind.

Closes #34786

7 years agoAuto merge of #34842 - cgswords:attr_enc, r=nrc
bors [Fri, 29 Jul 2016 23:26:38 +0000 (16:26 -0700)]
Auto merge of #34842 - cgswords:attr_enc, r=nrc

Better attribute and metaitem encapsulation throughout the compiler

This PR refactors most (hopefully all?) of the `MetaItem` interactions outside of `libsyntax` (and a few inside) to interact with MetaItems through the provided traits instead of directly creating / destruct / matching against them. This is a necessary first step to eventually converting `MetaItem`s to internally use `TokenStream` representations (which will make `MetaItem` interactions much nicer for macro writers once the new macro system is in place).

r? @nrc

7 years agoAuto merge of #35100 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 29 Jul 2016 10:28:01 +0000 (03:28 -0700)]
Auto merge of #35100 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #34258, #34894, #35050, #35062, #35066, #35072, #35087
- Failed merges:

7 years agoRollup merge of #35103 - brettcannon:patch-1, r=Manishearth
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35103 - brettcannon:patch-1, r=Manishearth

Try to clear up some awkward wording

7 years agoRollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnik

Fs docs

Fixes #29356.

r? @steveklabnik

7 years agoRollup merge of #35072 - munyari:assert_debug, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35072 - munyari:assert_debug, r=steveklabnik

Update docs for assert! and debug_assert!

Refer to #34455

7 years agoRollup merge of #35066 - vadimcn:fix-typos, r=apasel422
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35066 - vadimcn:fix-typos, r=apasel422

Fix typos

r? @steveklabnik

7 years agoRollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomez
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomez

Add documentation example for `str::Chars::as_str`.

None

7 years agoRollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnik

More intuitive explantion of strings formatting

7 years agoRollup merge of #34258 - durka:patch-25, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #34258 - durka:patch-25, r=steveklabnik

book/ffi: nullable pointer cleanup

Expand the "nullable pointer optimization" section with a code example. Fixes #34250.

I also noticed that many of the examples use the libc crate just for types such as `c_char` and `c_int`, which are now available through `std::os::raw`. I changed the ones that don't need to rely on libc. I'm glad to revert that part of the commit if it's unwanted churn.

7 years agointravisit: Fold functionality of IdVisitor into the regular Visitor.
Michael Woerister [Thu, 28 Jul 2016 09:58:45 +0000 (05:58 -0400)]
intravisit: Fold functionality of IdVisitor into the regular Visitor.

7 years agosyntax_ext: format: fix ICE with bad named arguments
Wang Xuerui [Fri, 29 Jul 2016 08:40:10 +0000 (16:40 +0800)]
syntax_ext: format: fix ICE with bad named arguments

7 years agoAuto merge of #34980 - cardoe:expose-target-options, r=alexcrichton
bors [Fri, 29 Jul 2016 06:18:52 +0000 (23:18 -0700)]
Auto merge of #34980 - cardoe:expose-target-options, r=alexcrichton

Convert built-in targets to JSON

Convert the built-in targets to JSON to ensure that the JSON parser is always fully featured. This follows on #32988 and #32847. The PR includes a number of extra commits that are just intermediate changes necessary for bisectibility and the ability to prove correctness of the change.

7 years agoRewrite `collections::LinkedList::append` doc example.
Corey Farwell [Fri, 29 Jul 2016 02:09:31 +0000 (22:09 -0400)]
Rewrite `collections::LinkedList::append` doc example.

7 years agoTry to clear up some awkward wording
Brett Cannon [Fri, 29 Jul 2016 02:02:25 +0000 (19:02 -0700)]
Try to clear up some awkward wording

7 years agoAuto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichton
bors [Fri, 29 Jul 2016 01:31:54 +0000 (18:31 -0700)]
Auto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichton

switch mipsel-musl to soft float

Closes #34922.

r? @alexcrichton

7 years agoAuto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mw
bors [Thu, 28 Jul 2016 21:17:54 +0000 (14:17 -0700)]
Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mw

Enable reuse of `.o` files if nothing has changed

This PR completes a first "spike" for incremental compilation by enabling us to reuse `.o` files when nothing has changed. When in incr. mode, we will save `.o` files into the temporary directory, then copy them back out again if they are still valid. The code is still a bit rough but it does seem to work. =)

r? @michaelwoerister

Fixes #34036
Fixes #34037
Fixes #34038

7 years agomake it possible to track where hash diverges
Niko Matsakis [Thu, 28 Jul 2016 19:39:34 +0000 (15:39 -0400)]
make it possible to track where hash diverges

7 years agohash def-path's better
Niko Matsakis [Thu, 28 Jul 2016 19:39:02 +0000 (15:39 -0400)]
hash def-path's better

actually we shouldn't even hash nested items at all, but that is
addressed in a followup PR

7 years agoAuto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton
bors [Thu, 28 Jul 2016 18:20:33 +0000 (11:20 -0700)]
Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton

Escape fewer Unicode codepoints in `Debug` impl of `str`

Use the same procedure as Python to determine whether a character is
printable, described in [PEP 3138]. In particular, this means that the
following character classes are escaped:

- Cc (Other, Control)
- Cf (Other, Format)
- Cs (Other, Surrogate), even though they can't appear in Rust strings
- Co (Other, Private Use)
- Cn (Other, Not Assigned)
- Zl (Separator, Line)
- Zp (Separator, Paragraph)
- Zs (Separator, Space), except for the ASCII space `' '` `0x20`

This allows for user-friendly inspection of strings that are not
English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`).

Fixes #34318.
CC #34422.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/

7 years agoRevert "Remove unused methods from MultiSpan"
mcarton [Thu, 28 Jul 2016 17:33:31 +0000 (19:33 +0200)]
Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f80577d38ec35fcebd64d5970b15f78.

This removed the only way to make a suggestion with more than one
substitute. Bring it back until we come up with a better solution.

7 years agoMove to {integer} and {float}
Jonathan Turner [Thu, 28 Jul 2016 16:49:31 +0000 (09:49 -0700)]
Move to {integer} and {float}

7 years agoKeep multiple files per work-product
Niko Matsakis [Mon, 25 Jul 2016 14:51:14 +0000 (10:51 -0400)]
Keep multiple files per work-product

In the older version, a `.o` and ` .bc` file were separate
work-products.  This newer version keeps, for each codegen-unit, a set
of files of different kinds. We assume that if any kinds are available
then all the kinds we need are available, since the precise set of
switches will depend on attributes and command-line switches.

Should probably test this: the effect of changing attributes in
particular might not be successfully tracked?

7 years agoAddress mw nits
Niko Matsakis [Fri, 22 Jul 2016 14:39:30 +0000 (10:39 -0400)]
Address mw nits

7 years agoAdd a testing mechanism and a simple spike test
Niko Matsakis [Thu, 21 Jul 2016 16:50:15 +0000 (12:50 -0400)]
Add a testing mechanism and a simple spike test

7 years agoModify trans to skip generating `.o` files
Niko Matsakis [Thu, 21 Jul 2016 16:49:59 +0000 (12:49 -0400)]
Modify trans to skip generating `.o` files

This checks the `previous_work_products` data from the dep-graph and
tries to simply copy a `.o` file if possible.  We also add new
work-products into the dep-graph, and create edges to/from the dep-node
for a work-product.

7 years agoAdd non-panicking abs() functions to all signed integer types.
Jethro Beekman [Tue, 26 Jul 2016 23:31:39 +0000 (16:31 -0700)]
Add non-panicking abs() functions to all signed integer types.

Currently, calling abs() on one of the signed integer types might panic (in
debug mode at least) because the absolute value of the largest negative value
can not be represented in that signed type. Unlike all other integer
operations, there is currently not a non-panicking version on this function.
This seems to just be an oversight in the design, therefore just adding it now.

7 years agoCode to save/load the work-products map from disk
Niko Matsakis [Thu, 21 Jul 2016 16:44:59 +0000 (12:44 -0400)]
Code to save/load the work-products map from disk

Work products are deleted if any of their inputs are dirty.

7 years agoStore `crate_disambiguator` as an `InternedString`
Niko Matsakis [Thu, 21 Jul 2016 16:41:29 +0000 (12:41 -0400)]
Store `crate_disambiguator` as an `InternedString`

We used to use `Name`, but the session outlives the tokenizer, which
means that attempts to read this field after trans has complete
otherwise panic. All reads want an `InternedString` anyhow.

7 years agoExtend DepGraph so it can track "work-products"
Niko Matsakis [Thu, 21 Jul 2016 16:33:23 +0000 (12:33 -0400)]
Extend DepGraph so it can track "work-products"

A work product right now is just a `.o` file. In the future it probably
includes other kinds of files, such as `.bc` files saving the
unoptimized LLVM IR.

However, because WorkProductIds must be independent of DefIds, so that
they don't need translation, this system may not be suitable *as is* for
storing fine-grained information (such as the MIR for individual defs),
as it was originally intended. We will want to refactor some for that.

7 years agoRename _ to {numerics} for unknown numeric types
Jonathan Turner [Wed, 27 Jul 2016 23:59:33 +0000 (16:59 -0700)]
Rename _ to {numerics} for unknown numeric types

7 years agoAuto merge of #35086 - Manishearth:rollup, r=Manishearth
bors [Thu, 28 Jul 2016 15:19:33 +0000 (08:19 -0700)]
Auto merge of #35086 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #34951, #34963, #34969, #35013, #35037, #35040, #35058
- Failed merges:

7 years agoRollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakis
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakis

Use &mut for `CombineFields` in inference relations

Because dropping obligations on the floor makes a mess.

r? @nikomatsakis

7 years agoRollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichton
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichton

rustdoc: Fix tuple struct where clause rendering

For tuple structs the where clause comes after the definition.

Fixes #34928

7 years agoRollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton

move coerce-match{,-calls} into run-pass-valgrind

Closes #21696.

7 years agoRollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc

Avoid processing `feature`s on unconfigured crates

Fixes #34932, a regression caused by #34272.
r? @nrc

7 years agoRollup merge of #34963 - petrochenkov:useerr, r=jseyfried
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34963 - petrochenkov:useerr, r=jseyfried

resolve: Fix ICE and extra diagnostics happening when unresolved imports are used in patterns

Closes https://github.com/rust-lang/rust/issues/34933

r? @jseyfried

7 years agoRollup merge of #34951 - tomgarcia:covariant-vec, r=brson
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34951 - tomgarcia:covariant-vec, r=brson

Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?

7 years agoAdd documentation example for `str::Chars::as_str`.
Corey Farwell [Wed, 27 Jul 2016 02:52:56 +0000 (22:52 -0400)]
Add documentation example for `str::Chars::as_str`.

7 years agoAuto merge of #34951 - tomgarcia:covariant-vec, r=brson
bors [Thu, 28 Jul 2016 12:24:31 +0000 (05:24 -0700)]
Auto merge of #34951 - tomgarcia:covariant-vec, r=brson

Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?

7 years agoAdd OpenOptionsExt doc examples
Guillaume Gomez [Thu, 28 Jul 2016 11:04:24 +0000 (13:04 +0200)]
Add OpenOptionsExt doc examples

7 years agoAdd doc examples for std::fs::unix::OpenOptionsExt
Guillaume Gomez [Thu, 28 Jul 2016 10:55:58 +0000 (12:55 +0200)]
Add doc examples for std::fs::unix::OpenOptionsExt

7 years agoAuto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc
bors [Thu, 28 Jul 2016 07:01:54 +0000 (00:01 -0700)]
Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc

macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc

7 years agorustbuild: Ensure PATH does not contain invalid character `"`
Aravind Gollakota [Sat, 23 Jul 2016 18:53:07 +0000 (11:53 -0700)]
rustbuild: Ensure PATH does not contain invalid character `"`

7 years agoAdd regression test
Jeffrey Seyfried [Sun, 17 Jul 2016 18:28:48 +0000 (18:28 +0000)]
Add regression test

7 years agoAuto merge of #34946 - alexcrichton:fix-cfg, r=brson
bors [Thu, 28 Jul 2016 01:58:04 +0000 (18:58 -0700)]
Auto merge of #34946 - alexcrichton:fix-cfg, r=brson

std: Fix usage of SOCK_CLOEXEC

This code path was intended to only get executed on Linux, but unfortunately the
`cfg!` was malformed so it actually never got executed.

7 years agoAdd doc examples for std::fs::Metadata
Guillaume Gomez [Thu, 28 Jul 2016 00:53:34 +0000 (02:53 +0200)]
Add doc examples for std::fs::Metadata

7 years agoRename `char::escape` to `char::escape_debug` and add tracking issue
Tobias Bucher [Wed, 27 Jul 2016 10:10:31 +0000 (12:10 +0200)]
Rename `char::escape` to `char::escape_debug` and add tracking issue

7 years agoAdd test for string AddAssign
Knight [Tue, 26 Jul 2016 18:30:50 +0000 (02:30 +0800)]
Add test for string AddAssign

7 years agoAuto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis
bors [Wed, 27 Jul 2016 21:28:06 +0000 (14:28 -0700)]
Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis

Centralize and clean type error reporting

Refactors the code that handles type errors to be cleaner and fixes various edge cases.

This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged.

Fixes #31173

r? @jonathandturner, cc @nikomatsakis

7 years agoMention debug_assert! in assert! doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:16:11 +0000 (15:16 -0400)]
Mention debug_assert! in assert! doc

7 years agoRevert section about panic! in assert! doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:03:23 +0000 (15:03 -0400)]
Revert section about panic! in assert! doc

7 years agoCorrect minor typo in debug_assert doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:01:43 +0000 (15:01 -0400)]
Correct minor typo in debug_assert doc

7 years agoremove claim about searching through nested fields for the nullable type, even though...
Alex Burka [Wed, 27 Jul 2016 17:57:14 +0000 (13:57 -0400)]
remove claim about searching through nested fields for the nullable type, even though that is how it works

7 years agofix typo
Alex Burka [Wed, 27 Jul 2016 17:52:13 +0000 (13:52 -0400)]
fix typo

7 years agorevert libc changes
Alex Burka [Wed, 27 Jul 2016 17:51:48 +0000 (13:51 -0400)]
revert libc changes

7 years agohack to make example compile
Alex Burka [Tue, 14 Jun 2016 19:53:55 +0000 (15:53 -0400)]
hack to make example compile

7 years agochange confusing wording about discriminant
Alex Burka [Tue, 14 Jun 2016 01:38:04 +0000 (21:38 -0400)]
change confusing wording about discriminant

7 years agoextern fns require named parameters
Alex Burka [Tue, 14 Jun 2016 01:10:12 +0000 (21:10 -0400)]
extern fns require named parameters

Not sure the example is going to stay, but I can try to pass Travis for the bragging rights.

7 years agoforeign function interface interface
Alex Burka [Mon, 13 Jun 2016 22:00:07 +0000 (18:00 -0400)]
foreign function interface interface

7 years agonot just a single field
Alex Burka [Mon, 13 Jun 2016 21:54:39 +0000 (17:54 -0400)]
not just a single field

7 years agorecursion
Alex Burka [Mon, 13 Jun 2016 21:47:18 +0000 (17:47 -0400)]
recursion

7 years agoexpand nullable pointer example
Alex Burka [Mon, 13 Jun 2016 20:13:20 +0000 (16:13 -0400)]
expand nullable pointer example

7 years agogenerics-agnostic description
Alex Burka [Mon, 13 Jun 2016 19:05:22 +0000 (15:05 -0400)]
generics-agnostic description

7 years agobook/ffi: nullable pointer, libc cleanups
Alex Burka [Mon, 13 Jun 2016 17:22:38 +0000 (13:22 -0400)]
book/ffi: nullable pointer, libc cleanups

Expand the "nullable pointer optimization" section with a code example.

Change examples to use std::os::raw instead of libc, when applicable.

7 years agoOnly export #[no_mangle] extern symbols during LTO
Wesley Wiser [Tue, 26 Jul 2016 01:44:57 +0000 (21:44 -0400)]
Only export #[no_mangle] extern symbols during LTO

Previously, all extern symbols were exported even when performing LTO.
Now, we only export symbols that are also marked #[no_mangle].

Fixes #34985

7 years agolibrustc_back: filter targets for only valid ones
Jonathan Creekmore [Wed, 27 Jul 2016 00:44:27 +0000 (17:44 -0700)]
librustc_back: filter targets for only valid ones

Since we can know which targets are instantiable on a particular host,
it does not make sense to list invalid targets in the target print code.
Filter the list of targets to only include the targets that can be
instantiated.

7 years agolibrustc_back: json tests for builtin targets
Jonathan Creekmore [Sat, 23 Jul 2016 12:22:58 +0000 (07:22 -0500)]
librustc_back: json tests for builtin targets

Expand the supported_targets!() macro to also generate a set of
JSON encode/decode tests to verify that the parser will encode
and decode all of the fields needed for all of the builtin targets.
Additionally, add PartialEq to Target and TargetOptions in support
of the tests.

7 years agolibrustc_back: convert fn target() to return Result
Doug Goldstein [Sun, 24 Jul 2016 16:47:39 +0000 (11:47 -0500)]
librustc_back: convert fn target() to return Result

Change all the target generation functions to return a Result<Target,
String> so that targets that are unable to be instantiated can be
expressed as an Err instead of a panic!(). This should improve #33497 as
well.

7 years agolibrustc_back: add ToJson trait to Target
Doug Goldstein [Fri, 8 Apr 2016 03:29:01 +0000 (22:29 -0500)]
librustc_back: add ToJson trait to Target

Target's can already be built up from JSON files as well as built into
librustc_back so this adds the ability to convert any Target back into
JSON.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
7 years agolibrustc_back: expose all target options via JSON
Doug Goldstein [Fri, 15 Apr 2016 14:13:28 +0000 (09:13 -0500)]
librustc_back: expose all target options via JSON

Not all TargetOptions are exposed via the JSON interface to create
different targets. This exposes all the missing items and reorders them
to match the structure so that it is easier in the future to identify
missing items.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
7 years agoAuto merge of #34856 - jseyfried:refactor_reset_tls, r=nrc
bors [Wed, 27 Jul 2016 17:16:36 +0000 (10:16 -0700)]
Auto merge of #34856 - jseyfried:refactor_reset_tls, r=nrc

Avoid reseting the thread local interner at the beginning of `phase_1_parse_input`

The thread local interner is used before `phase_1_parse_input` to create `InternedString`s, which currently wrap `Rc<String>`s. Once `InternedString` is refactored to be an interned string id (like `Name`), resetting will invalidate everything that was interned before `phase_1_parse_input`.

The resets were only useful for the `rusti` project, which can now use `driver::reset_thread_local_state`.

r? @nrc

7 years agoUpdate docs for assert! and debug_assert!
Panashe M. Fundira [Wed, 27 Jul 2016 17:12:35 +0000 (13:12 -0400)]
Update docs for assert! and debug_assert!

8 years agoAuto merge of #33363 - japaric:target, r=japaric
bors [Wed, 27 Jul 2016 12:50:27 +0000 (05:50 -0700)]
Auto merge of #33363 - japaric:target, r=japaric

fix built-in target detection

previously the logic was accepting wrong triples (like
`x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if
they contained an underscore instead of a dash.

fixes #33329

---

r? @brson

I wanted to use a compile-fail test at first. But, you can't pass an extra `--target` flag to `rustc` for those because they already call `rustc --target $HOST` so you get a `error: Option 'target' given more than once.`. The run-make test used here works fine though.

8 years agoAuto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichton
bors [Wed, 27 Jul 2016 09:26:37 +0000 (02:26 -0700)]
Auto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichton

DoubleEndedIterator for Args

This PR implements the DoubleEndedIterator trait for the `std::env::Args[Os]` structure, as well
as the internal implementations.

It is primarily motivated by me, as I happened to implement a simple `reversor` program many times
now, which so far had to use code like this:

```Rust
for arg in std::env::args().skip(1).collect::<Vec<_>>().iter().rev() {}
```

... even though I would have loved to do this instead:

```Rust
for arg in std::env::args().skip(1).rev() {}
```

The latter is more natural, and I did not find a reason for not implementing it.
After all, on every system, the number of arguments passed to the program are known
at runtime.

To my mind, it follows KISS, and does not try to be smart at all. Also, there are no unit-tests,
primarily as I did not find any existing tests for the `Args` struct either.

The windows implementation is basically a copy-pasted variant of the `next()` method implementation,
and I could imagine sharing most of the code instead. Actually I would be happy if the reviewer would
ask for it.

8 years agoFix fallout in tests.
Jeffrey Seyfried [Tue, 26 Jul 2016 04:16:48 +0000 (04:16 +0000)]
Fix fallout in tests.

8 years agoIf a single import resolves to an inaccessible name in some but not all namespaces,
Jeffrey Seyfried [Mon, 25 Jul 2016 23:04:42 +0000 (23:04 +0000)]
If a single import resolves to an inaccessible name in some but not all namespaces,
avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

8 years agoAuto merge of #35053 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 27 Jul 2016 03:52:24 +0000 (20:52 -0700)]
Auto merge of #35053 - steveklabnik:rollup, r=steveklabnik

Rollup of 15 pull requests

- Successful merges: #34461, #34609, #34732, #34850, #34935, #34974, #34990, #34995, #35001, #35009, #35010, #35019, #35028, #35029, #35043
- Failed merges:

8 years agokeep backtraces if using the old build system
Jorge Aparicio [Wed, 27 Jul 2016 03:33:45 +0000 (22:33 -0500)]
keep backtraces if using the old build system

8 years agoFix typos
Vadim Chugunov [Wed, 27 Jul 2016 01:53:47 +0000 (18:53 -0700)]
Fix typos

8 years agoAuto merge of #35014 - vadimcn:travis-test, r=alexcrichton
bors [Wed, 27 Jul 2016 00:07:08 +0000 (17:07 -0700)]
Auto merge of #35014 - vadimcn:travis-test, r=alexcrichton

Fix Travis tests

r? @vadimcn

8 years agoRollup merge of #35043 - rahiel:patch-1, r=nikomatsakis
Steve Klabnik [Tue, 26 Jul 2016 21:21:14 +0000 (17:21 -0400)]
Rollup merge of #35043 - rahiel:patch-1, r=nikomatsakis

doc/book/trait-objects: remove empty lines at start of examples

I think it looks better without them.

8 years agoRollup merge of #35029 - eulerdisk:fix_missing_comma_in_csv_dumper, r=nrc
Steve Klabnik [Tue, 26 Jul 2016 21:21:14 +0000 (17:21 -0400)]
Rollup merge of #35029 - eulerdisk:fix_missing_comma_in_csv_dumper, r=nrc

Fixed missing comma in the csv dumper.

Added missing comma before `file_line_end`.

r? @nrc

8 years agoRollup merge of #35028 - abhijeetbhagat:patch-6, r=alexcrichton
Steve Klabnik [Tue, 26 Jul 2016 21:21:13 +0000 (17:21 -0400)]
Rollup merge of #35028 - abhijeetbhagat:patch-6, r=alexcrichton

Remove no_stack_check tests (#34915)

Part of fixes for #34915

8 years agoRollup merge of #35019 - frewsxcv:slice-split, r=GuillaumeGomez
Steve Klabnik [Tue, 26 Jul 2016 21:21:13 +0000 (17:21 -0400)]
Rollup merge of #35019 - frewsxcv:slice-split, r=GuillaumeGomez

Rewrite/expansion of `slice::split` doc examples.

None

8 years agoRollup merge of #35010 - GuillaumeGomez:file_doc, r=steveklabnik
Steve Klabnik [Tue, 26 Jul 2016 21:21:13 +0000 (17:21 -0400)]
Rollup merge of #35010 - GuillaumeGomez:file_doc, r=steveklabnik

Improve Open doc

Part of #29356.

r? @steveklabnik

8 years agoRollup merge of #35009 - GuillaumeGomez:dir_entry_doc, r=steveklabnik
Steve Klabnik [Tue, 26 Jul 2016 21:21:13 +0000 (17:21 -0400)]
Rollup merge of #35009 - GuillaumeGomez:dir_entry_doc, r=steveklabnik

Dir entry doc

Part of #29356.

r? @steveklabnik

8 years agoRollup merge of #35001 - rdwilliamson:patch-1, r=alexcrichton
Steve Klabnik [Tue, 26 Jul 2016 21:21:13 +0000 (17:21 -0400)]
Rollup merge of #35001 - rdwilliamson:patch-1, r=alexcrichton

Fix HashMap's values_mut example to use println!

Fix HashMap's values_mut example to use println!