Commit Graph

32075 Commits

Author SHA1 Message Date
Alex Crichton
fe848fcd3b rollup merge of #16828 : steveklabnik/more_pointer_guide 2014-08-30 23:46:46 -07:00
Alex Crichton
c6fd2d31ee rollup merge of #16807 : nham/guide_added_ownership_rule 2014-08-30 23:46:38 -07:00
Alex Crichton
f7f8b20961 rollup merge of #16780 : mdinger/marker_types 2014-08-30 23:46:19 -07:00
Alex Crichton
c638ef6c51 rollup merge of #16778 : jbcrail/fix-issue-15826 2014-08-30 23:46:06 -07:00
Alex Crichton
6b3aa5832f rollup merge of #16769 : rgawdzik/abs_doc_addition 2014-08-30 23:45:52 -07:00
Alex Crichton
e442406dd7 rollup merge of #16726 : tshepang/consistency 2014-08-30 23:45:44 -07:00
Alex Crichton
941b06b0bd rollup merge of #16721 : tshepang/convenience 2014-08-30 23:45:41 -07:00
Alex Crichton
9fc29f1d2e rollup merge of #16716 : tshepang/temp 2014-08-30 23:45:37 -07:00
Alex Crichton
4ddbb0d4b1 test: Fix the tcp-accept-stress test
It was previously asserted that each thread received at least one connection,
but this is not guaranteed to always be the case due to scheduling. This test
also deadlocked on failure due to a lingering reference to the sending half of
the channel, so that reference is now also eagerly dropped so the test can fail
properly if something bad happens.

Closes #16872
2014-08-30 23:43:20 -07:00
bors
499a40e59f auto merge of #16650 : ruud-v-a/rust/timespec-arithmetic, r=alexcrichton
This changes the `Add` and `Sub` implementations for `Timespec` introduced in #16573 to use `Duration` as the time span type instead of `Timespec` itself, as [suggested](https://github.com/rust-lang/rust/pull/16573#issuecomment-52593408) by @sfackler.

This depends on #16626, because is uses `Duration::seconds(i64)`, whereas currently `Duration::seconds` takes an `i32`.
2014-08-31 06:41:30 +00:00
Andrew Dunham
1c49eaaa55 gensym each test re-export module individually
Fixes #16597
2014-08-30 20:36:16 -07:00
bors
c2564540de auto merge of #16393 : SimonSapin/rust/patch-9, r=steveklabnik 2014-08-30 23:51:25 +00:00
Eduard Burtescu
a9c3109a6a Allow ExprLit expression macros to be used in patterns. 2014-08-31 01:45:11 +03:00
bors
23c1f9b3c2 auto merge of #16873 : alexcrichton/rust/ignore-deadlocks, r=sfackler
This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872
2014-08-30 21:51:25 +00:00
nham
ea888edf63 doc: Add another restriction to the list of ownership rules. 2014-08-30 17:22:29 -04:00
Steve Klabnik
7e4a1459e9 note about ref patterns in pointer guide
Fixes #13602
2014-08-30 16:15:46 -04:00
bors
f297366593 auto merge of #16859 : alexcrichton/rust/snapshots, r=huonw 2014-08-30 19:51:25 +00:00
Tobba
e676b73d64 Defailbloat fail!(string) 2014-08-30 20:38:47 +02:00
Jakub Wieczorek
6f35ede5a4 Remove the branch merging optimisations for slice patterns
They were only correct in the simplest case. Some of the optimisations
are certainly possible but should be introduced carefully and only
when the whole pattern codegen infrastructure is in a better shape.

