Commit Graph

52106 Commits

Author SHA1 Message Date
Steve Klabnik
862ae9aa75 Rollup merge of #32774 - tbu-:pr_doc_tuple_copy, r=brson
Add `Copy` to the traits that are automatically implemented for tuples
2016-04-06 12:12:09 -07:00
Steve Klabnik
76a58954e0 Rollup merge of #32766 - nikomatsakis:constant-pattern-warning-cycle, r=eddyb
change constant patterns to have a warning cycle

This was the original intention :(

r? @eddyb
2016-04-06 12:12:09 -07:00
Steve Klabnik
3531a1a0da Rollup merge of #32761 - tshepang:assert, r=steveklabnik
avoid "==" in assert! when one of the values is a bool

Is suspect this is something of an idiom
2016-04-06 12:12:09 -07:00
Steve Klabnik
510b380317 Rollup merge of #32744 - GuillaumeGomez:patch-3, r=steveklabnik
Add example doc for ToOwned trait

Fixes #29342.

r? @steveklabnik
2016-04-06 12:12:09 -07:00
Steve Klabnik
ea28533e25 Rollup merge of #32727 - matklad:fix-comment, r=alexcrichton
minor: update old comments

No more lifetimes in function types after f945190e63
2016-04-06 12:12:08 -07:00
Steve Klabnik
028c067a7b Rollup merge of #32724 - sanxiyn:outdated-comment, r=dotdash
Remove outdated comment

The corresponding code was removed in #31824. Also remove code duplication and rename the function.
2016-04-06 12:12:08 -07:00
Steve Klabnik
f7154b39ee Rollup merge of #32691 - frewsxcv:patch-28, r=alexcrichton
Indicate `None` is code-like in doc comment.
2016-04-06 12:12:08 -07:00
Steve Klabnik
fce5901507 Rollup merge of #32679 - tclfs:patch-1, r=steveklabnik
Remove error description of `move`

(1) `x` can be used in main() after the call to spawn(). Because the variables follow normal move semantics, though the keyword `move` is used, and i32 implements `Copy`.
(2) I remove this sentence because the previous sentence gives the referrence to `move closures`, and more description of `move` may be redundant.
2016-04-06 12:12:08 -07:00
Steve Klabnik
9ce61702b3 Rollup merge of #32668 - frewsxcv:hashmap-address-fixme, r=alexcrichton
Address FIXMEs related to short lifetimes in `HashMap`.

None
2016-04-06 12:12:08 -07:00
Steve Klabnik
be862ca5b8 Rollup merge of #32634 - varunvats:docs-fix, r=steveklabnik
Minor doc fixes in "Crates and Modules" and "Lifetimes" chapters

These commits fix a couple of (minor) issues in the _Crates and Modules_ and the _Lifetimes_ chapters of the book.

r? @steveklabnik
2016-04-06 12:12:07 -07:00
Steve Klabnik
2bbdbd267a Rollup merge of #32538 - Manishearth:no-data-race, r=steveklabnik
Mention that it's not actually a data race

The example can't cause a data race since different indices are accesed.

(perhaps we should use an example where i iterates twice?)

r? @steveklabnik
2016-04-06 12:12:07 -07:00
Steve Klabnik
c411897e38 Rollup merge of #31762 - tshepang:in-which-case, r=steveklabnik
doc: there is no case that is shown, so something was likely missing …

…from the change
2016-04-06 12:12:07 -07:00
Tobias Bucher
3e9b859af2 Add Copy to the traits that are automatically implemented for tuples 2016-04-06 20:10:33 +02:00
bors
943ec3bdfc Auto merge of #32767 - Manishearth:breakingbatch, r=eddyb
Batch up all plugin breaking changes

https://github.com/rust-lang/rust/pull/32688 already landed so we should get this into the same nightly.

cc https://github.com/rust-lang/rust/issues/31645
2016-04-06 05:04:15 -07:00
Manish Goregaokar
552af51ffb Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakis
r? @nikomatsakis

Conflicts:
	src/librustc_save_analysis/lib.rs
	src/libsyntax/ast_util.rs
2016-04-06 17:31:16 +05:30
Manish Goregaokar
af7b00b68f Rollup merge of #32682 - petrochenkov:field3, r=Manishearth
The AST part of https://github.com/rust-lang/rust/pull/31937

Unlike HIR, AST still uses `Option` for field names because parser can't know field indexes reliably due to constructions like
```
struct S(#[cfg(false)] u8, u8); // The index of the second field changes from 1 during parsing to 0 after expansion.
```
and I wouldn't like to put the burden of renaming fields on expansion passes and syntax extensions.

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
r? @Manishearth
2016-04-06 17:15:31 +05:30
Eduard Burtescu
e8a8dfb056 rustc: retire hir::map's paths. 2016-04-06 13:51:55 +03:00
Niko Matsakis
b27b3e1278 change constant patterns to have a warning cycle
This was the original intention :(
2016-04-06 05:37:08 -04:00
Vadim Petrochenkov
8fe4290f1c Move span into StructField 2016-04-06 11:19:10 +03:00
Vadim Petrochenkov
7f3744f07f Get rid of ast::StructFieldKind 2016-04-06 10:33:15 +03:00
Eduard Burtescu
20f0f3c1f1 rustc: move some maps from ty to hir. 2016-04-06 09:14:21 +03:00
Eduard Burtescu
ffca6c3e15 rustc: move middle::{def,def_id,pat_util} to hir. 2016-04-06 09:14:21 +03:00
Eduard Burtescu
7bebe80bc2 syntax: dismantle ast_util. 2016-04-06 09:04:15 +03:00
Eduard Burtescu
ef4c7241f8 rustc: dismantle hir::util, mostly moving functions to methods. 2016-04-06 09:01:55 +03:00
Eduard Burtescu
8b0937293b rustc: move rustc_front to rustc::hir. 2016-04-06 09:01:55 +03:00
Tshepang Lekhonkhobe
922e666820 avoid "==" in assert! when one of the values is a bool 2016-04-06 06:24:19 +02:00
bors
772c600d4d Auto merge of #32688 - jseyfried:ast_groundwork_for_1422, r=pnkfelix
[breaking-batch] Add support for `pub(restricted)` syntax in the AST

This PR allows the AST to represent the `pub(restricted)` syntax from RFC 1422 (cc #32409).

More specifically, it makes `ast::Visibility` non-`Copy` and adds two new variants, `Visibility::Crate` for `pub(crate)` and `Visitibility::Restricted { path: P<Path>, id: NodeId }` for `pub(path)`.

plugin-[breaking-change] cc #31645
r? @pnkfelix
2016-04-05 18:58:24 -07:00
bors
241a9d0ddf Auto merge of #32415 - alexcrichton:android-signal, r=alexcrichton
std: Fix linking against `signal` on Android

Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h
2016-04-05 14:19:28 -07:00
bors
57e5d43c77 Auto merge of #32743 - Manishearth:rollup, r=Manishearth
Rollup of 11 pull requests

- Successful merges: #32403, #32596, #32675, #32678, #32685, #32686, #32692, #32710, #32712, #32714, #32715
- Failed merges: #32488
2016-04-05 10:55:38 -07:00
Varun Vats
a7d15ce6a6 Doc fix: list all module files Rust looks for.
1. In the English/Japanese phrases example in the "Multiple File
Crates" section of the "Crates and Modules" chapter, there are a total
of 8 module files that Rust looks for, while only four were
listed. This commit lists all 8 explicitly.
2. Title case fix.
2016-04-05 12:09:55 -05:00
Varun Vats
d841c15704 Doc fix: function takes argument by reference. 2016-04-05 12:09:55 -05:00
Tshepang Lekhonkhobe
8f463ea98e doc: make env::consts summaries less confusing 2016-04-05 17:55:14 +02:00
bors
953c3b5f50 Auto merge of #32742 - eddyb:cast-fns, r=dotdash
trans: don't declare symbols that were already imported.

Fixes #32740 by checking for a declaration before attempting a new one.
Before, `LLVMGetOrInsertFunction` was called for a existing import, but with a different type.
The returned value was a cast function pointer instead of a declaration, and we gave this
value to `llvm::SetFunctionCallConv` & friends , which triggered an LLVM assertion.
2016-04-05 05:48:47 -07:00
Guillaume Gomez
6fee337b10 Add example doc for ToOwned trait 2016-04-05 14:11:08 +02:00
Manish Goregaokar
e8ab71fa00 Rollup merge of #32715 - nrc:rustdoc-highlight, r=cmr
rustdoc: factor out function for getting inner html of highlighted source
2016-04-05 16:43:22 +05:30
Manish Goregaokar
7ed71c20e3 Rollup merge of #32714 - nrc:json-err-end-span, r=sfackler
JSON errors: give better spans for SpanEnd errors
2016-04-05 16:43:22 +05:30
Manish Goregaokar
084d9fa943 Rollup merge of #32712 - jonas-schievink:autoderef-fields-for-fn-ty, r=nagisa
Autoderef when suggesting to call `(self.field)`

Fixes #32128
2016-04-05 16:43:22 +05:30
Manish Goregaokar
7d63422bb2 Rollup merge of #32710 - jonas-schievink:consider-last-semi, r=nagisa
Fix "consider removing this semicolon" help

Check last statement in a block, not the first.

Example of current weirdness: http://is.gd/w80J9h

The help was only rarely emitted, and if so, often incorrectly (see above playpen). It was basically only useful with single-statement functions.
2016-04-05 16:43:22 +05:30
Manish Goregaokar
b6c1f1cf3f Rollup merge of #32692 - sfackler:time-inline, r=alexcrichton
Inline Duration constructors and accessors

These are all super small functions

r? @alexcrichton
2016-04-05 16:43:21 +05:30
Manish Goregaokar
37cadec16e Rollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichton
Prefix jemalloc on DragonFly to prevent segfaults.

Similar to commits ed015456a1 (iOS)
and e3b414d861 (Android)
2016-04-05 16:43:21 +05:30
Manish Goregaokar
22c229d88c Rollup merge of #32685 - dhuseby:add_freebsd_i686_snapshot_4d3eebf, r=alexcrichton
adding freebsd i686 snapshot 4d3eebf

@alexcrichton will you please upload the following file when landing this patch:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-freebsd-i386-4e2af0b34eb335e173aebff543be693724a956c2.tar.bz2
2016-04-05 16:43:21 +05:30
Manish Goregaokar
bb561dac99 Rollup merge of #32678 - mitaa:rdoc-stripped, r=alexcrichton
rustdoc: make rustdoc less pass-aware

Instead of hardcoding knowledge about the strip-private pass into the
rendering process we represent (some) stripped items as `ItemEnum::StrippedItem`.

Rustdoc will, for example, generate redirect pages for public items
contained in private modules which have been re-exported to somewhere
externally reachable - this will now not only work for the `strip-private`
pass, but for other passes as well, such as the `strip-hidden` pass.

r? @alexcrichton
2016-04-05 16:43:21 +05:30
Manish Goregaokar
3c4d5f9228 Rollup merge of #32675 - dhuseby:snapshots-01-04-16, r=alexcrichton
adds dragonflybsd to snapshots.txt

@alexcrichton please upload the following snapshots when landing this patch:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-dragonfly-x86_64-765bb5820ad406e966ec0ac51c8070b656459b02.tar.bz2

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-freebsd-x86_64-395adf223f3f25514c9dffecb524f493c42a0e5d.tar.bz2
2016-04-05 16:43:21 +05:30
Manish Goregaokar
f6019760f9 Rollup merge of #32596 - soltanmm:lazy, r=nikomatsakis
Plumb obligations through librustc/infer

Like #32542, but more like #31867.

TODO before merge: make an issue for the propagation of obligations through... uh, everywhere... then replace the `#????`s with the actual issue number.

cc @jroesch
r? @nikomatsakis
2016-04-05 16:43:21 +05:30
Manish Goregaokar
bdd264a0bb Rollup merge of #32403 - vlastachu:super_in_path, r=jseyfried
Fix issue: Global paths in `use` directives can begin with `super` or `self` #32225

This PR fixes #32225 by warning on `use ::super::...` and `use ::self::...` on `resolve`.

Current changes is the most minimal and ad-hoc.
2016-04-05 16:43:20 +05:30
bors
7ded11a58c Auto merge of #29463 - jseyfried:master, r=nikomatsakis
Remove implicit binder from `FnSpace` in `VecPerParamSpace` (fixes #20526)

This removes the implicit binder from `FnSpace` in `VecPerParamSpace` so that `Binder<T>` is the only region binder (as described in issue #20526), and refactors away `enter_region_binder` and `exit_region_binder` from `TypeFolder`.
2016-04-05 03:26:58 -07:00
Eduard Burtescu
e17c48bb24 trans: don't declare symbols that were already imported. 2016-04-05 13:01:00 +03:00
vlastachu
6c73134fc7 Fixes bug which accepting using super in use statemet.
Issue: #32225
2016-04-05 11:57:56 +03:00
Alex Crichton
9c462b84c8 std: Fix linking against signal on Android
Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h
2016-04-04 21:54:59 -07:00
bors
7fd331e166 Auto merge of #32328 - jseyfried:coherence, r=nikomatsakis
resolve: Improve import failure detection and lay groundwork for RFC 1422

This PR improves import failure detection and lays some groundwork for RFC 1422.
More specifically, it
 - Avoids recomputing the resolution of an import directive's module path.
 - Refactors code in `resolve_imports` that does not scale to the arbitrarily many levels of visibility that will be required by RFC 1422.
  - Replaces `ModuleS`'s fields `public_glob_count`, `private_glob_count`, and `resolved_globs` with a list of glob import directives `globs`.
  - Replaces `NameResolution`'s fields `pub_outstanding_references` and `outstanding_references` with a field `single_imports` of a newly defined type `SingleImports`.
 - Improves import failure detection by detecting cycles that include single imports (currently, only cycles of globs are detected). This fixes #32119.

r? @nikomatsakis
2016-04-04 21:50:05 -07:00