]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoClarify that a for loop uses `IntoIterator`
Jake Goulding [Wed, 2 Dec 2015 19:15:46 +0000 (14:15 -0500)]
Clarify that a for loop uses `IntoIterator`

8 years agoAuto merge of #30160 - adambadawy:fix_wait_with_output_typo, r=bluss
bors [Wed, 2 Dec 2015 07:36:40 +0000 (07:36 +0000)]
Auto merge of #30160 - adambadawy:fix_wait_with_output_typo, r=bluss

r? @steveklabnik

8 years agoAuto merge of #30157 - brson:mk, r=sfackler
bors [Wed, 2 Dec 2015 05:31:44 +0000 (05:31 +0000)]
Auto merge of #30157 - brson:mk, r=sfackler

This dates from the stone-ages. We always configure LLVM with all
supported targets.

8 years agoFix typo in src/libstd/process.rs
Adam Badawy [Wed, 2 Dec 2015 04:12:01 +0000 (23:12 -0500)]
Fix typo in src/libstd/process.rs

8 years agoAuto merge of #30155 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 2 Dec 2015 02:43:04 +0000 (02:43 +0000)]
Auto merge of #30155 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30129, #30134, #30136, #30144, #30150, #30153, #30154
- Failed merges:

8 years agomk: Remove obsolete comment
Brian Anderson [Wed, 2 Dec 2015 02:13:32 +0000 (02:13 +0000)]
mk: Remove obsolete comment

This dates from the stone-ages. We always configure LLVM with all
supported targets.

8 years agoRollup merge of #30154 - salty-horse:guessing_panic, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:42 +0000 (19:01 -0500)]
Rollup merge of #30154 - salty-horse:guessing_panic, r=steveklabnik

The text mentions ```return```, but what's actually happening is a ```panic!```.

8 years agoRollup merge of #30153 - durka:patch-11, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:42 +0000 (19:01 -0500)]
Rollup merge of #30153 - durka:patch-11, r=steveklabnik

I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.

8 years agoRollup merge of #30150 - steveklabnik:fix_exe_suffix, r=alexcrichton
Steve Klabnik [Wed, 2 Dec 2015 00:01:42 +0000 (19:01 -0500)]
Rollup merge of #30150 - steveklabnik:fix_exe_suffix, r=alexcrichton

8 years agoRollup merge of #30144 - pjungwir:clarify-semver-rules, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:41 +0000 (19:01 -0500)]
Rollup merge of #30144 - pjungwir:clarify-semver-rules, r=steveklabnik

The documentation shows this:

    [dependencies]

    rand="0.3.0"

and says it allows any version compatible with 0.3.0, but then it says, "If we wanted to use only 0.3.0 exactly, we could use `=0.3.0`." That is very easy to misunderstand, so hopefully this PR will help others not to be as confused as me. :-)

8 years agoRollup merge of #30136 - fhahn:remove-int-from-doc-examples, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:41 +0000 (19:01 -0500)]
Rollup merge of #30136 - fhahn:remove-int-from-doc-examples, r=steveklabnik

This PR replaces uses of int/uint in some doc examples in various crates.

8 years agoRollup merge of #30134 - salty-horse:patch-1, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:41 +0000 (19:01 -0500)]
Rollup merge of #30134 - salty-horse:patch-1, r=steveklabnik

random/secret guess -> secret number.

8 years agoRollup merge of #30129 - tbu-:pr_doc_arrays_coerce, r=steveklabnik
Steve Klabnik [Wed, 2 Dec 2015 00:01:41 +0000 (19:01 -0500)]
Rollup merge of #30129 - tbu-:pr_doc_arrays_coerce, r=steveklabnik

Fixes #29993.

8 years agoAuto merge of #30129 - tbu-:pr_doc_arrays_coerce, r=steveklabnik
bors [Tue, 1 Dec 2015 23:35:54 +0000 (23:35 +0000)]
Auto merge of #30129 - tbu-:pr_doc_arrays_coerce, r=steveklabnik

Fixes #29993.

