]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #31735 - aliclark:freebsd-link-defs, r=alexcrichton
bors [Fri, 19 Feb 2016 05:15:17 +0000 (05:15 +0000)]
Auto merge of #31735 - aliclark:freebsd-link-defs, r=alexcrichton

The FreeBSD linker config is missing some options present in the other BSD configs.

This seems accidental, with other BSDs having the flags added in platform-specific commits, or with the flags present from day 1.

Some other BSD commits for reference:
https://github.com/aliclark/rust/commit/fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae#diff-db69d903e469b7769aefaa31786fc2c4R1
https://github.com/aliclark/rust/commit/0b7c4f57f6ba59dabe4db2808fe45e8bd8bbce22#diff-1c7b74536ce0291d1f89953035f26a71R1

https://github.com/aliclark/rust/commit/cfd2a5cfa148b1c927571cc2e9f06e242831b696

8 years agoAuto merge of #31716 - jseyfried:fix_privacy_for_def_err, r=nrc
bors [Fri, 19 Feb 2016 02:18:25 +0000 (02:18 +0000)]
Auto merge of #31716 - jseyfried:fix_privacy_for_def_err, r=nrc

Fixes #31714

8 years agoImprove dummy bindings for unresolved imports
Jeffrey Seyfried [Fri, 19 Feb 2016 00:42:30 +0000 (00:42 +0000)]
Improve dummy bindings for unresolved imports

8 years agoAuto merge of #31684 - tmiasko:alternate-stack, r=alexcrichton
bors [Thu, 18 Feb 2016 23:23:22 +0000 (23:23 +0000)]
Auto merge of #31684 - tmiasko:alternate-stack, r=alexcrichton

Remove alternate stack with sigaltstack before unmaping it.

Also reuse existing signal stack if already set, this is especially
useful when working with sanitizers that configure alternate stack
themselves.

This change depends on SS_DISABLE recently introduced in libc crate and updates
this git submodule accordingly.

8 years agoAuto merge of #31600 - nagisa:mir-msvc-seh-2, r=nikomatsakis
bors [Thu, 18 Feb 2016 20:46:28 +0000 (20:46 +0000)]
Auto merge of #31600 - nagisa:mir-msvc-seh-2, r=nikomatsakis

r? @alexcrichton for the translator changes and @nikomatsakis for the no-landing-pads pass.

8 years agoAuto merge of #31734 - aliclark:bsd-stat-fixes, r=alexcrichton
bors [Thu, 18 Feb 2016 16:29:55 +0000 (16:29 +0000)]
Auto merge of #31734 - aliclark:bsd-stat-fixes, r=alexcrichton

In https://github.com/rust-lang/rust/issues/25155 the os::freebsd::raw stat was split for the x86 vs. x86-64 cases, which appears to have been done to implement the padding on the end of struct stat for the x86 case (the struct is otherwise the same notwistanding the size of long).

This PR de-duplicates the struct using #[cfg(target_arch = "x86")] for the __unused field, which also fixes the definitions which had sinced changed with the LFS work d088b671872f1df6993ccca6fa6139ebed0a8cf3.

Also changed definitions to c_long for dragonfly and freebsd where appropriate.

Also removes some unused imports that the compiler was complaining about.

dragonfly's long time_t:
https://gitweb.dragonflybsd.org/dragonfly.git/blob/a2a57c243ff8016578bc559f8603fb25bbcf1768:/lib/libstand/machine/stdint.h

freebsd's long time_t:
https://svnweb.freebsd.org/base/release/10.1.0/sys/x86/include/_types.h?view=markup
https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L980

freebsd's padding for i686 stat:
https://svnweb.freebsd.org/base/release/10.1.0/sys/sys/stat.h?view=markup#l139
https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L1038

8 years agoAuto merge of #31394 - nikomatsakis:incr-comp-variance, r=pnkfelix
bors [Thu, 18 Feb 2016 13:28:27 +0000 (13:28 +0000)]
Auto merge of #31394 - nikomatsakis:incr-comp-variance, r=pnkfelix

Make the dep. graph edges created by variance just mirror the constraint graph.

Note that this extends <https://github.com/rust-lang/rust/pull/31304>, so the first few commits are on a different topic.

r? @pnkfelix

