]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorustc: Make unused_features lint warn by default
Brian Anderson [Sat, 31 Jan 2015 06:27:36 +0000 (22:27 -0800)]
rustc: Make unused_features lint warn by default

When it was un*known*_features it was reasonably to by deny by default.

cc #21798

9 years agoAuto merge of #21495 - richo:unexported-unmangled-lint, r=alexcrichton
bors [Fri, 30 Jan 2015 19:56:34 +0000 (19:56 +0000)]
Auto merge of #21495 - richo:unexported-unmangled-lint, r=alexcrichton

The usecase is that functions made visible to systems outside of the
rust ecosystem require the symbol to be visible.

This adds a lint for functions that are not exported, but also not mangled.

It has some gotchas:

[ ]: There is fallout in core that needs taking care of
[ ]: I'm not convinced the error message is correct
[ ]: It has no tests

~~However, there's an underlying issue which I'd like feedback on- which is that my belief that that non-pub functions would not have their symbols exported, however that seems not to be the case in the first case that this lint turned up in rustc (`rust_fail`), which intuition suggests has been working.~~

This seems to be a separate bug in rust, wherein the symbols are exported in binaries, but not in rlibs or dylibs. This lint would catch that case.

9 years agoAuto merge of #21604 - nikomatsakis:closure-move-indiv-vars, r=eddyb
bors [Fri, 30 Jan 2015 15:32:27 +0000 (15:32 +0000)]
Auto merge of #21604 - nikomatsakis:closure-move-indiv-vars, r=eddyb

r? @eddyb

9 years agoAuto merge of #21717 - nick29581:prelude-fullrange, r=acrichto
bors [Fri, 30 Jan 2015 12:43:41 +0000 (12:43 +0000)]
Auto merge of #21717 - nick29581:prelude-fullrange, r=acrichto

r? @alexcrichton

9 years agoAddress @eddyb nit by simplifying `ClosureEnv`.
Niko Matsakis [Mon, 26 Jan 2015 20:18:48 +0000 (15:18 -0500)]
Address @eddyb nit by simplifying `ClosureEnv`.

9 years agoUse `#[rustc_paren_sugar]` as a more extensible way of deciding when
Niko Matsakis [Mon, 26 Jan 2015 19:39:58 +0000 (14:39 -0500)]
Use `#[rustc_paren_sugar]` as a more extensible way of deciding when
paren sugar is legal.

9 years agolint: Add test for no_mangle
Richo Healey [Thu, 29 Jan 2015 07:21:56 +0000 (23:21 -0800)]
lint: Add test for no_mangle

9 years agoAllow individual upvars to be inferred to move semantics. Fixes #21603.
Niko Matsakis [Sat, 24 Jan 2015 22:25:07 +0000 (17:25 -0500)]
Allow individual upvars to be inferred to move semantics. Fixes #21603.

9 years agoRemove the capture mode map and just store the capture mode for individual variables.
Niko Matsakis [Sat, 24 Jan 2015 20:54:52 +0000 (15:54 -0500)]
Remove the capture mode map and just store the capture mode for individual variables.

Also add test. Fixes #16749.

9 years agoAuto merge of #21351 - eddyb:x-coerce--a-new-hope, r=nikomatsakis
bors [Fri, 30 Jan 2015 07:57:14 +0000 (07:57 +0000)]
Auto merge of #21351 - eddyb:x-coerce--a-new-hope, r=nikomatsakis

Coercions will now attempt to autoderef as needed before reborrowing.
This includes overloaded `Deref`, e.g. `&Rc<T>` coerces to `&T`, and
`DerefMut`, e.g. `&mut Vec<T>` coerces to `&mut [T]` (in addition to `&[T]`).
Closes #21432.

9 years agort: allow unexported functions
Richo Healey [Wed, 28 Jan 2015 06:24:17 +0000 (22:24 -0800)]
rt: allow unexported functions

rust_panic is unexported, however the metadata exported will usually
include it for attaching breakpoints.