8 years agobook: Change mention of unused `return` to `panic!`
Ori Avtalion [Tue, 1 Dec 2015 23:34:08 +0000 (01:34 +0200)]
book: Change mention of unused `return` to `panic!`

8 years agotrpl: explain how to inhibit rustdoc's auto-main
Alex Burka [Tue, 1 Dec 2015 23:18:19 +0000 (18:18 -0500)]
trpl: explain how to inhibit rustdoc's auto-main

I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.

8 years agoSmall fix to EXE_SUFFIX and DLL_EXTENSION docs
Steve Klabnik [Tue, 1 Dec 2015 21:53:48 +0000 (16:53 -0500)]
Small fix to EXE_SUFFIX and DLL_EXTENSION docs

8 years agoAuto merge of #29858 - fhahn:abort-if-path-has-spaces, r=brson
bors [Tue, 1 Dec 2015 21:38:20 +0000 (21:38 +0000)]
Auto merge of #29858 - fhahn:abort-if-path-has-spaces, r=brson

The Rust build scripts do work if the source directory contains spaces. I tried to make it work with spaces. I managed to get the Rust's and LLVM's configure scripts to work with spaces in the path, but I could not figure out how to get the Rust makefiles working.

So for now, this PR updates Rust's `configure` to abort if the source path contains spaces. I also added a note about spaces in the source path to the README.

I think this should close #18477 for now.

8 years agoReplace uses of int/uint with isize/uzsize in doc examples
Florian Hahn [Tue, 1 Dec 2015 11:54:43 +0000 (12:54 +0100)]
Replace uses of int/uint with isize/uzsize in doc examples

8 years agoAuto merge of #25570 - oli-obk:const_indexing, r=nikomatsakis
bors [Tue, 1 Dec 2015 19:47:38 +0000 (19:47 +0000)]
Auto merge of #25570 - oli-obk:const_indexing, r=nikomatsakis

This PR allows the constant evaluation of index operations on constant arrays and repeat expressions. This allows index expressions to appear in the expression path of the length expression of a repeat expression or an array type.

An example is

```rust
const ARR: [usize; 5] = [1, 2, 3, 4, 5];
const ARR2: [usize; ARR[1]] = [42, 99];
```

In most other locations llvm's const evaluator figures it out already. This is not specific to index expressions and could be remedied in the future.

8 years agoClarify ambiguity about how to ask Cargo for a specific version
Paul A. Jungwirth [Tue, 1 Dec 2015 18:03:46 +0000 (10:03 -0800)]
Clarify ambiguity about how to ask Cargo for a specific version

8 years agoAuto merge of #29391 - DanielKeep:syntax-index, r=steveklabnik
bors [Tue, 1 Dec 2015 17:59:42 +0000 (17:59 +0000)]
Auto merge of #29391 - DanielKeep:syntax-index, r=steveklabnik

* `const`: Add reference to raw pointers
* Change `expr!(...)` etc. examples to use `ident` instead.
  *Technically*, it should be `pat`, but that's not how it works in
  practice.
* `|`: add reference to closure syntax.
* Closure syntax entry.
* Indexing and slicing entries.
* Add history of obsolete and deprecated syntax.

r? @steveklabnik

8 years agoAuto merge of #30124 - steveklabnik:doc_string_errors, r=alexcrichton
bors [Tue, 1 Dec 2015 16:09:33 +0000 (16:09 +0000)]
Auto merge of #30124 - steveklabnik:doc_string_errors, r=alexcrichton

Part of #29376

8 years agoDocument the Error types in std::string
Steve Klabnik [Mon, 30 Nov 2015 20:48:28 +0000 (15:48 -0500)]
Document the Error types in std::string

Part of #29376

8 years agoAuto merge of #30135 - michaelwoerister:interning-checks, r=sanxiyn
bors [Tue, 1 Dec 2015 13:19:41 +0000 (13:19 +0000)]
Auto merge of #30135 - michaelwoerister:interning-checks, r=sanxiyn

This PR adds some safety checks to interning things in `ty::ctxt`. Accidentally re-interning an `AdtDef` has bitten me in the behind just last week (it messes up things in very subtle way only showing up later as an LLVM assertion).