8 years agoAuto merge of #31728 - Amanieu:recoversafe_into_inner, r=alexcrichton
bors [Thu, 18 Feb 2016 10:35:25 +0000 (10:35 +0000)]
Auto merge of #31728 - Amanieu:recoversafe_into_inner, r=alexcrichton

This allows a `FnOnce` to be wrapped in an `AssertRecoverSafe`.

8 years agoChange how dep-graph edges are handled in variance to
Niko Matsakis [Wed, 3 Feb 2016 21:00:23 +0000 (16:00 -0500)]
Change how dep-graph edges are handled in variance to
be more fine-grained, fixing the `dep-graph-struct-signature`
test.

8 years agoFix a weird case in the HIR map, where fields are not present in the
Niko Matsakis [Wed, 3 Feb 2016 20:59:35 +0000 (15:59 -0500)]
Fix a weird case in the HIR map, where fields are not present in the
map. Perhaps I ought to just add them instead, but this seems harmless
enough.

8 years agoBreak the `variance` module into submodules for ease of comprehension.
Niko Matsakis [Wed, 3 Feb 2016 16:37:23 +0000 (11:37 -0500)]
Break the `variance` module into submodules for ease of comprehension.

8 years agoAuto merge of #31727 - semarie:openbsd-llvm-cpu, r=alexcrichton
bors [Thu, 18 Feb 2016 07:35:49 +0000 (07:35 +0000)]
Auto merge of #31727 - semarie:openbsd-llvm-cpu, r=alexcrichton

The initial purpose is to workaround the LLVM bug
https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD.