Fixes #16648.
2014-08-30 19:50:46 +02:00
Corey Richardson
02d96ac612 guide: function -> closure in explanation of closures 2014-08-30 12:39:52 -04:00
Huon Wilson
b79930eeb9 Fix grammar of the accepted feature warning. 2014-08-31 02:25:19 +10:00
bors
cbacdbc5f3 auto merge of #16598 : bkoropoff/rust/import-shadow-name, r=alexcrichton
This partially alleviates the confusing behavior in issue #16597
2014-08-30 12:41:22 +00:00
bors
d398eb76ae auto merge of #16419 : huonw/rust/pretty-expanded-hygiene, r=pnkfelix
Different Identifiers and Names can have identical textual representations, but different internal representations, due to the macro hygiene machinery (syntax contexts and gensyms). This provides a way to see these internals by compiling with `--pretty expanded,hygiene`.

This is useful for debugging & hacking on macros (e.g. diagnosing https://github.com/rust-lang/rust/issues/15750/https://github.com/rust-lang/rust/issues/15962 likely would've been faster with this functionality).

E.g. 

```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]

macro_rules! foo {
    ($x: ident) => { y + $x }
}

fn bar() {
    foo!(x)
}
```
```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]


fn bar /* 61#0 */() { y /* 60#2 */ + x /* 58#3 */ }
```
2014-08-30 10:51:26 +00:00
bors
43c26e6041 auto merge of #16190 : Pythoner6/rust/labeled-while-loop, r=alexcrichton
Fixes #12643

> Say!
> I like labelled breaks/continues!

I will use them with a `for` loop.
And I will use with a `loop` loop.
Say! I will use them ANYWHERE!
… _even_ in a `while` loop.

Because they're now supported there.
2014-08-30 09:01:20 +00:00
Huon Wilson
32e437161d rustc: implement a pretty mode to print ident/name's ctxt & gensyms.
`--pretty expanded,hygiene` is helpful with debugging macro issues,
since two identifiers/names can be textually the same, but different
internally (resulting in weird "undefined variable" errors).
2014-08-30 16:50:38 +10:00
Alex Crichton
e29059f508 test: Ignore a deadlocking test on OSX
This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872
2014-08-29 23:25:35 -07:00
Tshepang Lekhonkhobe
d89b2a5c3d doc: make docs build
Addresses this comment:
https://github.com/rust-lang/rust/pull/16721#issuecomment-53946624
2014-08-30 08:02:40 +02:00
Peter Atashian
0061b36a77 Fix win64 regression introduced by #15773
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-30 02:02:21 -04:00
wickerwaka
d3d14d6a41 Added cfail test
Changed error to 'use of trait `{}` as a struct constructor'
2014-08-29 21:11:34 -07:00
bors
c8e86e977f auto merge of #16322 : michaelwoerister/rust/gdb-pretty, r=alexcrichton
Also extends the autotest framework to let a test case choose if pretty printing should be enabled.
2014-08-30 04:01:24 +00:00
Joseph Martin
e76db8ebc2 Fixed missing use statement 2014-08-29 23:44:21 -04:00
Pythoner6
aec34d8f26 Fix formatting, update copyright dates 2014-08-29 23:44:08 -04:00
Pythoner6
373b9d6243 Add support for labeled while loops. 2014-08-29 23:43:55 -04:00
wickerwaka
f5776f81fd Detect a traits being used as structs in check_expr_with_unifier
Fixes #16750
Fixes #15812
2014-08-29 19:27:27 -07:00
bors
5419b2ca2c auto merge of #15773 : P1start/rust/style-lints, r=alexcrichton
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint.

This also adds support for lint groups to the compiler. Lint groups are a way of grouping a number of lints together under one name. For example, this also defines a default lint for naming conventions, named `bad_style`. Writing `#[allow(bad_style)]` is equivalent to writing `#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These lint groups can also be defined as a compiler plugin using the new `Registry::register_lint_group` method.

This also adds two built-in lint groups, `bad_style` and `unused`. The contents of these groups can be seen by running `rustc -W help`.

[breaking-change]
2014-08-29 22:16:20 +00:00
Alex Crichton
d15d559739 Register new snapshots 2014-08-29 14:33:08 -07:00
P1start
ed2aad8b43 Add lint groups; define built-in lint groups bad_style and unused
This adds support for lint groups to the compiler. Lint groups are a way of
grouping a number of lints together under one name. For example, this also
defines a default lint for naming conventions, named `bad_style`. Writing
`#[allow(bad_style)]` is equivalent to writing
`#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These
lint groups can also be defined as a compiler plugin using the new
`Registry::register_lint_group` method.

This also adds two built-in lint groups, `bad_style` and `unused`. The contents
of these groups can be seen by running `rustc -W help`.
2014-08-30 09:12:04 +12:00
P1start
de7abd8824 Unify non-snake-case lints and non-uppercase statics lints
This unifies the `non_snake_case_functions` and `uppercase_variables` lints
into one lint, `non_snake_case`. It also now checks for non-snake-case modules.
This also extends the non-camel-case types lint to check type parameters, and
merges the `non_uppercase_pattern_statics` lint into the
`non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case`
lint, all non-snake-case variables that start with lowercase characters (such
as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the
previous `non_snake_case_functions` and `uppercase_variables` lints. All use of
the `non_uppercase_pattern_statics` should be replaced with the
`non_uppercase_statics` lint. Any code that previously contained non-snake-case
module or variable names should be updated to use snake case names or disable
the `non_snake_case` lint. Any code with non-camel-case type parameters should
be changed to use camel case or disable the `non_camel_case_types` lint.

[breaking-change]
2014-08-30 09:10:05 +12:00
Steve Klabnik
eb28237195 desugar -> destructure
wrong de- word.
2014-08-29 15:35:51 -04:00
bors
bd159d3867 auto merge of #15955 : nikomatsakis/rust/issue-5527-new-inference-scheme, r=pcwalton
The inference scheme proposed in <http://smallcultfollowing.com/babysteps/blog/2014/07/09/an-experimental-new-type-inference-scheme-for-rust/>.

This is theoretically a [breaking-change]. It is possible that you may encounter type checking errors, particularly related to closures or functions with higher-ranked lifetimes or object types. Adding more explicit type annotations should help the problem. However, I have not been able to make an example that *actually* successfully compiles with the older scheme and fails with the newer scheme.

f? @pcwalton, @pnkfelix
2014-08-29 19:21:12 +00:00
Vinzent Steinberg
46e6e42d7a complex: use ///... instead of /**...*/ for comment 2014-08-29 13:39:25 -04:00
Vinzent Steinberg
8138c3574f num: implement Hash for Complex and Ratio 2014-08-29 13:39:17 -04:00
Ruud van Asseldonk
d20de6d5c5 libtime: Use Duration in Timespec arithmetic. 2014-08-29 18:54:36 +02:00
bors
51d0d06410 auto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmr
Previously, this caused methods of re-exported types to not be inserted into
the search index. This fix may introduce some false positives, but in my
testing they appear as orphaned methods and end up not being inserted into the
final search index at a later stage.

Fixes issue #11943
2014-08-29 15:41:20 +00:00
Nick Howell
0a84308eba Fix spelling mistakes in the guide
Also made some opinionated changes such as to prefer license over licence and judgment over judgement.
2014-08-29 11:23:21 -04:00
Niko Matsakis
6e27c2fd58 Label FIXMEs with a bug number 2014-08-29 10:21:54 -04:00
Niko Matsakis
4c01251416 Introduce new inference scheme: variables are now instantiated with at most one type, and region variables are introduced as needed 2014-08-29 10:21:54 -04:00
bors
602592675c auto merge of #16838 : nick29581/rust/dst-bug-4, r=pnkfelix,nikomatsakis
Don't double free embedded, unsized slices.

Merge/rebase error from DST. Thanks to @eddyb for finding.

Closes #16826 (I hope)

r?
2014-08-29 13:56:29 +00:00
Jonas Hietala
26b40be7ed doc: Runnable examples logging.
Also use //! Instead of /*! in liblog.
2014-08-29 14:44:04 +02:00
Robert Clipsham
5028c669fc Modifications to liblibc for raw/custom socket support. 2014-08-29 10:18:25 +01:00