Initially I had also added a check to `ty::ctxt::node_type_insert()` -- but there it seems to be expected that the same table slot is written to multiple times.

Roll-up candidate.

8 years agoFix wording in Guessing Game
Ori Avtalion [Tue, 1 Dec 2015 08:59:31 +0000 (10:59 +0200)]
Fix wording in Guessing Game

8 years agoAdd some consistency checks for value interning in ty::ctxt.
Michael Woerister [Tue, 1 Dec 2015 08:50:07 +0000 (09:50 +0100)]
Add some consistency checks for value interning in ty::ctxt.

8 years agotrpl: additions & fixes for syntax index.
Daniel Keep [Tue, 1 Dec 2015 08:37:15 +0000 (19:37 +1100)]
trpl: additions & fixes for syntax index.

* `const`: Add reference to raw pointers
* Change `expr!(...)` etc. examples to use `ident` instead.
  *Technically*, it should be `pat`, but that's not how it works in
  practice.
* `|`: add reference to closure syntax.
* Closure syntax entry.
* Indexing and slicing entries.

8 years agoAuto merge of #30118 - alexcrichton:fix-time-again, r=aturon
bors [Tue, 1 Dec 2015 07:40:41 +0000 (07:40 +0000)]
Auto merge of #30118 - alexcrichton:fix-time-again, r=aturon

I believe that because Windows' unit of resolution is 100ns that this unit of
time will ensure that the assertions will hold true as it's representable in the
native format.

cc #29970

8 years agoAuto merge of #30116 - petrochenkov:exhaust, r=alexcrichton
bors [Tue, 1 Dec 2015 05:55:04 +0000 (05:55 +0000)]
Auto merge of #30116 - petrochenkov:exhaust, r=alexcrichton

Fixes https://github.com/rust-lang/rust/pull/29383#issuecomment-160652130

r? @bluss

8 years agoAuto merge of #30057 - steveklabnik:doc_str, r=alexcrichton
bors [Tue, 1 Dec 2015 03:37:58 +0000 (03:37 +0000)]
Auto merge of #30057 - steveklabnik:doc_str, r=alexcrichton

Part of #29338

8 years agoArrays don't dereference but coerce to slices
Tobias Bucher [Tue, 1 Dec 2015 02:13:13 +0000 (02:13 +0000)]
Arrays don't dereference but coerce to slices

Fixes #29993.

8 years agoAuto merge of #30126 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 1 Dec 2015 01:05:58 +0000 (01:05 +0000)]
Auto merge of #30126 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30108, #30114, #30115, #30119, #30120, #30122
- Failed merges:

8 years agoAuto merge of #30121 - steveklabnik:fix_trpl_tests, r=alexcrichton
bors [Mon, 30 Nov 2015 23:12:14 +0000 (23:12 +0000)]
Auto merge of #30121 - steveklabnik:fix_trpl_tests, r=alexcrichton

In #29932, I moved the location of TRPL, but I missed making the changes
in mk/tests.mk. This led to #30088 landing with a broken example.

As such, #30113 will need to land before this.

8 years agoRollup merge of #30122 - steveklabnik:last_trpl_fix, r=Manishearth
Steve Klabnik [Mon, 30 Nov 2015 23:02:22 +0000 (18:02 -0500)]
Rollup merge of #30122 - steveklabnik:last_trpl_fix, r=Manishearth

Along with https://github.com/rust-lang/rust/pull/30121, this should fix the last fallout from https://github.com/rust-lang/rust/pull/29932

8 years agoRollup merge of #30120 - steveklabnik:doc_string_parse_error, r=alexcrichton
Steve Klabnik [Mon, 30 Nov 2015 23:02:22 +0000 (18:02 -0500)]
Rollup merge of #30120 - steveklabnik:doc_string_parse_error, r=alexcrichton

Part of #29376

8 years agoRollup merge of #30119 - steveklabnik:doc_to_string, r=alexcrichton
Steve Klabnik [Mon, 30 Nov 2015 23:02:22 +0000 (18:02 -0500)]
Rollup merge of #30119 - steveklabnik:doc_to_string, r=alexcrichton