9 years agolint: warn about #[no_mangle] fns that aren't exported
Richo Healey [Wed, 21 Jan 2015 20:07:03 +0000 (12:07 -0800)]
lint: warn about #[no_mangle] fns that aren't exported

The usecase is that functions made visible to systems outside of the
rust ecosystem require the symbol to be visible.

9 years agoChange from core::ops::RangeFull to std::ops
Nick Cameron [Wed, 28 Jan 2015 05:16:00 +0000 (18:16 +1300)]
Change from core::ops::RangeFull to std::ops

9 years agoRename FullRange to RangeFull
Nick Cameron [Wed, 28 Jan 2015 04:06:46 +0000 (17:06 +1300)]
Rename FullRange to RangeFull

9 years agoRemove FullRange from the prelude etc.
Nick Cameron [Wed, 28 Jan 2015 01:54:25 +0000 (14:54 +1300)]
Remove FullRange from the prelude etc.

9 years agoUse absolute path to FullRange, rather than assuming it is in the prelude
Nick Cameron [Wed, 28 Jan 2015 01:27:28 +0000 (14:27 +1300)]
Use absolute path to FullRange, rather than assuming it is in the prelude

Closes #21263

[breaking-change]

If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`

9 years agoAuto merge of #21692 - pnkfelix:fsk-fix-coerce-match-20055, r=eddyb
bors [Thu, 29 Jan 2015 22:54:19 +0000 (22:54 +0000)]
Auto merge of #21692 - pnkfelix:fsk-fix-coerce-match-20055, r=eddyb

trans: When coercing to `Box<Trait>` or `Box<[T]>`, leave datum in it's original L-/R-value state.

This fixes a subtle issue where temporaries were being allocated (but not necessarily initialized) to the (parent) terminating scope of a match expression; in particular, the code to zero out the temporary emitted by `datum.store_to` is only attached to the particular match-arm for that temporary, but when going down other arms of the match expression, the temporary may falsely appear to have been initialized, depending on what the stack held at that location, and thus may have its destructor erroneously run at the end of the terminating scope.

FIx #20055.

(There may be a latent bug still remaining in `fn into_fat_ptr`, but I am so annoyed by the test/run-pass/coerce_match.rs failures that I want to land this now.)

9 years agoImplement deref coercions (rust-lang/rfcs#241).
Eduard Burtescu [Thu, 29 Jan 2015 10:17:51 +0000 (12:17 +0200)]
Implement deref coercions (rust-lang/rfcs#241).

9 years agorustc_typeck: cleanup coercion logic that has been obsolete/unused for a while now.
Eduard Burtescu [Sun, 18 Jan 2015 09:20:29 +0000 (11:20 +0200)]
rustc_typeck: cleanup coercion logic that has been obsolete/unused for a while now.

9 years agorustc_typeck: use FnCtxt in coercion, instead of mimicking a combiner.
Eduard Burtescu [Sat, 17 Jan 2015 20:44:42 +0000 (22:44 +0200)]
rustc_typeck: use FnCtxt in coercion, instead of mimicking a combiner.

9 years agorustc: move infer::coercion to rustc_typeck.
Eduard Burtescu [Fri, 16 Jan 2015 03:48:15 +0000 (05:48 +0200)]
rustc: move infer::coercion to rustc_typeck.

9 years agoAuto merge of #21691 - edwardw:double-closure, r=nikomatsakis
bors [Thu, 29 Jan 2015 19:36:03 +0000 (19:36 +0000)]
Auto merge of #21691 - edwardw:double-closure, r=nikomatsakis

It was considered to be impossible but actually it can
happen for nested closures. Also, because there must
be nested closures when this happens, we can use more
targeted help message.

Closes #21390
Closes #21600

9 years agoAuto merge of #21677 - japaric:no-range, r=alexcrichton
bors [Thu, 29 Jan 2015 16:28:52 +0000 (16:28 +0000)]
Auto merge of #21677 - japaric:no-range, r=alexcrichton

Note: Do not merge until we get a newer snapshot that includes #21374

There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672).

r? @alexcrichton

9 years agobring back `#[derive(Show)]` with a deprecation warning
Jorge Aparicio [Wed, 28 Jan 2015 17:43:16 +0000 (12:43 -0500)]
bring back `#[derive(Show)]` with a deprecation warning