By default, the `cpu` is defined to `generic`. But with a 64bit
processor, the optimization for `generic` will use invalid asm code as
NOP (the generated code for NOP isn't a NOP).

According to #20777, "x86-64" is the right thing to do for x86_64
builds.

Closes: #31363
r? @alexcrichton

8 years agoRemove alternate stack with sigaltstack before unmapping it.
Tomasz Miąsko [Mon, 15 Feb 2016 14:45:52 +0000 (15:45 +0100)]
Remove alternate stack with sigaltstack before unmapping it.

Also reuse existing signal stack if already set, this is especially
useful when working with sanitizers that configure alternate stack
themselves.

8 years agoAuto merge of #31641 - petrochenkov:reach, r=alexcrichton
bors [Thu, 18 Feb 2016 03:35:21 +0000 (03:35 +0000)]
Auto merge of #31641 - petrochenkov:reach, r=alexcrichton

Fixes https://github.com/rust-lang/rust/issues/16734 and probably some other issues

This is a continuation of https://github.com/rust-lang/rust/pull/29822, but the algorithm is mostly a copy of https://github.com/rust-lang/rust/pull/29973, so
r? @alexcrichton or @nikomatsakis

8 years agoAuto merge of #31739 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 18 Feb 2016 00:33:58 +0000 (00:33 +0000)]
Auto merge of #31739 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #31565, #31679, #31694, #31695, #31703, #31720, #31733
- Failed merges:

8 years agoRollup merge of #31733 - gkoz:strip_prefix_docs, r=alexcrichton
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31733 - gkoz:strip_prefix_docs, r=alexcrichton

It wasn't fixed after copy-pasting. This probably needs to be backported to beta.

8 years agoRollup merge of #31720 - frewsxcv:std-mem-transmute-copy-example, r=steveklabnik
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31720 - frewsxcv:std-mem-transmute-copy-example, r=steveklabnik

Prior to this commit, it was a trivial example that did not demonstrate
the effects of using the function.

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

8 years agoRollup merge of #31703 - WiSaGaN:bugfix/fix-link-in-release-notes, r=alexcrichton
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31703 - WiSaGaN:bugfix/fix-link-in-release-notes, r=alexcrichton

8 years agoRollup merge of #31695 - oconnor663:chardocs, r=alexcrichton
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31695 - oconnor663:chardocs, r=alexcrichton

Previously the docs suggested that '❤️' doesn't fit in a char because
it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char,
even though it's only 3 bytes. The important thing is the number of code
points, not the number of bytes. Clarify the primitive char docs around
this.

8 years agoRollup merge of #31694 - oconnor663:insertdocs, r=steveklabnik
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31694 - oconnor663:insertdocs, r=steveklabnik

The first time I read the docs for `insert()`, I thought it was saying it didn't update existing *values*, and I was confused. Reword the docs to make it clear that `insert()` does update values.

8 years agoRollup merge of #31679 - GuillaumeGomez:long_error_explanation, r=Manishearth
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31679 - GuillaumeGomez:long_error_explanation, r=Manishearth

r? @Manishearth

8 years agoRollup merge of #31565 - SDX2000:docfixes4, r=steveklabnik
Steve Klabnik [Wed, 17 Feb 2016 23:14:35 +0000 (18:14 -0500)]
Rollup merge of #31565 - SDX2000:docfixes4, r=steveklabnik

See title and diff for more information.

8 years agoCheck reachability insead of publicity for fields and inherent impl items
Vadim Petrochenkov [Wed, 17 Feb 2016 22:10:21 +0000 (01:10 +0300)]
Check reachability insead of publicity for fields and inherent impl items

Purely for consistency with other items, it doesn't make any semantic difference

8 years agoAdd more tests for unnameable reachable items
Vadim Petrochenkov [Tue, 16 Feb 2016 20:38:41 +0000 (23:38 +0300)]
Add more tests for unnameable reachable items

8 years agoprivacy: Mark reachable but unnameable items as reachable
Vadim Petrochenkov [Sat, 13 Feb 2016 21:04:17 +0000 (00:04 +0300)]
privacy: Mark reachable but unnameable items as reachable

8 years agoMSVC SEH in MIR is implemented here
Simonas Kazlauskas [Thu, 11 Feb 2016 20:57:09 +0000 (22:57 +0200)]
MSVC SEH in MIR is implemented here

8 years agoAuto merge of #31707 - GuillaumeGomez:macro_name, r=sfackler
bors [Wed, 17 Feb 2016 19:15:53 +0000 (19:15 +0000)]
Auto merge of #31707 - GuillaumeGomez:macro_name, r=sfackler

I'm wondering if instead of a second help message, a note would be better. I let it up to reviewers.

8 years agobring freebsd linker config up-to-date (same as dragonfly)
Ali Clark [Wed, 17 Feb 2016 18:46:16 +0000 (18:46 +0000)]
bring freebsd linker config up-to-date (same as dragonfly)

8 years agoUpdate `Path::strip_prefix` doc
Gleb Kozyrev [Wed, 17 Feb 2016 18:13:59 +0000 (20:13 +0200)]
Update `Path::strip_prefix` doc

8 years agore-add freebsd padding
Ali Clark [Wed, 17 Feb 2016 16:59:03 +0000 (16:59 +0000)]
re-add freebsd padding

reproduces the padding found here:
https://svnweb.freebsd.org/base/release/10.1.0/sys/sys/stat.h?view=markup#l139

8 years agotime_t is long on freebsd and dragonfly (and nsec should be long)
Ali Clark [Wed, 17 Feb 2016 16:55:43 +0000 (16:55 +0000)]
time_t is long on freebsd and dragonfly (and nsec should be long)

This becomes less relevant for dragonfly a i686 support is dropped since
release 40, but using long allows some compatibility for older versions.

8 years agoAuto merge of #31718 - apasel422:issue-31711, r=bluss
bors [Wed, 17 Feb 2016 16:18:54 +0000 (16:18 +0000)]
Auto merge of #31718 - apasel422:issue-31711, r=bluss

This changes the performance of `drop` from linear to constant time for such `HashMap`s.

Closes #31711.

r? @bluss

8 years agoMade v2 mutable so that we can actually truncate it.
Sandeep Datta [Wed, 17 Feb 2016 15:17:24 +0000 (20:47 +0530)]
Made v2 mutable so that we can actually truncate it.

8 years agounfork freebsd stat definitions, fixes x86
Ali Clark [Wed, 17 Feb 2016 14:10:02 +0000 (14:10 +0000)]
unfork freebsd stat definitions, fixes x86

8 years agoremove unused import from dragonfly os raw
Ali Clark [Wed, 17 Feb 2016 14:09:22 +0000 (14:09 +0000)]
remove unused import from dragonfly os raw

8 years agoAuto merge of #31696 - apasel422:placement, r=pnkfelix
bors [Wed, 17 Feb 2016 13:25:15 +0000 (13:25 +0000)]
Auto merge of #31696 - apasel422:placement, r=pnkfelix

CC #30172.

r? @pnkfelix
CC @nagisa

8 years agoAdd into_inner to AssertRecoverSafe
Amanieu d'Antras [Wed, 17 Feb 2016 11:29:18 +0000 (11:29 +0000)]
Add into_inner to AssertRecoverSafe

8 years agospecify the cpu type for LLVM for OpenBSD target
Sébastien Marie [Wed, 17 Feb 2016 10:30:42 +0000 (11:30 +0100)]
specify the cpu type for LLVM for OpenBSD target

The initial purpose is to workaround the LLVM bug
https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD.

By default, the `cpu' is defined to `generic`. But with a 64bit
processor, the optimization for `generic` will use invalid asm code as
NOP (the generated code for NOP isn't a NOP).

According to #20777, "x86-64" is the right thing to do for x86_64
builds.

Closes: #31363
8 years agoAuto merge of #31666 - dirk:dirk/clarify-memory-arrangement-in-vec-docs, r=steveklabnik
bors [Wed, 17 Feb 2016 09:20:11 +0000 (09:20 +0000)]
Auto merge of #31666 - dirk:dirk/clarify-memory-arrangement-in-vec-docs, r=steveklabnik

Tweak documentation to clarify the structure of `Vec`s as contiguous arrays of items in memory.

Closes #31554; contributes to #29380.

r? @steveklabnik

8 years agoAuto merge of #31685 - petrochenkov:patrefact2, r=eddyb
bors [Wed, 17 Feb 2016 06:01:49 +0000 (06:01 +0000)]
Auto merge of #31685 - petrochenkov:patrefact2, r=eddyb

And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`.
This is the HIR part of https://github.com/rust-lang/rust/pull/31581.
This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492.

r? @eddyb

8 years agoAuto merge of #31717 - alexcrichton:llvmup2, r=brson
bors [Wed, 17 Feb 2016 03:25:45 +0000 (03:25 +0000)]
Auto merge of #31717 - alexcrichton:llvmup2, r=brson

This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.

Closes #31702

8 years agoImprove 'std::mem::transmute_copy' doc example.
Corey Farwell [Wed, 17 Feb 2016 02:43:49 +0000 (21:43 -0500)]
Improve 'std::mem::transmute_copy' doc example.

Prior to this commit, it was a trivial example that did not demonstrate
the effects of using the function.

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

8 years agoImplement placement-in protocol for `LinkedList`
Andrew Paseltiner [Tue, 16 Feb 2016 03:10:01 +0000 (22:10 -0500)]
Implement placement-in protocol for `LinkedList`

CC #30172.

8 years agoAvoid iteration when dropping `HashMap`s whose items don't need dropping
Andrew Paseltiner [Tue, 16 Feb 2016 23:20:35 +0000 (18:20 -0500)]
Avoid iteration when dropping `HashMap`s whose items don't need dropping

This changes the performance of `drop` from linear to constant time for
such `HashMap`s.

Closes #31711.

8 years agorustc: Rebase LLVM on the 3.8 release branch
Alex Crichton [Tue, 16 Feb 2016 17:58:41 +0000 (09:58 -0800)]
rustc: Rebase LLVM on the 3.8 release branch

This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.

8 years agoAuto merge of #31680 - arielb1:fast-fulfill, r=nikomatsakis
bors [Tue, 16 Feb 2016 22:35:09 +0000 (22:35 +0000)]
Auto merge of #31680 - arielb1:fast-fulfill, r=nikomatsakis

this improves typeck performance by 5% (LLVM times are still huge).

Basically fixes #25916 (still O(n^2), but the example takes <1s to
compile).