Part of #29376

8 years agoRollup merge of #30115 - nilcons-contrib:fix-book-stack, r=steveklabnik
Steve Klabnik [Mon, 30 Nov 2015 23:02:21 +0000 (18:02 -0500)]
Rollup merge of #30115 - nilcons-contrib:fix-book-stack, r=steveklabnik

The `f` argument will reference the actual value in the `d` box, not the box in the `bar`'s stack frame.

I am just learning Rust, so I don't know how to explain this well, but just from `f`'s type it is clear that it will be a pointer to an `i32`, not a pointer to a pointer. Some `println!("{:p}", ...)`'s can easily confirm this.

I would actually suggest to remove/simplify this part of the example. This is a subtle issue that can easily confuse people at the early stages of familiarizing with the language. (As I got confused by it. :))

8 years agoRollup merge of #30114 - sourcefrog:doc-casts2, r=Manishearth
Steve Klabnik [Mon, 30 Nov 2015 23:02:21 +0000 (18:02 -0500)]
Rollup merge of #30114 - sourcefrog:doc-casts2, r=Manishearth

8 years agoRollup merge of #30108 - bhargavrpatel:master, r=steveklabnik
Steve Klabnik [Mon, 30 Nov 2015 23:02:21 +0000 (18:02 -0500)]
Rollup merge of #30108 - bhargavrpatel:master, r=steveklabnik

8 years agoDocument std::string::ParseError
Steve Klabnik [Mon, 30 Nov 2015 19:47:14 +0000 (14:47 -0500)]
Document std::string::ParseError

Part of #29376

8 years agoAuto merge of #30080 - durka:patch-10, r=alexcrichton
bors [Mon, 30 Nov 2015 21:15:56 +0000 (21:15 +0000)]
Auto merge of #30080 - durka:patch-10, r=alexcrichton

Fixes #30073. The input to `cfg!` is a meta attribute, but not _any_ meta attribute (e.g. `cfg!(allow(dead_code))` doesn't compile). But the macro_rules syntax can't quite express this, so I added a note to the doc.

8 years agoBetter docs for the str primitive
Steve Klabnik [Wed, 25 Nov 2015 17:36:11 +0000 (12:36 -0500)]
Better docs for the str primitive

Part of #29338

8 years agoFix path to TRPL in doc README
Steve Klabnik [Mon, 30 Nov 2015 20:00:30 +0000 (15:00 -0500)]
Fix path to TRPL in doc README

8 years agoRe-enable testing the book
Steve Klabnik [Mon, 30 Nov 2015 19:55:26 +0000 (14:55 -0500)]
Re-enable testing the book

In #29932, I moved the location of TRPL, but I missed making the changes
in mk/tests.mk. This led to #30088 landing with a broken example.

As such, #30113 will need to land before this.

8 years agoWrite some docs for ToString
Steve Klabnik [Mon, 30 Nov 2015 19:36:03 +0000 (14:36 -0500)]
Write some docs for ToString

Part of #29376

8 years agostd: Bump time margin in std::time tests
Alex Crichton [Mon, 30 Nov 2015 18:53:20 +0000 (10:53 -0800)]
std: Bump time margin in std::time tests

I believe that because Windows' unit of resolution is 100ns that this unit of
time will ensure that the assertions will hold true as it's representable in the
native format.

cc #29970

8 years agoAuto merge of #30113 - sourcefrog:doc-casts, r=steveklabnik
bors [Mon, 30 Nov 2015 18:41:18 +0000 (18:41 +0000)]
Auto merge of #30113 - sourcefrog:doc-casts, r=steveklabnik

Sorry, thanks to @Ms2ger for pointing this out in https://github.com/rust-lang/rust/pull/30088#discussion_r46142903

8 years agoCorrect grammar
Martin Pool [Mon, 30 Nov 2015 18:16:36 +0000 (10:16 -0800)]
Correct grammar

Thanks @Manishearth