9 years agofix import in cfail test
Jorge Aparicio [Wed, 28 Jan 2015 15:47:19 +0000 (10:47 -0500)]
fix import in cfail test

9 years agos/Show/Debug/g
Jorge Aparicio [Wed, 28 Jan 2015 13:34:18 +0000 (08:34 -0500)]
s/Show/Debug/g

9 years agoremove #[old_impl_check] now that #21363 has been fixed
Jorge Aparicio [Wed, 28 Jan 2015 13:18:40 +0000 (08:18 -0500)]
remove #[old_impl_check] now that #21363 has been fixed

9 years agoregister snaphots
Jorge Aparicio [Wed, 28 Jan 2015 13:13:31 +0000 (08:13 -0500)]
register snaphots

9 years agoundo some conversions
Jorge Aparicio [Tue, 27 Jan 2015 00:10:24 +0000 (19:10 -0500)]
undo some conversions

9 years agoremove unused imports
Jorge Aparicio [Tue, 27 Jan 2015 00:09:58 +0000 (19:09 -0500)]
remove unused imports

9 years agofix inference fallout
Jorge Aparicio [Tue, 27 Jan 2015 00:08:22 +0000 (19:08 -0500)]
fix inference fallout

9 years agoconvert remaining `range(a, b)` to `a..b`
Jorge Aparicio [Mon, 26 Jan 2015 21:05:07 +0000 (16:05 -0500)]
convert remaining `range(a, b)` to `a..b`

9 years ago`for x in range(a, b)` -> `for x in a..b`
Jorge Aparicio [Mon, 26 Jan 2015 20:46:12 +0000 (15:46 -0500)]
`for x in range(a, b)` -> `for x in a..b`

sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs

9 years ago`range(a, b).foo()` -> `(a..b).foo()`
Jorge Aparicio [Mon, 26 Jan 2015 20:44:22 +0000 (15:44 -0500)]
`range(a, b).foo()` -> `(a..b).foo()`

sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs

9 years agoAuto merge of #21730 - Manishearth:rollup, r=alexcrichton
bors [Thu, 29 Jan 2015 11:28:30 +0000 (11:28 +0000)]
Auto merge of #21730 - Manishearth:rollup, r=alexcrichton

Should clear our backlog of rollups from the queue

9 years agoAuto merge of #21680 - japaric:slice, r=alexcrichton
bors [Thu, 29 Jan 2015 05:47:21 +0000 (05:47 +0000)]
Auto merge of #21680 - japaric:slice, r=alexcrichton

Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.

9 years agoAuto merge of #21522 - nikomatsakis:assoc-type-ice-hunt-take-3, r=nick29581
bors [Wed, 28 Jan 2015 21:49:38 +0000 (21:49 +0000)]
Auto merge of #21522 - nikomatsakis:assoc-type-ice-hunt-take-3, r=nick29581

Do not propagate the region requirements on the projected type to the input types it is being projected from.

Fixes #21520.

r? @aturon

9 years agoRollup merge of 21643 - semarie:break-local_stage0, r=brson
Manish Goregaokar [Wed, 28 Jan 2015 21:47:16 +0000 (03:17 +0530)]
Rollup merge of 21643 - semarie:break-local_stage0, r=brson

9 years agoRollup merge of 21651 - nelsonjchen:add--webkit-overflow-scrolling-touch-to-book...
Manish Goregaokar [Wed, 28 Jan 2015 21:46:52 +0000 (03:16 +0530)]
Rollup merge of 21651 - nelsonjchen:add--webkit-overflow-scrolling-touch-to-book-css, r=alexcrichton

9 years agoRollup merge of 21654 - FlaPer87:unify-impls, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:46:25 +0000 (03:16 +0530)]
Rollup merge of 21654 - FlaPer87:unify-impls, r=alexcrichton