r? @nikomatsakis

8 years agoDon't compute LastPrivate data for Def::Err.
Jeffrey Seyfried [Tue, 16 Feb 2016 21:59:46 +0000 (21:59 +0000)]
Don't compute LastPrivate data for Def::Err.

8 years agoAdd check on find_best_match_for_name and improve help message for undefined macro
ggomez [Tue, 16 Feb 2016 13:47:37 +0000 (14:47 +0100)]
Add check on find_best_match_for_name and improve help message for undefined macro

8 years agoAuto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakis
bors [Tue, 16 Feb 2016 19:34:57 +0000 (19:34 +0000)]
Auto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakis

This PR disallows non-inline modules without path annotations that are either in a block or in an inline module whose containing file is not a directory owner (fixes #29765).
This is a [breaking-change].
r? @nikomatsakis

8 years agoAuto merge of #30714 - wesleywiser:fix_29914, r=arielb1
bors [Tue, 16 Feb 2016 17:13:46 +0000 (17:13 +0000)]
Auto merge of #30714 - wesleywiser:fix_29914, r=arielb1

The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes #29914

8 years agoAuto merge of #31678 - JohanLorenzo:follow-up-31368, r=alexcrichton
bors [Tue, 16 Feb 2016 15:12:40 +0000 (15:12 +0000)]
Auto merge of #31678 - JohanLorenzo:follow-up-31368, r=alexcrichton

Thanks for catching this @tamird. Here's a quick fix. I didn't pick "let the linker link dead code" or "link dead code" because it would add no extra information to the flag name. Here's a another proposal.

r? @alexcrichton

8 years agoAuto merge of #31675 - pitdicker:fs_metadata, r=alexcrichton
bors [Tue, 16 Feb 2016 13:09:55 +0000 (13:09 +0000)]
Auto merge of #31675 - pitdicker:fs_metadata, r=alexcrichton

Because we no longer use `GetFileAttributesExW` FileAttr is never created directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore. So we should no longer store FileAttr's attributes in that c struct.

r? @alexcrichton
Is this what you had in mind?

8 years agoFix links in release notes 1.7.0
Wangshan Lu [Tue, 16 Feb 2016 11:40:06 +0000 (19:40 +0800)]
Fix links in release notes 1.7.0

8 years agoAuto merge of #31672 - semarie:rmake-cxx, r=alexcrichton
bors [Tue, 16 Feb 2016 11:10:30 +0000 (11:10 +0000)]
Auto merge of #31672 - semarie:rmake-cxx, r=alexcrichton

use CXX value found at configure time inside run-make tests.

it permits OpenBSD to pass llvm-module-pass test (which use CXX
variable).

r? @alexcrichton

8 years agoAuto merge of #31669 - frewsxcv:llvm-function-pass-rmake-test, r=alexcrichton
bors [Tue, 16 Feb 2016 09:07:37 +0000 (09:07 +0000)]
Auto merge of #31669 - frewsxcv:llvm-function-pass-rmake-test, r=alexcrichton

Part of https://github.com/rust-lang/rust/issues/31185.

Similar to https://github.com/rust-lang/rust/pull/31391.

8 years agoAuto merge of #31668 - cuviper:lfs, r=alexcrichton
bors [Tue, 16 Feb 2016 07:01:34 +0000 (07:01 +0000)]
Auto merge of #31668 - cuviper:lfs, r=alexcrichton

This follows the pattern already used for stat functions from #31551.  Now
`ftruncate`, `lseek`, and `readdir_r` use their explicit 64-bit variants for
LFS support, using wider `off_t` and `dirent` types.  This also updates to
`open64`, which uses no different types but implies the `O_LARGEFILE` flag.

Non-Linux platforms just map their normal functions to the 64-bit names.

r? @alexcrichton

8 years agopass CXX to run-make
Sébastien Marie [Mon, 15 Feb 2016 08:35:30 +0000 (09:35 +0100)]
pass CXX to run-make

use CXX value found at configure time inside run-make tests.

it permits OpenBSD to pass llvm-module-pass test (which use CXX
variable).

8 years agoAuto merge of #31627 - KiChjang:unstable-lint, r=alexcrichton
bors [Tue, 16 Feb 2016 05:16:55 +0000 (05:16 +0000)]
Auto merge of #31627 - KiChjang:unstable-lint, r=alexcrichton

Fixes #31122.

8 years agoAuto merge of #31639 - quodlibetor:doc-search-with-unknown-types, r=alexcrichton
bors [Tue, 16 Feb 2016 03:03:35 +0000 (03:03 +0000)]
Auto merge of #31639 - quodlibetor:doc-search-with-unknown-types, r=alexcrichton

This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.

I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.

8 years agoclarify how insert() doesn't update keys
Jack O'Connor [Sat, 30 Jan 2016 18:44:45 +0000 (13:44 -0500)]
clarify how insert() doesn't update keys

The first time I read the docs for `insert()`, I thought it was saying
it didn't update existing *values*, and I was confused. Reword the docs
to make it clear that `insert()` does update values.

8 years agocorrect the primitive char doc's use of bytes and code points
Jack O'Connor [Tue, 16 Feb 2016 01:18:16 +0000 (20:18 -0500)]
correct the primitive char doc's use of bytes and code points

Previously the docs suggested that '❤️' doesn't fit in a char because
it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char,
even though it's only 3 bytes. The important thing is the number of code
points, not the number of bytes. Clarify the primitive char docs around
this.

8 years agoAuto merge of #31646 - Manishearth:rollup, r=Manishearth
bors [Mon, 15 Feb 2016 22:41:02 +0000 (22:41 +0000)]
Auto merge of #31646 - Manishearth:rollup, r=Manishearth

- Successful merges: #31551, #31581, #31614, #31626, #31632, #31642
- Failed merges:

8 years agoFix wrong help message left in #31368
Johan Lorenzo [Mon, 15 Feb 2016 16:44:06 +0000 (17:44 +0100)]
Fix wrong help message left in #31368

8 years agoClarify contiguous memory array structure of vectors in documentation
Dirk Gadsden [Mon, 15 Feb 2016 01:00:46 +0000 (17:00 -0800)]
Clarify contiguous memory array structure of vectors in documentation

Closes #31554.

Contributes to #29380.

8 years agodoc pages: add the ability to search unknown types
Brandon W Maister [Sat, 13 Feb 2016 20:11:08 +0000 (15:11 -0500)]
doc pages: add the ability to search unknown types

This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.

I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.

8 years agoAdd lint to check that all crates have #![unstable]
Keith Yeung [Sat, 13 Feb 2016 11:44:40 +0000 (06:44 -0500)]
Add lint to check that all crates have #![unstable]

8 years agoSplit PatKind::Enum into PatKind::TupleStruct and PatKind::Path
Vadim Petrochenkov [Mon, 15 Feb 2016 21:40:38 +0000 (00:40 +0300)]
Split PatKind::Enum into PatKind::TupleStruct and PatKind::Path

8 years agoAuto merge of #31530 - dirk:dirk/restrict-matching-of-cfg-opts, r=alexcrichton
bors [Mon, 15 Feb 2016 19:30:37 +0000 (19:30 +0000)]
Auto merge of #31530 - dirk:dirk/restrict-matching-of-cfg-opts, r=alexcrichton

Fixes #31497.

8 years agoAuto merge of #31663 - nodakai:cleanup-uint_module, r=alexcrichton
bors [Mon, 15 Feb 2016 17:33:09 +0000 (17:33 +0000)]
Auto merge of #31663 - nodakai:cleanup-uint_module, r=alexcrichton

8 years agouse stalled_on in all obligation types
Ariel Ben-Yehuda [Mon, 15 Feb 2016 17:08:53 +0000 (19:08 +0200)]
use stalled_on in all obligation types

this improves typeck performance by 5% (LLVM times are still huge).

Basically fixes #25916 (still O(n^2), but the example takes <1s to
compile).