8 years agoFix regression in patterns with empty variants
Vadim Petrochenkov [Mon, 30 Nov 2015 16:56:19 +0000 (19:56 +0300)]
Fix regression in patterns with empty variants

8 years agoAdditional text and examples around casting
Martin Pool [Mon, 30 Nov 2015 15:59:14 +0000 (07:59 -0800)]
Additional text and examples around casting

8 years agoFix pointer value in the 'complex example'
Mihaly Barasz [Mon, 30 Nov 2015 15:51:38 +0000 (16:51 +0100)]
Fix pointer value in the 'complex example'

The `f` argument will reference the actual value in the `d` box, not the
box in the `bar`'s stack frame.

8 years agoRemove broken explicit coercion example
Martin Pool [Mon, 30 Nov 2015 15:42:14 +0000 (07:42 -0800)]
Remove broken explicit coercion example

8 years agoAuto merge of #29929 - michaelwoerister:mir-repr-to-librustc, r=nikomatsakis
bors [Mon, 30 Nov 2015 14:18:28 +0000 (14:18 +0000)]
Auto merge of #29929 - michaelwoerister:mir-repr-to-librustc, r=nikomatsakis

This is done mostly so that we can refer to MIR types in csearch and other metadata related area.

Heads up, @rust-lang/compiler!

r? @nikomatsakis

8 years agoAuto merge of #30111 - GuillaumeGomez:patch-3, r=Manishearth
bors [Mon, 30 Nov 2015 10:19:49 +0000 (10:19 +0000)]
Auto merge of #30111 - GuillaumeGomez:patch-3, r=Manishearth

r? @Manishearth

cc @huonw

8 years agoReword E0492
Guillaume Gomez [Mon, 30 Nov 2015 09:29:35 +0000 (10:29 +0100)]
Reword E0492

8 years agoAlso move the MIR visitor to librustc.
Michael Woerister [Tue, 24 Nov 2015 13:35:34 +0000 (14:35 +0100)]
Also move the MIR visitor to librustc.

8 years agoMove the core MIR datastructures to librustc.
Michael Woerister [Thu, 19 Nov 2015 15:37:34 +0000 (16:37 +0100)]
Move the core MIR datastructures to librustc.

This is done mostly so that we can refer to MIR types in csearch and other metadata related area.

8 years agotweak cfg! doc comment
Alex Burka [Mon, 30 Nov 2015 03:53:19 +0000 (22:53 -0500)]
tweak cfg! doc comment

8 years agoMerge pull request #1 from bhargavrpatel/master-stack-heap-verbiage-change
Bhargav Patel [Mon, 30 Nov 2015 03:18:34 +0000 (22:18 -0500)]
Merge pull request #1 from bhargavrpatel/master-stack-heap-verbiage-change

Change verbiage in Stack & Heap page

8 years agoChange verbiage in Stack & Heap page
Bhargav Patel [Mon, 30 Nov 2015 03:18:13 +0000 (22:18 -0500)]
Change verbiage in Stack & Heap page

Made a small change in the sentence. It seemed confusing to read the word "actual" twice in the sentence; I removed it completely.

8 years agoAuto merge of #30101 - istankovic:fix-typos, r=steveklabnik
bors [Mon, 30 Nov 2015 00:41:13 +0000 (00:41 +0000)]
Auto merge of #30101 - istankovic:fix-typos, r=steveklabnik

Fix some typos in the docs for Peekable.

r? @steveklabnik

8 years agoAuto merge of #29976 - GuillaumeGomez:patch-5, r=Manishearth
bors [Sun, 29 Nov 2015 22:54:43 +0000 (22:54 +0000)]
Auto merge of #29976 - GuillaumeGomez:patch-5, r=Manishearth

r? @Manishearth

8 years agoAuto merge of #30088 - sourcefrog:doc-casts, r=steveklabnik
bors [Sun, 29 Nov 2015 21:10:36 +0000 (21:10 +0000)]
Auto merge of #30088 - sourcefrog:doc-casts, r=steveklabnik

