Commit Graph

52188 Commits

Author SHA1 Message Date
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
Ulrik Sverdrup
28c4d12c03 Add test for [u8]'s Ord (and fix the old test for ord)
The old test for Ord used no asserts, and appeared to have a wrong test. (!).
2016-04-05 14:06:20 +02:00
Ulrik Sverdrup
5d56e1daed Specialize equality for [T] and comparison for [u8]
Where T is a type that can be compared for equality bytewise, we can use
memcmp. We can also use memcmp for PartialOrd, Ord for [u8] and by
extension &str.

This is an improvement for example for the comparison [u8] == [u8] that
used to emit a loop that compared the slices byte by byte.

One worry here could be that this introduces function calls to memcmp
in contexts where it should really inline the comparison or even
optimize it out, but llvm takes care of recognizing memcmp specifically.
2016-04-05 14:06:20 +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
Tobias Bucher
0936b5885d Remove strange names created by lack of privacy-conscious name lookup
The fixed issue that allowed this was #12808.
2016-04-05 11:41:48 +02: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
Timon Van Overveldt
6e41885bd8 Fix backtraces on ARM EHABI.
Before this patch, our rust_eh_personality_catch routine would cut
backtracing short at the __rust_try function, due to it not handling
the _US_FORCE_UNWIND bit properly, which is passed by libunwind
implementations on ARM EHABI.

Examples of where the _US_FORCE_UNWIND bit is passed to the PR:
- GCC's libunwind: f1717362de/libgcc/unwind-arm-common.inc (L590)
- LLVM's libunwind: 61278584b5/src/UnwindLevel1-gcc-ext.c (L153)
2016-04-04 21:15:37 -07:00
Guillaume Gomez
ded701bf64 Centralize nightly compiler flags handling 2016-04-05 04:13:30 +02:00
Guillaume Gomez
f34ae3f7ed Add nightly check on rustdoc --extend-css option 2016-04-05 01:39:36 +02:00
Guillaume Gomez
ab835a12da Add --extend-css option to rustdoc 2016-04-05 01:39:35 +02:00
Tom Tromey
a0943d0701 Use DWARF 5 value for DW_LANG_Rust 2016-04-04 17:30:24 -06:00
bors
600dc3552f Auto merge of #32647 - Amanieu:checked_atomic_intrinsics, r=eddyb
Only allow using the atomic intrinsics on integer types

Using these with non-integer types results in LLVM asserts. Atomic operations on non-integer types will require values be transmuted into an integer type of suitable size.

This doesn't affect the standard library since `AtomicBool` and `AtomicPtr` currently use `usize` for atomic operations.

r? @eddyb
2016-04-04 15:37:31 -07:00
Dave Huseby
d69a5982de adds dragonflybsd and freebsd to snapshots.txt 2016-04-04 14:24:47 -07:00
Manish Goregaokar
a447124963 Mention that it's not actually a data race
Conflicts:
	src/doc/book/concurrency.md
2016-04-05 02:49:16 +05:30
James Miller
4815f7e668 Handle integer-extending for C ABI
We need to supply sext/zext attributes to LLVM to ensure that arguments
are extended to the appropriate width in the correct way.

Most platforms extend integers less than 32 bits, though not all.
2016-04-04 22:14:10 +02:00
Masood Malekghassemi
86071aca3d Address nits 2016-04-04 12:41:05 -07:00
bors
8d5e845760 Auto merge of #32582 - nikomatsakis:issue-32326, r=aturon
process cycles as soon as they are detected

We used to wait for the recursion limit, but that might well be too
long!

Fixes #32326
r? @aturon
2016-04-04 11:41:01 -07:00
Alex Crichton
c822546c9e mk: Hardcode the bootstrap key for each release
Starting with the 1.10.0 release we would like to bootstrap all compilers from
the previous stable release. For example the 1.10.0 compiler should bootstrap
from the literal 1.9.0 release artifacts. To do this, however, we need a way to
enable unstable features temporarily in a stable compiler (as the released
compiler is stable), but it turns out we already have a way to do that!