8 years agoGlobal error explanations improvements
ggomez [Mon, 15 Feb 2016 16:57:21 +0000 (17:57 +0100)]
Global error explanations improvements

8 years agoFix wrong help message left in #31368
Johan Lorenzo [Mon, 15 Feb 2016 16:44:06 +0000 (17:44 +0100)]
Fix wrong help message left in #31368

8 years agoAdd LLVM FunctionPass regression test using run-make.
Corey Farwell [Mon, 15 Feb 2016 03:57:43 +0000 (22:57 -0500)]
Add LLVM FunctionPass regression test using run-make.

Part of https://github.com/rust-lang/rust/issues/31185.

Similar to https://github.com/rust-lang/rust/pull/31391.

8 years agoAuto merge of #31656 - jonas-schievink:mirdump, r=nrc
bors [Mon, 15 Feb 2016 14:57:44 +0000 (14:57 +0000)]
Auto merge of #31656 - jonas-schievink:mirdump, r=nrc

This allows obtaining a textual MIR dump for individual items or all items in the crate.

I haven't added any tests since ~~I'm too lazy~~ this is an unstable debugging option, but I'll add one if required.

MIR for a single function can now be dumped using `rustc -Zunstable-options --unpretty mir=my_function` and no longer requires the use of in-source `#[rustc_mir]` attributes.