Based on the description in https://github.com/rust-lang/rust/blob/219eca11b044de3644b3e9101124513c1a842b09/src/librustc_typeck/check/cast.rs#L11 and https://doc.rust-lang.org/nightly/nomicon/casts.html

8 years agoRephrased description of casting
Martin Pool [Sun, 29 Nov 2015 20:00:07 +0000 (12:00 -0800)]
Rephrased description of casting

8 years agoAdd information about numeric casts, from the nomicon
Martin Pool [Sun, 29 Nov 2015 19:54:29 +0000 (11:54 -0800)]
Add information about numeric casts, from the nomicon

8 years agoAuto merge of #30100 - jFransham:patch-1, r=steveklabnik
bors [Sun, 29 Nov 2015 18:13:17 +0000 (18:13 +0000)]
Auto merge of #30100 - jFransham:patch-1, r=steveklabnik

Fixes #30093 in the most trivial possible way.

8 years agoAuto merge of #30059 - androm3da:master, r=bluss
bors [Sun, 29 Nov 2015 16:30:15 +0000 (16:30 +0000)]
Auto merge of #30059 - androm3da:master, r=bluss

8 years agolibcore/iter: fix typos
Ivan Stankovic [Sun, 29 Nov 2015 13:52:29 +0000 (14:52 +0100)]
libcore/iter: fix typos

8 years agoFix #30093
Jack Fransham [Sun, 29 Nov 2015 13:36:01 +0000 (13:36 +0000)]
Fix #30093

8 years agoAuto merge of #30075 - kyeah:mac-span, r=sanxiyn
bors [Sun, 29 Nov 2015 06:00:05 +0000 (06:00 +0000)]
Auto merge of #30075 - kyeah:mac-span, r=sanxiyn

Fixes #28424 (item macros), #30067 (impl item macros), and pattern macros.

8 years agoUse last_span for macro spans
Kevin Yeh [Sun, 29 Nov 2015 04:36:37 +0000 (22:36 -0600)]
Use last_span for macro spans

8 years agoAdd E0492 error explanation
Guillaume Gomez [Sat, 21 Nov 2015 22:07:58 +0000 (23:07 +0100)]
Add E0492 error explanation

8 years agoAuto merge of #30092 - semarie:to_socket_addr_str_bad, r=alexcrichton
bors [Sat, 28 Nov 2015 19:57:45 +0000 (19:57 +0000)]
Auto merge of #30092 - semarie:to_socket_addr_str_bad, r=alexcrichton

I don't reproduce it on severals hosts (virtual or real), so I can't
debug it. As Bitrig has disabled this test too, I will follow the same
here.

r? @alexcrichton

8 years agoAuto merge of #29651 - tshepang:misc, r=steveklabnik
bors [Sat, 28 Nov 2015 18:09:07 +0000 (18:09 +0000)]
Auto merge of #29651 - tshepang:misc, r=steveklabnik

8 years agoAuto merge of #30074 - jonas-schievink:macro-doc, r=sanxiyn
bors [Sat, 28 Nov 2015 16:22:27 +0000 (16:22 +0000)]
Auto merge of #30074 - jonas-schievink:macro-doc, r=sanxiyn

Fixes #17616

New docs for `panic!`:
```rust
macro_rules! panic {
    () => { ... };
    ($msg:expr) => { ... };
    ($fmt:expr, $($arg:tt)+) => { ... };
}
```

New docs for `assert!`:
```rust
macro_rules! assert {
    ( $ cond : expr ) => { ... };
    (
$ cond : expr , $ ( $ arg : tt ) + ) => { ... };
}
```
<sup>not pretty, but at least it's not worse :joy:

8 years agoAdd a test
Jonas Schievink [Sat, 28 Nov 2015 13:47:12 +0000 (14:47 +0100)]
Add a test

8 years agoAuto merge of #30091 - vyp:doc-typo, r=bluss
bors [Sat, 28 Nov 2015 13:39:21 +0000 (13:39 +0000)]
Auto merge of #30091 - vyp:doc-typo, r=bluss