9 years agoRollup merge of 21662 - oli-obk:hashmap_enum_json, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:45:51 +0000 (03:15 +0530)]
Rollup merge of 21662 - oli-obk:hashmap_enum_json, r=alexcrichton

9 years agoRollup merge of 21663 - tbu-:pr_doc_cell_static_safety, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:45:25 +0000 (03:15 +0530)]
Rollup merge of 21663 - tbu-:pr_doc_cell_static_safety, r=alexcrichton

9 years agoRollup merge of 21671 - akiss77:pr-aarch64-fastisel0, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:44:58 +0000 (03:14 +0530)]
Rollup merge of 21671 - akiss77:pr-aarch64-fastisel0, r=alexcrichton

9 years agoRollup merge of 21681 - japaric:no-warn, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:44:35 +0000 (03:14 +0530)]
Rollup merge of 21681 - japaric:no-warn, r=alexcrichton

9 years agoRollup merge of 21708 - brson:internals, r=huonw
Manish Goregaokar [Wed, 28 Jan 2015 21:43:53 +0000 (03:13 +0530)]
Rollup merge of 21708 - brson:internals, r=huonw

9 years agoRollup merge of 21711 - thepowersgang:patch-1, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:41:48 +0000 (03:11 +0530)]
Rollup merge of 21711 - thepowersgang:patch-1, r=alexcrichton

9 years agoRollup merge of 21722 - orpheuslummis:patch-1, r=Gankro
Manish Goregaokar [Wed, 28 Jan 2015 21:41:12 +0000 (03:11 +0530)]
Rollup merge of 21722 - orpheuslummis:patch-1, r=Gankro

9 years agoRollup merge of #21640 - retep998:rmdir, r=alexcrichton
Manish Goregaokar [Wed, 28 Jan 2015 21:34:10 +0000 (03:04 +0530)]
Rollup merge of #21640 - retep998:rmdir, r=alexcrichton

`_wrmdir` is literally just a wrapper around `RemoveDirectoryW`, so let's just use `RemoveDirectoryW`.
r? @alexcrichton

9 years agoRollup merge of #21626 - Ms2ger:various-cleanup, r=eddyb
Manish Goregaokar [Wed, 28 Jan 2015 21:34:09 +0000 (03:04 +0530)]
Rollup merge of #21626 - Ms2ger:various-cleanup, r=eddyb

9 years agoAuto merge of #21698 - Manishearth:rollup, r=alexcrichton
bors [Wed, 28 Jan 2015 18:55:24 +0000 (18:55 +0000)]
Auto merge of #21698 - Manishearth:rollup, r=alexcrichton

This should work now.

9 years agoMerge remote-tracking branch 'origin/master' into rollup
Manish Goregaokar [Wed, 28 Jan 2015 17:33:36 +0000 (23:03 +0530)]
Merge remote-tracking branch 'origin/master' into rollup

Conflicts:
src/libcollections/slice.rs
src/libcore/nonzero.rs
src/libcore/ops.rs

9 years agoCorrect Orpheus Lummis's email and name
Orpheus Lummis [Wed, 28 Jan 2015 15:04:56 +0000 (10:04 -0500)]
Correct Orpheus Lummis's email and name

New email address, stylization of name.

9 years agoAuto merge of #21019 - nikomatsakis:issue-20871-ret-as-assoc-type, r=nrc
bors [Wed, 28 Jan 2015 11:01:36 +0000 (11:01 +0000)]
Auto merge of #21019 - nikomatsakis:issue-20871-ret-as-assoc-type, r=nrc

Fixes https://github.com/rust-lang/rust/issues/20871

r? @aturon (at least until we decide definitively if this is a good idea)

9 years agoAdd regression test for #21212. Fixes #21212.
Niko Matsakis [Wed, 28 Jan 2015 10:59:50 +0000 (05:59 -0500)]
Add regression test for #21212. Fixes #21212.

9 years agoAdd new test for object method numbering mismatches.
Niko Matsakis [Wed, 28 Jan 2015 10:13:43 +0000 (05:13 -0500)]
Add new test for object method numbering mismatches.