Blocks rust-lang/rust-playpen#154 (if MIR dump support from the playpen is even wanted).

Example output:
```rust
fn main() {
    let x = Some(0);
    x.unwrap_or_else(|| 1);
}
```

```
MIR for expr || 1 (id=16)
fn(arg0: [closure@test.rs:3:22: 3:26]) -> i32 {
    let mut tmp0: ();

    bb0: {
        return = const 1;
        goto -> bb1;
    }

    bb1: {
        return;
    }
}
MIR for fn main::main (id=4)
fn() -> () {
    let var0: core::option::Option<i32>; // x
    let mut tmp0: ();
    let mut tmp1: i32;
    let mut tmp2: core::option::Option<i32>;
    let mut tmp3: [closure@test.rs:3:22: 3:26];

    bb0: {
        var0 = core::option::Option::Some(const 0);
        tmp2 = var0;
        tmp3 = [closure@test.rs:3:22: 3:26];
        tmp1 = core::option::Option<T>::unwrap_or_else(tmp2, tmp3) -> bb2;
    }

    bb1: {
        return;
    }

    bb2: {
        drop(tmp1) -> bb3;
    }

    bb3: {
        return = ();
        goto -> bb1;
    }
}
```

8 years agoAuto merge of #31640 - rkruppe:require-py27, r=sanxiyn
bors [Mon, 15 Feb 2016 13:04:00 +0000 (13:04 +0000)]
Auto merge of #31640 - rkruppe:require-py27, r=sanxiyn