8 years agodisable net::addr::to_socket_addr_str_bad test under openbsd
Sébastien Marie [Sat, 28 Nov 2015 08:10:48 +0000 (09:10 +0100)]
disable net::addr::to_socket_addr_str_bad test under openbsd

I don't reproduce it on severals hosts (virtual or real), so I can't
debug it. As Bitrig has disabled this test too, I will follow the same
here.

8 years agodoc(book/ffi): remove duplicate link reference `[libc]'
xd1le [Sat, 28 Nov 2015 05:58:39 +0000 (16:58 +1100)]
doc(book/ffi): remove duplicate link reference `[libc]'

8 years agoAdd E0498 error explanation
Guillaume Gomez [Sat, 21 Nov 2015 21:24:28 +0000 (22:24 +0100)]
Add E0498 error explanation

8 years agoAttempted documentation of coercions
Martin Pool [Sat, 28 Nov 2015 01:35:12 +0000 (17:35 -0800)]
Attempted documentation of coercions

Trying to summarize here only the cases that will make sense at the
level of the rust book

8 years agoCopy in some documentation about which casts are legal
Martin Pool [Sat, 28 Nov 2015 01:10:50 +0000 (17:10 -0800)]
Copy in some documentation about which casts are legal

8 years agoAuto merge of #29383 - petrochenkov:empstr, r=pnkfelix
bors [Sat, 28 Nov 2015 00:45:34 +0000 (00:45 +0000)]
Auto merge of #29383 - petrochenkov:empstr, r=pnkfelix

Fixes https://github.com/rust-lang/rust/issues/28692
Fixes https://github.com/rust-lang/rust/issues/28992
Fixes some other similar issues (see the tests)

[breaking-change], needs crater run (cc @brson or @alexcrichton )

The pattern with parens `UnitVariant(..)` for unit variants seems to be popular in rustc (see the second commit), but mostly used by one person (@nikomatsakis), according to git blame. If it causes breakage on crates.io I'll add an exceptional case for it.

8 years agoAuto merge of #30085 - oli-obk:fix/pnkfelix_test, r=pnkfelix
bors [Fri, 27 Nov 2015 20:39:28 +0000 (20:39 +0000)]
Auto merge of #30085 - oli-obk:fix/pnkfelix_test, r=pnkfelix

for discussion see https://github.com/rust-lang/rust/pull/26848/files#r43151926

r? @pnkfelix

8 years agoAuto merge of #30064 - fhartwig:macro-suggestions, r=sanxiyn
bors [Fri, 27 Nov 2015 18:41:53 +0000 (18:41 +0000)]
Auto merge of #30064 - fhartwig:macro-suggestions, r=sanxiyn

Fixes #13677
This does the same sort of suggestion for misspelt macros that we already do for misspelt identifiers.
Example. Compiling this program:

```rust
macro_rules! foo {
    ($e:expr) => ( $e )
}

fn main() {
    fob!("hello!");
}
```

gives the following error message:

```
/Users/mcp/temp/test.rs:7:5: 7:8 error: macro undefined: 'fob!'
/Users/mcp/temp/test.rs:7     fob!("hello!");
                              ^~~
/Users/mcp/temp/test.rs:7:5: 7:8 help: did you mean `foo`?
/Users/mcp/temp/test.rs:7     fob!("hello!");
```

I had to move the levenshtein distance function into libsyntax for this. Maybe this should live somewhere else (some utility crate?), but I couldn't find a crate to put it in that is imported by libsyntax and the other rustc crates.

8 years agoIntroduce max_suggestion_distance function to avoid duplicating the heuristic
Florian Hartwig [Fri, 27 Nov 2015 16:52:29 +0000 (17:52 +0100)]
Introduce max_suggestion_distance function to avoid duplicating the heuristic

8 years agoShifted focus of while-let example per review.
ebadf [Fri, 27 Nov 2015 16:23:58 +0000 (10:23 -0600)]
Shifted focus of while-let example per review.

8 years agoAuto merge of #30082 - semarie:execve, r=alexcrichton
bors [Fri, 27 Nov 2015 15:55:05 +0000 (15:55 +0000)]
Auto merge of #30082 - semarie:execve, r=alexcrichton