9 years agoAdjust comment per nrc's suggestion.
Niko Matsakis [Wed, 28 Jan 2015 10:06:10 +0000 (05:06 -0500)]
Adjust comment per nrc's suggestion.

9 years agoAdd missing space to error message.
Niko Matsakis [Tue, 27 Jan 2015 10:57:12 +0000 (05:57 -0500)]
Add missing space to error message.

9 years agoUpdate test files; mostly the problem is that they were using the
Niko Matsakis [Mon, 12 Jan 2015 15:27:25 +0000 (10:27 -0500)]
Update test files; mostly the problem is that they were using the
explicit form `Fn<A,B>` and now should use `Fn(A) -> B` or
`Fn<A,Output=B>`, but in some cases we get duplicate error
reports. This is mildly annoying and arises because of the main error
and another error from the projection. Might be worth squashing those,
but seems like a separate problem.

9 years agoUpdate Rustdoc to deal with the Fn return type being an associated type.
Niko Matsakis [Mon, 12 Jan 2015 15:24:19 +0000 (10:24 -0500)]
Update Rustdoc to deal with the Fn return type being an associated type.

9 years agoPatch variance bug: appearing in a binding is an invariant position (at least right...
Niko Matsakis [Mon, 12 Jan 2015 15:20:14 +0000 (10:20 -0500)]
Patch variance bug: appearing in a binding is an invariant position (at least right now).

9 years agoExtract expectations from the projection obligation, which includes
Niko Matsakis [Mon, 12 Jan 2015 15:19:47 +0000 (10:19 -0500)]
Extract expectations from the projection obligation, which includes
all relevant information.

9 years agoAdd Clone to the list of bounds for a TypeFolder. (Kill?)
Niko Matsakis [Sun, 11 Jan 2015 20:21:45 +0000 (15:21 -0500)]
Add Clone to the list of bounds for a TypeFolder. (Kill?)

9 years agoWhen pretty-printing object types, include the output associated type
Niko Matsakis [Sun, 11 Jan 2015 20:21:01 +0000 (15:21 -0500)]
When pretty-printing object types, include the output associated type

9 years agoFix a latent bug in trait dispatch where we sometimes counted associated types
Niko Matsakis [Sun, 11 Jan 2015 20:18:06 +0000 (15:18 -0500)]
Fix a latent bug in trait dispatch where we sometimes counted associated types
when constructing the vtable-index. Not good.

9 years agoMove return type an associated type of the `Fn*` traits. Mostly this involves tweakin...
Niko Matsakis [Sat, 10 Jan 2015 16:54:15 +0000 (11:54 -0500)]
Move return type an associated type of the `Fn*` traits. Mostly this involves tweaking things in
the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs`
to project `Output` from the unboxed closure and fn traits.

9 years agoAdd the notion of normalizing a parameter environment and ensure that
Niko Matsakis [Mon, 26 Jan 2015 19:20:38 +0000 (14:20 -0500)]
Add the notion of normalizing a parameter environment and ensure that
all parameter environments are normalized. Correspondingly, stop
normalizing predicates we extract out of the environment. Fixes #21664.

9 years agoChange list of predicates in ParameterEnvironment to a `Vec`.
Niko Matsakis [Mon, 26 Jan 2015 21:37:45 +0000 (16:37 -0500)]
Change list of predicates in ParameterEnvironment to a `Vec`.

9 years agoIn unsize_unique_expr, do not convert scratch value to lvalue.
Felix S. Klock II [Wed, 28 Jan 2015 02:37:24 +0000 (03:37 +0100)]
In unsize_unique_expr, do not convert scratch value to lvalue.

Fix the issue-20055-box-trait.rs test to actually test `Box<Trait>`.

Fix #21695.

9 years agoRemove unnecessary to_string() call.
Ms2ger [Sat, 24 Jan 2015 18:25:25 +0000 (19:25 +0100)]
Remove unnecessary to_string() call.

9 years agoRemove a custom variant of iter::Cloned.
Ms2ger [Sat, 24 Jan 2015 18:22:09 +0000 (19:22 +0100)]
Remove a custom variant of iter::Cloned.

9 years agoSimplify the implementation of segments_name_eq.
Ms2ger [Sat, 24 Jan 2015 18:13:36 +0000 (19:13 +0100)]
Simplify the implementation of segments_name_eq.

9 years agoRename found_ast to FoundAst and qualify uses.
Ms2ger [Sat, 24 Jan 2015 17:58:07 +0000 (18:58 +0100)]
Rename found_ast to FoundAst and qualify uses.

This matches contemporary Rust style.

9 years agoAuto merge of #21158 - alkor:issue-21131, r=nick29581
bors [Wed, 28 Jan 2015 07:32:53 +0000 (07:32 +0000)]
Auto merge of #21158 - alkor:issue-21131, r=nick29581

Closes #21131

9 years agoAuto merge of #21248 - brson:feature-staging, r=alexcrichton
bors [Wed, 28 Jan 2015 03:59:14 +0000 (03:59 +0000)]
Auto merge of #21248 - brson:feature-staging, r=alexcrichton

This implements the remaining bits of 'feature staging', as described in [RFC 507](https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md).

This is not quite done, but the substance of the work is complete so submitting for early review.

Key changes:
* `unstable`, `stable` and `deprecated` attributes all require 'feature' and 'since', and support an optional 'reason'.
* The `unstable` lint is removed.
* A new 'stability checking' pass warns when a used unstable library feature has not been activated with the `feature` attribute. At 1.0 beta this will become an error.
* A new 'unused feature checking' pass emits a lint ('unused_feature', renamed from 'unknown_feature') for any features that were activated but not used.
* A new tidy script `featureck.py` performs some global sanity checking, particularly that 'since' numbers agree, and also prints out a summary of features.

Differences from RFC:
* As implemented `unstable` requires a `since` attribute. I do not know if this is useful. I included it in the original sed script and just left it.
* RFC didn't specify the name of the optional 'reason' attribute.
* This continues to use 'unstable', 'stable' and 'deprecated' names (the 'nice' names) instead of 'staged_unstable', but only activates them with the crate-level 'staged_api' attribute.

I intend to update the RFC based on the outcome of this PR.

Issues:
* The unused feature check doesn't account for language features - i.e. you can activate a language feature, not use it, and not get the error.

Open questions:
* All unstable and deprecated features are named 'unnamed_feature', which i picked just because it is uniquely greppable. This is the 'catch-all' feature. What should it be?
* All stable features are named 'grandfathered'. What should this be?

TODO:
* Add check that all `deprecated` attributes are paired with a `stable` attribute in order to preserve the knowledge about when a feature became stable.
* Update rustdoc in various ways.
* Remove obsolete stability discussion from reference.
* Add features for 'path', 'io', 'os', 'hash' and 'rand'.

cc #20445 @alexcrichton @aturon

9 years agofix #[cfg(test)] warnings
Jorge Aparicio [Tue, 27 Jan 2015 03:56:50 +0000 (22:56 -0500)]
fix #[cfg(test)] warnings

9 years agoREADME.md - Fix source tarball link
John Hodge [Wed, 28 Jan 2015 02:12:54 +0000 (10:12 +0800)]
README.md - Fix source tarball link

9 years agodiscuss.rust-lang.org -> internals.rust-lang.org
Brian Anderson [Tue, 27 Jan 2015 23:44:05 +0000 (15:44 -0800)]
discuss.rust-lang.org -> internals.rust-lang.org

9 years agoRollup merge of #21666 - tshepang:rm-unloved-file, r=brson
Manish Goregaokar [Tue, 27 Jan 2015 23:10:48 +0000 (04:40 +0530)]
Rollup merge of #21666 - tshepang:rm-unloved-file, r=brson

See 579eb24

9 years agoAuto merge of #21523 - nikomatsakis:issue-21245-japaric-ti-failure, r=eddyb
bors [Tue, 27 Jan 2015 23:08:13 +0000 (23:08 +0000)]
Auto merge of #21523 - nikomatsakis:issue-21245-japaric-ti-failure, r=eddyb

This also includes some miscellaneous cleanup. This is kind of a band-aid but it fixes the problems @japaric was encountering.

r? @eddyb

9 years agoRollup merge of #21667 - nagisa:sbook-links, r=Gankro
Manish Goregaokar [Tue, 27 Jan 2015 23:07:50 +0000 (04:37 +0530)]
Rollup merge of #21667 - nagisa:sbook-links, r=Gankro

Fixes #21665

r? @steveklabnik

9 years agoRollup merge of #21676 - Victory:fix-deprication-in-random, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 23:05:57 +0000 (04:35 +0530)]
Rollup merge of #21676 - Victory:fix-deprication-in-random, r=alexcrichton

Cleanup mention of uint, use usize/us instead. This includes the example `println!("{}", 2u * x);`

9 years agoMerge remote-tracking branch 'rust-lang/master'
Brian Anderson [Tue, 27 Jan 2015 17:38:30 +0000 (09:38 -0800)]
Merge remote-tracking branch 'rust-lang/master'

Conflicts:
src/libcore/cell.rs
src/librustc_driver/test.rs
src/libstd/old_io/net/tcp.rs
src/libstd/old_io/process.rs

9 years agoRollup merge of #21686 - richo:python-fixes, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 23:04:40 +0000 (04:34 +0530)]
Rollup merge of #21686 - richo:python-fixes, r=alexcrichton

While waiting on some builds I started cleaning up the various python bits and pieces.

I'm going to keep poking, want to ping me before the next rollup?

9 years agoRollup merge of #21658 - Manishearth:index_on_unimplemented, r=Gankro
Manish Goregaokar [Tue, 27 Jan 2015 23:02:20 +0000 (04:32 +0530)]
Rollup merge of #21658 - Manishearth:index_on_unimplemented, r=Gankro

Helps issues like [these](http://www.reddit.com/r/rust/comments/2tpefm/unable_to_access_array_elements/)

r? @Gankro

rollup-worthy

9 years agoTest cases for issue #20055.
Felix S. Klock II [Tue, 27 Jan 2015 17:20:43 +0000 (18:20 +0100)]
Test cases for issue #20055.

Note that I have not yet managed to expose any bug in
`trans::expr::into_fat_ptr`; it would be good to try to do so (or show
that the use of `.to_lvalue_datum` there is sound).

9 years agotrans: When coercing to `Box<Trait>` or `Box<[T]>`, leave datum in its original L...
Felix S. Klock II [Tue, 27 Jan 2015 17:12:34 +0000 (18:12 +0100)]
trans: When coercing to `Box<Trait>` or `Box<[T]>`, leave datum in its original L-/R-value state.

This fixes a subtle issue where temporaries were being allocated (but
not necessarily initialized) to the (parent) terminating scope of a
match expression; in particular, the code to zero out the temporary
emitted by `datum.store_to` is only attached to the particular
match-arm for that temporary, but when going down other arms of the
match expression, the temporary may falsely appear to have been
initialized, depending on what the stack held at that location, and
thus may have its destructor erroneously run at the end of the
terminating scope.

Test cases to appear in a follow-up commit.

Fix #20055

9 years agoRollup merge of #21625 - carols10cents:sliceext-examples, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 16:54:04 +0000 (22:24 +0530)]
Rollup merge of #21625 - carols10cents:sliceext-examples, r=alexcrichton

Hi! I added some examples to some SliceExt methods that didn't have any.

I'm looking forward to feedback and I'm happy to change anything-- it looks like the doc conventions are still a bit in flux, based on the discussions going on in [rfc 505](https://github.com/rust-lang/rfcs/pull/505).

I was most unsure about examples for methods that return iterators over slices... I wanted to use asserts on the result of calling `.next()` like in [this permutations example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L608-L617), but then it gets all cluttered up with lifetime stuff... so I went with iterating and printing and mentioning what the expected printed output is like in [this chunks example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L297-L304)... any ideas for the best ways to do this are appreciated.

Thank you! :heart:

9 years agoRollup merge of #21624 - emanueLczirai:vim_syntastic_fix, r=sanxiyn
Manish Goregaokar [Tue, 27 Jan 2015 16:54:04 +0000 (22:24 +0530)]
Rollup merge of #21624 - emanueLczirai:vim_syntastic_fix, r=sanxiyn

when saving .rs files under vim
do not fail to run the syntax checker
error: Unrecognized option: 'parse-only'.

due to this commit
953f294ea30253bb5578e3c895d17fcc97c20dce
which removed the deprecated flag --parse-only

9 years agoRollup merge of #21623 - dinfuehr:patch-1, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 16:54:03 +0000 (22:24 +0530)]
Rollup merge of #21623 - dinfuehr:patch-1, r=alexcrichton

9 years agoRollup merge of #21618 - snowe2010:documentation, r=Gankro
Manish Goregaokar [Tue, 27 Jan 2015 16:54:03 +0000 (22:24 +0530)]
Rollup merge of #21618 - snowe2010:documentation, r=Gankro

Lifetime elision with two input references is not clear.
Closes #21284

9 years agoRollup merge of #21612 - bombless:patch-3, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 16:54:03 +0000 (22:24 +0530)]
Rollup merge of #21612 - bombless:patch-3, r=alexcrichton

9 years agoRollup merge of #21608 - JeffBelgum:collections-reform-issue-19986-add-append-and...
Manish Goregaokar [Tue, 27 Jan 2015 16:54:03 +0000 (22:24 +0530)]
Rollup merge of #21608 - JeffBelgum:collections-reform-issue-19986-add-append-and-split-off, r=Gankro

@brson @Gankro

9 years agoRollup merge of #21602 - japaric:derive-copy, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 16:54:02 +0000 (22:24 +0530)]
Rollup merge of #21602 - japaric:derive-copy, r=alexcrichton

9 years agoRollup merge of #21597 - iKevinY:mobile-api-docs, r=cmr
Manish Goregaokar [Tue, 27 Jan 2015 16:54:02 +0000 (22:24 +0530)]
Rollup merge of #21597 - iKevinY:mobile-api-docs, r=cmr

This PR removes the `min-width` rule from `body` so that no horizontal scrolling is necessary on mobile, and also hides out-of-band information on mobile to create more room for the in-band information.

9 years agoRollup merge of #21591 - GuillaumeGomez:hash, r=alexcrichton
Manish Goregaokar [Tue, 27 Jan 2015 16:54:02 +0000 (22:24 +0530)]
Rollup merge of #21591 - GuillaumeGomez:hash, r=alexcrichton

Fixes #21547 issue.

9 years agoborrowck: aliasability violation with closure captures can happen
Edward Wang [Tue, 27 Jan 2015 15:55:07 +0000 (23:55 +0800)]
borrowck: aliasability violation with closure captures can happen

It was considered to be impossible but actually it can
happen for nested closures. Also, because there must
be nested closures when this happens, we can use more
targeted help message.

Closes #21390
Closes #21600

9 years agoAdjust error messages due to having more type information available.
Niko Matsakis [Tue, 27 Jan 2015 14:39:53 +0000 (09:39 -0500)]
Adjust error messages due to having more type information available.

9 years agoUpdate debug messages to match the new names of the methods they are in.
Niko Matsakis [Thu, 22 Jan 2015 20:14:07 +0000 (15:14 -0500)]
Update debug messages to match the new names of the methods they are in.

9 years agoFix two type inference failures uncovered by japaric corresponding to
Niko Matsakis [Sun, 11 Jan 2015 02:44:14 +0000 (21:44 -0500)]
Fix two type inference failures uncovered by japaric corresponding to
UFCS form. In both cases the problems came about because we were
failing to process pending trait obligations. So change code to
process pending trait obligations before coercions to ensure maximum
type information is available (and also adjust shift to do something
similar).

Fixes #21245.

9 years agoCleanup the unification engine to use associated types, making the code much easier...
Niko Matsakis [Thu, 22 Jan 2015 01:25:24 +0000 (20:25 -0500)]
Cleanup the unification engine to use associated types, making the code much easier to read.