In other words, enforce what was documented in #30626 (and also stop blaming it on LLVM, we have at least one Python script of our own).

Also, there is no Python later than 2.7 and there never will be.

8 years agoRefactor windows::fs::FileAttr
Paul Dicker [Mon, 15 Feb 2016 11:43:30 +0000 (12:43 +0100)]
Refactor windows::fs::FileAttr
Because we no longer use `GetFileAttributesExW` FileAttr is never created
directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore.
So we should no longer store FileAttr's attributes in that c struct.

8 years agoAuto merge of #31653 - tomaka:emscripten-abi, r=eddyb
bors [Mon, 15 Feb 2016 11:07:02 +0000 (11:07 +0000)]
Auto merge of #31653 - tomaka:emscripten-abi, r=eddyb

Needs a correct review because I'm not too confident with how this works.
All tests related to the C ABI are now passing.

References:
- https://github.com/kripken/emscripten-fastcomp-clang/blob/dbe68fecd03d6f646bd075963c3cc0e7130e5767/lib/CodeGen/TargetInfo.cpp#L479-L489
- https://github.com/kripken/emscripten-fastcomp-clang/blob/dbe68fecd03d6f646bd075963c3cc0e7130e5767/lib/CodeGen/TargetInfo.cpp#L466-L477

The `classifyArgumentType` function has two different paths depending on `RAA == CGCXXABI::RAA_DirectInMemory`, but I don't really know what's the corresponding option in Rust.

cc @brson @eddyb

8 years agoAuto merge of #31652 - semarie:openbsd-os-raw, r=alexcrichton
bors [Mon, 15 Feb 2016 09:10:52 +0000 (09:10 +0000)]
Auto merge of #31652 - semarie:openbsd-os-raw, r=alexcrichton

remove unused import that cause an error at compile-time.

r? @alexcrichton

8 years agoAuto merge of #31648 - jseyfried:fix_diagnostics, r=nrc
bors [Mon, 15 Feb 2016 07:13:02 +0000 (07:13 +0000)]
Auto merge of #31648 - jseyfried:fix_diagnostics, r=nrc

This PR fixes two unrelated diagnostics bugs in resolve.

First, it reports privacy errors for an import only after the import resolution is determined, fixing #31402.

Second, it expands the per-module map from block ids to anonymous modules so that it also maps module declarations ids to modules, and it uses this map to in `with_scope` to fix #31644.

r? @nrc

8 years agoRename `error-index-generator` to `error_index_generator`
Dirk Gadsden [Mon, 15 Feb 2016 06:26:37 +0000 (22:26 -0800)]
Rename `error-index-generator` to `error_index_generator`

This is because the tool compiler passes the name of the tool
as a command line `--cfg`. The improved session config parser
is stricter and no longer permits invalid meta items (such as
"error-index-generator").

8 years agoAdd lint to check that all crates have #![unstable]
Keith Yeung [Sat, 13 Feb 2016 11:44:40 +0000 (06:44 -0500)]
Add lint to check that all crates have #![unstable]