under OpenBSD and Bitrig, it is an error to pass an empty argv
argument to execve(2). It results the test fail as execve(2) don't exec
and set errno to EINVAL.

instead, make argv with two arguments (in order to differenciate the
initial call, from the execve call).

r? @alexcrichton

8 years agorevert test to check runtime evaluation instead of constant evaluation
Oliver Schneider [Fri, 20 Nov 2015 14:39:50 +0000 (15:39 +0100)]
revert test to check runtime evaluation instead of constant evaluation

see https://github.com/rust-lang/rust/pull/26848/files#r43151926

8 years agopass at least one argument to execve
Sébastien Marie [Fri, 27 Nov 2015 12:48:07 +0000 (13:48 +0100)]
pass at least one argument to execve

under OpenBSD and Bitrig, it is an error to pass an empty argv
argument to execve(2). It results the test fail as execve(2) don't exec
and set errno to EINVAL.

instead, make argv with two arguments (in order to differenciate the
initial call, from the execve call).

8 years agofix docs for compiler builtin macros
Alex Burka [Fri, 27 Nov 2015 03:45:55 +0000 (22:45 -0500)]
fix docs for compiler builtin macros

8 years agoAuto merge of #30071 - brson:netbsd, r=alexcrichton
bors [Fri, 27 Nov 2015 01:48:12 +0000 (01:48 +0000)]
Auto merge of #30071 - brson:netbsd, r=alexcrichton

Depends on https://github.com/rust-lang/rust/pull/30015 since this branch includes `#[staged_api]` changes.

8 years agoUpdate libc. Fixes netbsd.
Brian Anderson [Thu, 26 Nov 2015 10:23:31 +0000 (10:23 +0000)]
Update libc. Fixes netbsd.

8 years agoAuto merge of #30077 - nrc:save-abs-crate, r=eddyb
bors [Thu, 26 Nov 2015 22:04:06 +0000 (22:04 +0000)]
Auto merge of #30077 - nrc:save-abs-crate, r=eddyb

8 years agoFix spans for macros
Kevin Yeh [Thu, 26 Nov 2015 19:14:10 +0000 (13:14 -0600)]
Fix spans for macros

8 years ago;
Jonas Schievink [Thu, 26 Nov 2015 20:10:04 +0000 (21:10 +0100)]
;

8 years agoAuto merge of #30068 - wthrowe:unsized-pointer-impls, r=alexcrichton
bors [Thu, 26 Nov 2015 20:07:05 +0000 (20:07 +0000)]
Auto merge of #30068 - wthrowe:unsized-pointer-impls, r=alexcrichton

I'm pretty sure this code isn't actually used by the compiler, so this
is effectively a documentation change.

8 years agoAuto merge of #30043 - arielb1:split-metadata, r=nikomatsakis
bors [Thu, 26 Nov 2015 18:20:58 +0000 (18:20 +0000)]
Auto merge of #30043 - arielb1:split-metadata, r=nikomatsakis

This improves bootstrap times because of better parallelism - though I need to measure how much - and allows metadata to be modified without triggering a full recompile. This also ensures that metadata handling and the rest of rustc remain decoupled, which is a first step for switching to a new metadata format.

This is a [breaking-change] to all plugin authors because of the following renames:
 * `rustc::plugin` is now `rustc_plugin`
 * `rustc::metadata` is now `rustc_metadata`
 * Most data types from `rustc::metadata`, along with `LOCAL_CRATE`, are now in `rustc::middle::cstore`.
 * The CStore methods were split between the `rustc::middle::CrateStore` trait (and trait object) and the `rustc_metadata::cstore::CStore`, with an `Rc<CrateStore>` stored in the `Session`. The inner `CStore` can be accessed via the inner `Any` bound, but this is deprecated.

r? @nikomatsakis

8 years agorustdoc: only show macro arm's lhs
Jonas Schievink [Thu, 26 Nov 2015 18:14:36 +0000 (19:14 +0100)]
rustdoc: only show macro arm's lhs