At compile time the configure script selects a `CFG_BOOTSTRAP_KEY` variable
value and then exports it into the makefiles. If the `RUSTC_BOOTSTRAP_KEY`
environment variable is set to this value, then the compiler is allowed to
"cheat" and use unstable features.

This method of choosing the bootstrap key, however, is problematic for the
intention of bootstrapping from the previous release. Each time a 1.9.0 compiler
is created, a new bootstrap key will be selected. That means that the 1.10.0
compiler will only compile from *our* literal release artifacts. Instead
distributions would like to bootstrap from their own compilers, so instead we
simply hardcode the bootstrap key for each release.

This patch uses the same `CFG_FILENAME_EXTRA` value (a hash of the release
string) as the bootstrap key. Consequently all 1.9.0 compilers, no matter where
they are compiled, will have the same bootstrap key. Additionally we won't need
to keep updating this as it'll be based on the release number anyway.

Once the 1.9.0 beta has been created, we can update the 1.10.0 nightly sources
(the `master` branch at that time) to bootstrap from that release using this
hard-coded bootstrap key. We will likely just hardcode into the makefiles what
the previous bootstrap key was and we'll change that whenever the stage0
compiler is updated.
2016-04-04 11:24:44 -07:00
Niko Matsakis
e733b86ae3 add error code to test 2016-04-04 12:31:29 -04:00
Niko Matsakis
6a749c7eb1 fix corner case around top of stack
When deciding on a coinductive match, we were examining the new
obligation and the backtrace, but not the *current* obligation that goes
in between the two.  Refactoring the code to just have the cycle given
as input also made things a lot simpler.
2016-04-04 11:14:44 -04:00
Niko Matsakis
944723b773 process cycles as soon as they are detected
We used to wait for the recursion limit, but that might well be too
long!
2016-04-04 11:14:44 -04:00
Aleksey Kladov
2325cab5fe minor: update old comments
No more lifetimes in function types after
f945190e63
2016-04-04 17:26:38 +03:00
bors
6a3b558506 Auto merge of #32644 - oli-obk:check_all_constants_early, r=nrc
check constants even if they are not used in the current crate

For now this is just a `warn`-by-default lint. I suggest to make it a `deny`-by-default lint in the next release cycle (so no dependencies break), and then in another release cycle move to an error.

cc #19265
cc #3170
2016-04-04 07:07:42 -07:00
Jonas Schievink
1ea98a8b70 Just use Some(()) instead 2016-04-04 15:08:38 +02:00
Jonas Schievink
580c5f92d1 use unwrap_or 2016-04-04 14:10:03 +02:00
Jonas Schievink
99b6247166 Beef up test 2016-04-04 13:53:04 +02:00
Seo Sanghyeon
a09a3acbbd Remove outdated comment 2016-04-04 20:32:42 +09:00
pierzchalski
0fe1359885 whoops 2016-04-04 21:14:15 +10:00
pierzchalski
1e9595e116 Change build_helper to modify suffix of cc
This should help avoid issues when using tools like ccache.
2016-04-04 19:44:38 +10:00
James Miller
e4d4fa3295 Handle operand temps for function calls
This allows temporary destinations for function calls to have their
allocas omitted.
2016-04-04 19:21:27 +12:00
Nick Cameron
a4e2933c6a rustdoc: factor out function for getting inner html of highlighted source 2016-04-04 11:07:41 +12:00
Nick Cameron
8c2a8ae9cc Give better spans for SpanEnd errors 2016-04-04 10:32:37 +12:00
Amanieu d'Antras
8620bbaafd Add compile-fail test 2016-04-03 23:14:48 +01:00
bors
f92ce2e9fe Auto merge of #32676 - durka:patch-18, r=alexcrichton
add missing spaces in #16758 warning

I should probably add a test.
2016-04-03 15:01:47 -07:00
Jonas Schievink
da9c43a723 Autoderef when suggesting to call (self.field)
Fixes #32128
2016-04-03 22:58:44 +02:00