8 years agoAuto merge of #31566 - jseyfried:fix_regression, r=nrc
bors [Mon, 15 Feb 2016 05:19:29 +0000 (05:19 +0000)]
Auto merge of #31566 - jseyfried:fix_regression, r=nrc

This fixes a regression caused by #31461 allowing extern crates to be glob imported, and it fixes the test that was supposed to catch it.
r? @nrc

8 years agoAuto merge of #31555 - nrc:err-recover, r=pnkfelix
bors [Mon, 15 Feb 2016 03:17:35 +0000 (03:17 +0000)]
Auto merge of #31555 - nrc:err-recover, r=pnkfelix

Recover from missing brackets in the parser

8 years agostd: use LFS open64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:27:18 +0000 (16:27 -0800)]
std: use LFS open64 on Linux

8 years agostd: use LFS readdir64_r on Linux
Josh Stone [Mon, 15 Feb 2016 00:24:02 +0000 (16:24 -0800)]
std: use LFS readdir64_r on Linux

8 years agostd: use LFS lseek64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:15:39 +0000 (16:15 -0800)]
std: use LFS lseek64 on Linux

8 years agostd: use LFS ftruncate64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:09:57 +0000 (16:09 -0800)]
std: use LFS ftruncate64 on Linux

8 years agoClarify contiguous memory array structure of vectors in documentation
Dirk Gadsden [Mon, 15 Feb 2016 01:00:46 +0000 (17:00 -0800)]
Clarify contiguous memory array structure of vectors in documentation

Closes #31554.

Contributes to #29380.

8 years agoStricter matching of `--cfg` options on rustc
Dirk Gadsden [Wed, 10 Feb 2016 06:48:47 +0000 (22:48 -0800)]
Stricter matching of `--cfg` options on rustc

Includes compile-fail test to check that it fails on incomplete
`--cfg` matches.

Fixes #31497.

8 years agoRebasing
Nick Cameron [Mon, 15 Feb 2016 00:14:31 +0000 (13:14 +1300)]
Rebasing

8 years agolibcore/num: Remove unused macro argument.
NODA, Kai [Sun, 14 Feb 2016 23:34:02 +0000 (07:34 +0800)]
libcore/num: Remove unused macro argument.

It is no longer necessary after dd0d495f50e2d8ba501e6b003cb4c1ef52d95ed5

Signed-off-by: NODA, Kai <nodakai@gmail.com>
8 years agoAuto merge of #31661 - steveklabnik:rollup, r=steveklabnik
bors [Sun, 14 Feb 2016 23:18:00 +0000 (23:18 +0000)]
Auto merge of #31661 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #31607, #31649, #31655, #31658
- Failed merges:

8 years agoRollup merge of #31658 - felgru:master, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31658 - felgru:master, r=steveklabnik

In the Rust code above this block of compiler output, the function is called print_sum, so use the same function name in the error message.

8 years agoRollup merge of #31655 - ollie27:patch-4, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31655 - ollie27:patch-4, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #31649 - fbergr:doc, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31649 - fbergr:doc, r=steveklabnik

8 years agoRollup merge of #31607 - steveklabnik:gh31599, r=brson
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31607 - steveklabnik:gh31599, r=brson

Fixes #31599

8 years agoAuto merge of #31460 - alexcrichton:supafast-rustc, r=brson
bors [Sun, 14 Feb 2016 21:24:45 +0000 (21:24 +0000)]
Auto merge of #31460 - alexcrichton:supafast-rustc, r=brson

Looking at some profiles of rustc recently, these seemed like two pretty easy wins we could get in terms of performance on the table.

8 years agoTests
Nick Cameron [Thu, 11 Feb 2016 01:50:19 +0000 (14:50 +1300)]
Tests

8 years agoSome error recovery in the parser
Nick Cameron [Wed, 10 Feb 2016 03:11:27 +0000 (16:11 +1300)]
Some error recovery in the parser

8 years agoAdd some simple error recovery to the parser and fix tests
Nick Cameron [Sun, 31 Jan 2016 19:39:50 +0000 (08:39 +1300)]
Add some simple error recovery to the parser and fix tests

Some tests just add the extra errors, others I fix by doing some simple error recovery. I've tried to avoid doing too much in the hope of doing something more principled later.

In general error messages are getting worse at this stage, but I think in the long run they will get better.