]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #32141 - jseyfried:fix_resolution_in_lexical_scopes, r=nikomatsakis
bors [Sun, 13 Mar 2016 05:55:14 +0000 (21:55 -0800)]
Auto merge of #32141 - jseyfried:fix_resolution_in_lexical_scopes, r=nikomatsakis

Fix name resolution in lexical scopes

Currently, `resolve_item_in_lexical_scope` does not check the "ribs" (type parameters and local variables). This can allow items that should be shadowed by type parameters to be named.

For example,
```rust
struct T { i: i32 }
fn f<T>() {
    let t = T { i: 0 }; // This use of `T` resolves to the struct, not the type parameter
}

mod Foo {
    pub fn f() {}
}
fn g<Foo>() {
    Foo::f(); // This use of `Foo` resolves to the module, not the type parameter
}
```

This PR changes `resolve_item_in_lexical_scope` so that it fails when the item is shadowed by a rib (fixes #32120).
This is a [breaking-change], but it looks unlikely to cause breakage in practice.

r? @nikomatsakis

8 years agoAuto merge of #32217 - alexcrichton:fix-make-dist, r=brson
bors [Sun, 13 Mar 2016 02:58:15 +0000 (18:58 -0800)]
Auto merge of #32217 - alexcrichton:fix-make-dist, r=brson

mk: Fix `make dist`

With the movement of the erro-index-generator and rustbook, need to update the
rules in `make dist`.

8 years agoAuto merge of #32140 - ruud-v-a:avx-intrinsics, r=alexcrichton
bors [Sun, 13 Mar 2016 00:18:34 +0000 (16:18 -0800)]
Auto merge of #32140 - ruud-v-a:avx-intrinsics, r=alexcrichton

Add AVX broadcast and conversion intrinsics

This adds the following intrinsics:

 * `_mm256_broadcast_pd`
 * `_mm256_broadcast_ps`
 * `_mm256_cvtepi32_pd`
 * `_mm256_cvtepi32_ps`
 * `_mm256_cvtpd_epi32`
 * `_mm256_cvtpd_ps`
 * `_mm256_cvtps_epi32`
 * `_mm256_cvtps_pd`
 * `_mm256_cvttpd_epi32`
 * `_mm256_cvttps_epi32`

The "avx" codegen feature must be enabled to use these.

8 years agoAuto merge of #32112 - alexcrichton:fix-issues, r=aturon
bors [Sat, 12 Mar 2016 21:21:06 +0000 (13:21 -0800)]
Auto merge of #32112 - alexcrichton:fix-issues, r=aturon

std: Fix tracking issues and clean deprecated APIs

This PR fixes up a number of discrepancies found with tracking issues (some closed, some needed new ones, etc), and also cleans out all pre-1.8 deprecated APIs. The big beast here was dealing with `std::dynamic_lib`, and via many applications of a large hammer it's now out of the standard library.

8 years agostd: Clean out deprecated APIs
Alex Crichton [Mon, 7 Mar 2016 23:42:29 +0000 (15:42 -0800)]
std: Clean out deprecated APIs

Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that
are deprecated in the 1.8 release are sticking around for the rest of this
cycle.

Some notable changes are:

* The `dynamic_lib` module was moved into `rustc_back` as the compiler still
  relies on a few bits and pieces.
* The `DebugTuple` formatter now special-cases an empty struct name with only
  one field to append a trailing comma.

8 years agomk: Fix `make dist`
Alex Crichton [Sat, 12 Mar 2016 20:22:40 +0000 (12:22 -0800)]
mk: Fix `make dist`

With the movement of the erro-index-generator and rustbook, need to update the
rules in `make dist`.

8 years agoAuto merge of #32193 - eddyb:stage1-is-useful-mkay, r=eddyb
bors [Sat, 12 Mar 2016 17:37:19 +0000 (09:37 -0800)]
Auto merge of #32193 - eddyb:stage1-is-useful-mkay, r=eddyb

Statically link run-pass/command-before-exec so it passes not just whenever we happen to bootstrap perfectly.

8 years agoAuto merge of #32142 - mitaa:rdoc-maybe-inline-local, r=alexcrichton
bors [Sat, 12 Mar 2016 15:31:11 +0000 (07:31 -0800)]
Auto merge of #32142 - mitaa:rdoc-maybe-inline-local, r=alexcrichton

rustdoc: improve crate-local inlining

fixes #28537

r? @alexcrichton

8 years agoStatically link run-pass/command-before-exec so it passes not just whenever we happen...
Eduard Burtescu [Sat, 12 Mar 2016 12:36:35 +0000 (14:36 +0200)]
Statically link run-pass/command-before-exec so it passes not just whenever we happen to bootstrap perfectly.

8 years agostd: Add a tracking issue for Peekable::is_empty
Alex Crichton [Tue, 8 Mar 2016 00:35:09 +0000 (16:35 -0800)]
std: Add a tracking issue for Peekable::is_empty

The listed tracking issue was hooked up to the wrong location by accident.

8 years agocore: Make a new tracking issue for prelude traits
Alex Crichton [Tue, 8 Mar 2016 00:34:35 +0000 (16:34 -0800)]
core: Make a new tracking issue for prelude traits

The referenced issues here were both closed, so hook up a new issue which tracks
specifically the prelude traits being unstable.

8 years agocore: Mark Wrapping impls as stable
Alex Crichton [Tue, 8 Mar 2016 00:29:39 +0000 (16:29 -0800)]
core: Mark Wrapping impls as stable

These are all insta-stable anyway, so just properly tag them.

8 years agostd: Remove unstable from ReentrantMutex
Alex Crichton [Mon, 7 Mar 2016 23:02:43 +0000 (15:02 -0800)]
std: Remove unstable from ReentrantMutex

This isn't exported so it doesn't need a tag.

8 years agotest: Move some test outputs into $(TMPDIR)
Alex Crichton [Mon, 7 Mar 2016 22:39:37 +0000 (14:39 -0800)]
test: Move some test outputs into $(TMPDIR)

Don't want to pollute the source tree!

8 years agoalloc: Add unstable issue for FnBox APIs
Alex Crichton [Mon, 7 Mar 2016 22:38:36 +0000 (14:38 -0800)]
alloc: Add unstable issue for FnBox APIs

8 years agoAuto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis
bors [Sat, 12 Mar 2016 04:57:39 +0000 (20:57 -0800)]
Auto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis

Forbid items with the same name from appearing in overlapping inherent impl blocks

For example, the following is now correctly illegal:

```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}
```

"Overlapping" here is determined the same way it is for traits (and in fact shares the same code path): roughly, there must be some way of substituting any generic types to unify the impls, such that none of the `where` clauses are provably unsatisfiable under such a unification.

Along the way, this PR also introduces an `ImplHeader` abstraction (the first commit) that makes it easier to work with impls abstractly (without caring whether they are trait or inherent impl blocks); see the first commit.

Closes #22889
r? @nikomatsakis

8 years agoAuto merge of #32200 - Manishearth:rollup, r=Manishearth
bors [Sat, 12 Mar 2016 01:50:45 +0000 (17:50 -0800)]
Auto merge of #32200 - Manishearth:rollup, r=Manishearth

Rollup of 11 pull requests

- Successful merges: #32137, #32158, #32171, #32174, #32178, #32179, #32180, #32181, #32183, #32186, #32197
- Failed merges:

8 years agoRollup merge of #32197 - andoriyu:patch-1, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32197 - andoriyu:patch-1, r=alexcrichton

Add FreeBSD amd64 snapshot

Snapshot itself: https://github.com/dhuseby/rust-manual-snapshots/pull/3

8 years agoRollup merge of #32186 - srinivasreddy:libcoretest, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32186 - srinivasreddy:libcoretest, r=steveklabnik

cleanup int suffixes in libcoretest

8 years agoRollup merge of #32183 - bluss:doc-index, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32183 - bluss:doc-index, r=alexcrichton

Clarify doc for slice slicing (Index impls)

Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoRollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik

removed suffixes for librustc_front

8 years agoRollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik

removed integer suffixes in librustc_typeck crate

8 years agoComment `resolve_item_in_lexical_scope`
Jeffrey Seyfried [Fri, 11 Mar 2016 23:28:22 +0000 (23:28 +0000)]
Comment `resolve_item_in_lexical_scope`

8 years agoAuto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichton
bors [Fri, 11 Mar 2016 23:25:03 +0000 (15:25 -0800)]
Auto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichton

cover more linux targets in libstd cargobuild

libstd/build.rs checked the target name against `"unknown-linux"`... That doesn't necessarily apply to all Linux targets as some toolchains for embedded targets will change that `unknown` field to some vendor name. Some shifting around was needed since Android is also a Linux target.

r? @alexcrichton

8 years agoAdjust rustdoc test for new restriction
Aaron Turon [Fri, 11 Mar 2016 23:22:07 +0000 (15:22 -0800)]
Adjust rustdoc test for new restriction

8 years agoRollup merge of #32178 - naltun:patch-1, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32178 - naltun:patch-1, r=steveklabnik

Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoRollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik

Spell fixes for std::ffi doc comments

8 years agoRollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton

Fix a couple compiletest nits.

8 years agoRollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton

lint: mark associated types as live for the dead_code pass

Associated types of trait impls were being excluded from the live list. So types that only appeared in trait impls were being marked as dead code.

8 years agoRollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik

Add missing documentation examples for BinaryHeap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.

r? @steveklabnik

8 years agoAdjust tests to new error message
Aaron Turon [Wed, 9 Mar 2016 16:57:53 +0000 (08:57 -0800)]
Adjust tests to new error message

8 years agoAdd regression test for duplicate items in overlapping impls. Note that a regression...
Aaron Turon [Fri, 26 Feb 2016 22:01:16 +0000 (14:01 -0800)]
Add regression test for duplicate items in overlapping impls. Note that a regression test already exists for *non*overlapping impls.

8 years agoForbid items with the same name being defined in overlapping inherent
Aaron Turon [Fri, 26 Feb 2016 21:21:44 +0000 (13:21 -0800)]
Forbid items with the same name being defined in overlapping inherent
impl blocks.

For example, the following is now correctly illegal:

```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}
```

"Overlapping" here is determined the same way it is for traits (and in
fact shares the same code path): roughly, there must be some way of
substituting any generic types to unify the impls, such that none of the
`where` clauses are provably unsatisfiable under such a unification.

Closes #22889

8 years agoIntroduce `ImplHeader`
Aaron Turon [Fri, 26 Feb 2016 18:51:10 +0000 (10:51 -0800)]
Introduce `ImplHeader`

This commit introduces the idea of an "impl header", which consists of
everything outside the impl body: the Self type, the trait
reference (when applicable), and predicates from `where` clauses. This
type is usable with the type folding machinery, making it possible to
work with impl headers at a higher and more generic level.

8 years agoAdd FreeBSD amd64 snapshot
Andrey Cherkashin [Fri, 11 Mar 2016 18:12:42 +0000 (10:12 -0800)]
Add FreeBSD amd64 snapshot

Snapshot itself: https://github.com/dhuseby/rust-manual-snapshots/pull/3

8 years agoAuto merge of #32134 - jseyfried:forbid_type_alias_as_module, r=nikomatsakis
bors [Fri, 11 Mar 2016 17:26:47 +0000 (09:26 -0800)]
Auto merge of #32134 - jseyfried:forbid_type_alias_as_module, r=nikomatsakis

Forbid glob-importing from a type alias

This PR forbids glob-importing from a type alias or trait (fixes #30560):
```rust
type Alias = ();
use Alias::*; // This is currently allowed but shouldn't be
```

This is a [breaking-change]. Since the disallowed glob imports don't actually import anything, any breakage can be fixed by removing the offending glob import.

r? @alexcrichton

8 years agoAuto merge of #32133 - alexcrichton:linkchecker, r=brson
bors [Fri, 11 Mar 2016 12:38:04 +0000 (04:38 -0800)]
Auto merge of #32133 - alexcrichton:linkchecker, r=brson

Add a link validator to rustbuild

This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.

There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.

The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:

1. New steps are defined for building the tool and running the tool
2. The dependencies are configured
3. The steps are implemented

In terms of the link checker, these commits do a few things:

* A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).
* A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed.
* A few rustdoc bugs here and there were fixed

8 years agoAuto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon
bors [Fri, 11 Mar 2016 06:47:49 +0000 (22:47 -0800)]
Auto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon

rustc: Add an i586-pc-windows-msvc target

Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202

8 years agoAuto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr
bors [Fri, 11 Mar 2016 04:37:04 +0000 (20:37 -0800)]
Auto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr

Add help for E0514

I fixed #30622.

r? @arielb1

8 years agocleanup int suffixes in libcoretest
srinivasreddy [Fri, 11 Mar 2016 03:06:36 +0000 (08:36 +0530)]
cleanup int suffixes in libcoretest

8 years agoAuto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon
bors [Fri, 11 Mar 2016 01:52:12 +0000 (17:52 -0800)]
Auto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon

std: Add impl of FnOnce to AssertRecoverSafe

This was originally intended, but forgot to land by accident!

cc #27719

8 years agoAuto merge of #32117 - mitaa:patch-3, r=alexcrichton
bors [Thu, 10 Mar 2016 22:57:31 +0000 (14:57 -0800)]
Auto merge of #32117 - mitaa:patch-3, r=alexcrichton

rustdoc: correct src-link url

It would have been nice for htmldocck to catch this, especially since there are rustdoc tests specifically for checking src-links.

fixes #32113

8 years agoClarify doc for slice slicing (Index impls)
Ulrik Sverdrup [Thu, 10 Mar 2016 20:36:43 +0000 (21:36 +0100)]
Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoremoved suffixes for librustc_front
srinivasreddy [Thu, 10 Mar 2016 20:02:03 +0000 (01:32 +0530)]
removed suffixes for librustc_front

8 years agoAuto merge of #32107 - Stebalien:partial-write, r=alexcrichton
bors [Thu, 10 Mar 2016 19:56:29 +0000 (11:56 -0800)]
Auto merge of #32107 - Stebalien:partial-write, r=alexcrichton

Never return an error after a partial write

If LineWriter fails to flush, return the number of bytes written instead
of an error.

Fixes #32085

8 years agoremoved integer constants in librustc_typeck
srinivasreddy [Thu, 10 Mar 2016 19:11:25 +0000 (00:41 +0530)]
removed integer constants in librustc_typeck

8 years agoUpdate getting-started.md
Noah [Thu, 10 Mar 2016 17:34:42 +0000 (11:34 -0600)]
Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoAuto merge of #32101 - SimonSapin:patch-11, r=alexcrichton
bors [Thu, 10 Mar 2016 15:05:05 +0000 (07:05 -0800)]
Auto merge of #32101 - SimonSapin:patch-11, r=alexcrichton

Add info in `rustdoc --passes list`

CC @mitaa, https://github.com/rust-lang/rust/pull/32055/files#r55205006

8 years agoAuto merge of #32173 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 10 Mar 2016 13:01:03 +0000 (05:01 -0800)]
Auto merge of #32173 - steveklabnik:rollup, r=steveklabnik

Rollup of 8 pull requests

- Successful merges: #31830, #32091, #32125, #32136, #32147, #32148, #32149, #32150
- Failed merges:

8 years agoSpell fixes for std::ffi doc comments
Craig M. Brandenburg [Thu, 10 Mar 2016 12:14:00 +0000 (05:14 -0700)]
Spell fixes for std::ffi doc comments

8 years agoRemove unnecessary mut in docs causing test failures.
Nathan Kleyn [Thu, 10 Mar 2016 11:40:31 +0000 (11:40 +0000)]
Remove unnecessary mut in docs causing test failures.

8 years agoRollup merge of #32150 - steveklabnik:gh20213, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32150 - steveklabnik:gh20213, r=bluss

Remove inaccurate claim about inline assembly

It's not like GCC's.

Fixes #20213

8 years agoRollup merge of #32149 - steveklabnik:gh31628, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32149 - steveklabnik:gh31628, r=bluss

Add other primitive types to the reference

Fixes #31628

8 years agoRollup merge of #32148 - steveklabnik:gh31912, r=apasel422
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32148 - steveklabnik:gh31912, r=apasel422

Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912

8 years agoRollup merge of #32147 - steveklabnik:gh31950, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32147 - steveklabnik:gh31950, r=bluss

Clarify that try_unwrap needs exactly one

Fixes #31950

8 years agoRollup merge of #32136 - nathankleyn:improve-docs-for-btreeset, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32136 - nathankleyn:improve-docs-for-btreeset, r=steveklabnik

Add missing documentation examples for BTreeSet.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeSet` collection
type.

This is part of issue #29348.

r? @steveklabnik

8 years agoRollup merge of #32125 - pyfisch:patch-2, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32125 - pyfisch:patch-2, r=steveklabnik

Remove final note from testing chapter.

The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.

8 years agoRollup merge of #32091 - dirk:dirk/siphasher-docs-clarification, r=alexcrichton
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32091 - dirk:dirk/siphasher-docs-clarification, r=alexcrichton

Clarify documentation of hash::SipHasher

The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links.

Fixes #32043.

r? @sfackler

8 years agoRollup merge of #31830 - frewsxcv:assoc-func, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #31830 - frewsxcv:assoc-func, r=steveklabnik

Prefer 'associated function' over 'static method' in msg.

TRPL seems to refer to 'static functions' as 'associated functions'.
This terminology should be used consistently.

8 years agoAuto merge of #32100 - SimonSapin:patch-6, r=alexcrichton
bors [Thu, 10 Mar 2016 10:45:14 +0000 (02:45 -0800)]
Auto merge of #32100 - SimonSapin:patch-6, r=alexcrichton

"can be built on Ref::map"… how?

Now that `std::cell::Ref::filter_map` and `RefMut::filter_map` are deprecated, using them gives a warning like:
```
script/dom/element.rs:754:9: 754:24 warning: use of deprecated item: can be built on Ref::map, #[warn(deprecated)] on by default
```

But it’s not at all obvious *how* the functionality can be built on `Ref::map`. This PR adds to the warning message a crates.io URL for a crate that does.

8 years agoDifferentiate "line" and "line number" variable names.
Corey Farwell [Thu, 10 Mar 2016 06:13:51 +0000 (22:13 -0800)]
Differentiate "line" and "line number" variable names.

8 years agoPrefer `Option::expect` over explicit unwrapping.
Corey Farwell [Thu, 10 Mar 2016 05:44:35 +0000 (21:44 -0800)]
Prefer `Option::expect` over explicit unwrapping.

8 years agoAuto merge of #32097 - jseyfried:fix_resolution_regression, r=nikomatsakis
bors [Thu, 10 Mar 2016 06:41:48 +0000 (22:41 -0800)]
Auto merge of #32097 - jseyfried:fix_resolution_regression, r=nikomatsakis

Fix a regression in import resolution

This fixes #32089 (caused by #31726) by deducing that name resolution has failed (as opposed to being determinate) in more cases.

r? @nikomatsakis

8 years agoPrefer 'associated function' over 'static method' in msg.
Corey Farwell [Tue, 23 Feb 2016 05:04:30 +0000 (00:04 -0500)]
Prefer 'associated function' over 'static method' in msg.

TRPL seems to refer to 'static functions' as 'associated functions'.
This terminology should be used consistently.

8 years agoAuto merge of #31710 - eddyb:reify, r=nikomatsakis
bors [Thu, 10 Mar 2016 04:16:20 +0000 (20:16 -0800)]
Auto merge of #31710 - eddyb:reify, r=nikomatsakis

Distinguish fn item types to allow reification from nothing to fn pointers.

The first commit is a rebase of #26284, except for files that have moved since.

This is a [breaking-change], due to:
* each FFI function has a distinct type, like all other functions currently do
* all generic parameters on functions are recorded in their item types, e.g.:
`size_of::<u8>` & `size_of::<i8>`'s types differ despite their identical signature.
* function items are zero-sized, which will stop transmutes from working on them

The first two cases are handled in most cases with the new coerce-unify logic,
which will combine incompatible function item types into function pointers,
at the outer-most level of if-else chains, match arms and array literals.

The last case is specially handled during type-checking such that transmutes
from a function item type to a pointer or integer type will continue to work for
another release cycle, but are being linted against. To get rid of warnings and
ensure your code will continue to compile, cast to a pointer before transmuting.

8 years agoRemove `feature(globs)` since they are stable
mitaa [Tue, 8 Mar 2016 23:57:13 +0000 (00:57 +0100)]
Remove `feature(globs)` since they are stable

8 years agoConsider `doc(hidden)` for crate-local inlining
mitaa [Thu, 10 Mar 2016 02:29:46 +0000 (03:29 +0100)]
Consider `doc(hidden)` for crate-local inlining

8 years agoAuto merge of #31618 - alexcrichton:no-thread-spawns, r=brson
bors [Thu, 10 Mar 2016 02:18:10 +0000 (18:18 -0800)]
Auto merge of #31618 - alexcrichton:no-thread-spawns, r=brson

Optimize some functions in std::process

* Be sure that `read_to_end` gets directed towards `read_to_end_uninitialized` for all handles
* When spawning a child that guaranteed doesn't need a stdin, don't actually create a stdin pipe for that process, instead just redirect it to /dev/null
* When calling `wait_with_output`, don't spawn threads to read out the pipes of the child. Instead drain all pipes on the calling thread and *then* wait on the process.

Functionally, it is intended that nothing changes as part of this PR

---

Note that this was the same as #31613, and even after that it turned out that fixing Windows was easier than I thought! To copy a comment from over there:

> As some rationale for this as well, it's always bothered me that we've spawned threads in the standard library for this (seems a bit overkill), and I've also been curious lately as to our why our build times for Windows are so much higher than Unix (on the buildbots we have). I have done basically 0 investigation into why, but I figured it can't help to try to optimize Command::output which I believe is called quite a few times during the test suite.

8 years agoAuto merge of #32165 - alexcrichton:fix-broken-master, r=alexcrichton
bors [Thu, 10 Mar 2016 00:21:32 +0000 (16:21 -0800)]
Auto merge of #32165 - alexcrichton:fix-broken-master, r=alexcrichton

collections: Fix broken doc example

PR #32135 was accidentally merged without tests passing, and unfortunately one
of the tests added was broken, so this fixes that.

8 years agocollections: Fix broken doc example
Alex Crichton [Thu, 10 Mar 2016 00:20:32 +0000 (16:20 -0800)]
collections: Fix broken doc example

PR #32135 was accidentally merged without tests passing, and unfortunately one
of the tests added was broken, so this fixes that.

8 years agoMerge pull request #32135 from nathankleyn/improve-docs-for-btreemap
Steve Klabnik [Wed, 9 Mar 2016 22:14:40 +0000 (01:14 +0300)]
Merge pull request #32135 from nathankleyn/improve-docs-for-btreemap

Add missing documentation examples for BTreeMap.

8 years agolint: mark associated types as live for the dead_code pass
Sean McArthur [Wed, 9 Mar 2016 18:12:24 +0000 (10:12 -0800)]
lint: mark associated types as live for the dead_code pass

8 years agostd: Don't spawn threads in `wait_with_output`
Alex Crichton [Fri, 12 Feb 2016 18:29:25 +0000 (10:29 -0800)]
std: Don't spawn threads in `wait_with_output`

Semantically there's actually no reason for us to spawn threads as part of the
call to `wait_with_output`, and that's generally an incredibly heavyweight
operation for just reading a few bytes (especially when stderr probably rarely
has bytes!). An equivalent operation in terms of what's implemented today would
be to just drain both pipes of all contents and then call `wait` on the child
process itself.

On Unix we can implement this through some convenient use of the `select`
function, whereas on Windows we can make use of overlapped I/O. Note that on
Windows this requires us to use named pipes instead of anonymous pipes, but
they're semantically the same under the hood.

8 years agoAdd missing "basic usage" sections to docs, fix review comments.
Nathan Kleyn [Wed, 9 Mar 2016 16:39:23 +0000 (16:39 +0000)]
Add missing "basic usage" sections to docs, fix review comments.

8 years agotrans: Keep transmutes from fn item types working, but lint them.
Eduard Burtescu [Wed, 9 Mar 2016 16:35:27 +0000 (18:35 +0200)]
trans: Keep transmutes from fn item types working, but lint them.

8 years agoAddress review comments to add "basic usage" sections to docs.
Nathan Kleyn [Wed, 9 Mar 2016 16:18:31 +0000 (16:18 +0000)]
Address review comments to add "basic usage" sections to docs.

8 years agoAuto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakis
bors [Wed, 9 Mar 2016 15:14:05 +0000 (07:14 -0800)]
Auto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakis

Fix incorrect trait privacy error

This PR fixes #21670 by using the crate metadata instead of `ExternalExports` to determine if an external item is public.

r? @nikomatsakis

8 years agotypeck: Unify if-else blocks, match arms and array elements by coercing where possible.
Eduard Burtescu [Sun, 6 Mar 2016 15:33:30 +0000 (17:33 +0200)]
typeck: Unify if-else blocks, match arms and array elements by coercing where possible.

8 years agotypeck: Remove the redundant "unifier" from check_expr_with_unifier.
Eduard Burtescu [Mon, 22 Feb 2016 19:39:57 +0000 (21:39 +0200)]
typeck: Remove the redundant "unifier" from check_expr_with_unifier.

8 years agotypeck: Support multiple expressions getting coerced at the same type.
Eduard Burtescu [Mon, 22 Feb 2016 12:06:19 +0000 (14:06 +0200)]
typeck: Support multiple expressions getting coerced at the same type.

8 years agotypeck: don't wastefully clone expressions for cast checks.
Eduard Burtescu [Sun, 21 Feb 2016 19:39:32 +0000 (21:39 +0200)]
typeck: don't wastefully clone expressions for cast checks.

8 years agotypeck: Remove Coerce::unpack_actual_value.
Eduard Burtescu [Sun, 21 Feb 2016 16:58:08 +0000 (18:58 +0200)]
typeck: Remove Coerce::unpack_actual_value.

8 years agoinfer: Take the origin in report_mismatched_types.
Eduard Burtescu [Sun, 21 Feb 2016 16:57:30 +0000 (18:57 +0200)]
infer: Take the origin in report_mismatched_types.

8 years agotypeck: rename mk_assignty to coercion::try.
Eduard Burtescu [Sun, 21 Feb 2016 16:56:35 +0000 (18:56 +0200)]
typeck: rename mk_assignty to coercion::try.

8 years agoinfer: Remove redundant commit_if_ok calls.
Eduard Burtescu [Sun, 21 Feb 2016 16:53:53 +0000 (18:53 +0200)]
infer: Remove redundant commit_if_ok calls.

8 years agoTest that function types are actually zero-sized.
Eduard Burtescu [Sun, 21 Feb 2016 11:52:41 +0000 (13:52 +0200)]
Test that function types are actually zero-sized.

8 years agotests: Avoid transmuting from fn item types.
Eduard Burtescu [Thu, 18 Feb 2016 13:19:38 +0000 (15:19 +0200)]
tests: Avoid transmuting from fn item types.

8 years agotypeck: Use TyFnDef for methods.
Eduard Burtescu [Thu, 18 Feb 2016 13:19:11 +0000 (15:19 +0200)]
typeck: Use TyFnDef for methods.

8 years agotypeck: Introduce reification for fn ptr casts.
Eduard Burtescu [Thu, 18 Feb 2016 13:18:46 +0000 (15:18 +0200)]
typeck: Introduce reification for fn ptr casts.

8 years agotrans: Reify functions & methods to fn ptrs only where necessary.
Eduard Burtescu [Sun, 6 Mar 2016 15:32:47 +0000 (17:32 +0200)]
trans: Reify functions & methods to fn ptrs only where necessary.

8 years agotrans: Remove unused ref_id from monomorphic_fn.
Eduard Burtescu [Wed, 17 Feb 2016 07:11:46 +0000 (09:11 +0200)]
trans: Remove unused ref_id from monomorphic_fn.

8 years agotrans: Move type_of_fn_from_ty callers to type_of.
Eduard Burtescu [Wed, 17 Feb 2016 09:10:46 +0000 (11:10 +0200)]
trans: Move type_of_fn_from_ty callers to type_of.

8 years agoPrint fn type parameters for TyFnDef.
Eduard Burtescu [Tue, 16 Feb 2016 16:37:32 +0000 (18:37 +0200)]
Print fn type parameters for TyFnDef.

8 years agoTrack fn type and lifetime parameters in TyFnDef.
Eduard Burtescu [Tue, 16 Feb 2016 16:36:41 +0000 (18:36 +0200)]
Track fn type and lifetime parameters in TyFnDef.

8 years agoSplit TyBareFn into TyFnDef and TyFnPtr.
Eli Friedman [Sat, 13 Jun 2015 20:15:03 +0000 (13:15 -0700)]
Split TyBareFn into TyFnDef and TyFnPtr.

There's a lot of stuff wrong with the representation of these types:
TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to
represent method calls, TyFnDef in the sub-expression of a cast isn't
correctly reified, and probably some other stuff I haven't discovered yet.
Splitting them seems like the right first step, though.

8 years agoAuto merge of #31631 - jonas-schievink:agoraphobia, r=nrc
bors [Wed, 9 Mar 2016 13:25:48 +0000 (05:25 -0800)]
Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrc

[breaking-batch] Move more uses of `panictry!` out of libsyntax

8 years agoAuto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc
bors [Wed, 9 Mar 2016 11:34:55 +0000 (03:34 -0800)]
Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc

Show clearer error message when #![deny(warnings)] escalates a warning

Addresses #30730

8 years agoAuto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis
bors [Wed, 9 Mar 2016 09:45:33 +0000 (01:45 -0800)]
Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis

Make errors for unnecessary visibility qualifiers consistent

This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919).

r? @nikomatsakis

8 years agoRemove inaccurate claim about inline assembly
Steve Klabnik [Wed, 9 Mar 2016 08:52:35 +0000 (03:52 -0500)]
Remove inaccurate claim about inline assembly

It's not like GCC's.

Fixes #20213

8 years agoAdd other primitive types to the reference
Steve Klabnik [Wed, 9 Mar 2016 08:42:36 +0000 (03:42 -0500)]
Add other primitive types to the reference

Fixes #31628