Commit Graph

67295 Commits

Author SHA1 Message Date
bors
a12e4f8098 Auto merge of #43532 - petrochenkov:pgargs, r=nikomatsakis
Desugar parenthesized generic arguments in HIR

Fixes ICE in https://github.com/rust-lang/rust/issues/43431 and maybe some other similar issues.

r? @eddyb
2017-08-24 03:48:25 +00:00
bors
560b6ca6c0 Auto merge of #42565 - murarth:rc-from-slice, r=aturon
Implement From<&[T]> and others for Arc/Rc (RFC 1845)

* Implements `From<`{`&[T]`, `&str`, `String`, `Box<T> where T: ?Sized`, `Vec<T>`}`>` for `Arc`/`Rc`
* Removes `rustc_private`-marked methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from`

Tracking issue: #40475
2017-08-23 23:20:32 +00:00
Niko Matsakis
373e909d07 add a comment 2017-08-23 18:56:19 -04:00
Andy Russell
91bfe3f55b
capture adb shell stdout 2017-08-23 17:32:09 -04:00
Matthew Hammer
43335aec22 -Z profile-query-and-key, separate from -Z profile-query; query key is string option 2017-08-23 15:21:39 -06:00
gaurikholkar
2cd13189ce build fixes 2017-08-24 02:34:05 +05:30
gaurikholkar
cb563a93dc adding macro, cleaning up code 2017-08-24 01:29:13 +05:30
Matthew Hammer
4251032706 -Z profile-queries includes dep_graph.with_task uses in output 2017-08-23 09:26:48 -06:00
Matthew Hammer
3c24fea882 -Z profile-queries: remove panic when channel is unset 2017-08-23 09:26:48 -06:00
Matthew Hammer
28cb03d4e1 profiling with -Z profile-queries recognizes -Z time-passes 2017-08-23 09:26:48 -06:00
Matthew Hammer
d7ec3e1a7d inc comp: -Z profile-queries support; see also https://github.com/rust-lang-nursery/rust-forge/blob/master/profile-queries.md 2017-08-23 09:26:48 -06:00
gaurikholkar
b569094d94 minor fix 2017-08-23 19:43:05 +05:30
bors
2bb8fca182 Auto merge of #44058 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests

- Successful merges: #43631, #43977, #43983, #44016, #44039, #44043, #44047, #44054
- Failed merges:
2017-08-23 13:46:14 +00:00
gaurikholkar
90ab9d9a6d code review fixes 2017-08-23 18:43:26 +05:30
Alexey Tarasov
e13090e8b2 Fixes issue #43205: ICE in Rvalue::Len evaluation.
- fixes evaluation of array length for zero-sized type referenced by
  rvalue operand.
- adds test to verify fix.

Cause of the issue.

Zero-sized aggregates are handled as operands, not lvalues. Therefore while
visiting Assign statement by LocalAnalyser, mark_as_lvalue() is not called for
related Local. This behaviour is controlled by rvalue_creates_operand() method.
As result it causes error later, when rvalue operand is evaluated in
trans_rvalue_operand() while handling Rvalue::Len case. Array length evaluation
invokes trans_lvalue() which expects referenced Local to be value, not operand.

How it is fixed.

In certain cases result of Rvalue::Len can be evaluated without calling
trans_lvalue(). Method evaluate_array_len() is introduced to handle length
evaluation for zero-sized types referenced by Locals.
2017-08-23 23:10:03 +10:00
Seiichi Uchida
601e3dac6c Add reset_err_count() to errors::Handler
The motivation here is to allow rustfmt to recover from parse errors
after failing to parse macros.
2017-08-23 21:56:09 +09:00
Corey Farwell
96efcdf065 Rollup merge of #44054 - frewsxcv:frewsxcv-libstd-thread-unwrap-or-else, r=sfackler
Thread spawning: don't run `min_stack` if the user has specified stack size.

None
2017-08-23 08:44:30 -04:00
Corey Farwell
e9853c4758 Rollup merge of #44047 - cuviper:union-basic-endian, r=petrochenkov
Fix little-endian assumptions in run-pass/union/union-basic

None
2017-08-23 08:44:29 -04:00
Corey Farwell
86f0f44762 Rollup merge of #44043 - mattico:patch-1, r=alexcrichton
Clarify windows build instructions in README

The old wording made me think you were supposed to do `python x.py --build=msvc`, which is not the case. Specify that you need to use the target triple.
2017-08-23 08:44:28 -04:00
Corey Farwell
4d83634faf Rollup merge of #44039 - remexre:master, r=steveklabnik
Mention null_mut on the pointer primitive docs.

Also adds a few mentions that both `*const` and `*mut` support functions, when only `*const` was mentioned before.
2017-08-23 08:44:27 -04:00
Corey Farwell
99ab3193da Rollup merge of #44016 - steffengy:master, r=alexcrichton
libproc_macro docs: fix brace and bracket mixup

The documentation indicates that brace is `[`.
Brace is mapped token::Brace which (expectedly) is `{`.
So the documentation is simply confusing brace and bracket there.

Even though it's just a very small issue, it can lead to quite some confusion.
2017-08-23 08:44:26 -04:00
Corey Farwell
dd58d4e45e Rollup merge of #43983 - ids1024:redox-path-prefix, r=alexcrichton
Redox: correct is_absolute() and has_root()

This is awkward, but representing schemes properly in `Components` is not easily possible without breaking backwards compatibility, as discussed earlier in https://github.com/rust-lang/rust/pull/37702.

But these methods can be corrected anyway.
2017-08-23 08:44:25 -04:00
Corey Farwell
4902e6714f Rollup merge of #43977 - GuillaumeGomez:remove-outline, r=QuietMisdreavus
Remove outline when details have focus

r? @rust-lang/docs

(the green outline annoyed me a bit)
2017-08-23 08:44:24 -04:00
Corey Farwell
1182e52959 Rollup merge of #43631 - ruuda:update-docs, r=QuietMisdreavus
Point "deref coercions" links to new book

Currently the link on doc.rust-lang.org is semi-broken; it links to a page that links to the exact page in the first edition in the book, or to the index of the second edition of the book. If the second editions
is the recommended one now, we should point the links at that one. (In the mean time, the links have been updated to point directly to the first edition of the book, but that hasn't made it onto
the stable channel yet.) By the time this commit makes it onto the stable channel, the second edition of the book should be complete enough. At least the part about deref coercions is.

r? @steveklabnik
2017-08-23 08:44:23 -04:00
bors
a3f0ee9a7b Auto merge of #40113 - smaeul:native-musl, r=alexcrichton
Support dynamically-linked and/or native musl targets

These changes allow native compilation on musl-based distributions and the use of dynamic libraries on linux-musl targets. This is intended to remove limitations based on past assumptions about musl targets, while maintaining existing behavior by default.

A minor related bugfix is included.
2017-08-23 08:43:52 +00:00
bors
ca898411c3 Auto merge of #43948 - jseyfried:generic_arguments_in_paths, r=petrochenkov
Ensure that generic arguments don't end up in attribute paths.

Fixes #43424.
r? @petrochenkov or @nrc
2017-08-23 06:06:21 +00:00
Zack M. Davis
35c449419c fn_must_use soft feature-gate warning on methods too, not only functions
This continues to be in the matter of #43302.
2017-08-22 20:39:56 -07:00
Zack M. Davis
8492ad2479 "soft" (warn instead of error) feature-gate for #[must_use] on functions
Before `#[must_use]` for functions was implemented, a `#[must_use]` attribute
on a function was a no-op. To avoid a breaking change in this behavior, we add
an option for "this-and-such feature is experimental" feature-gate messages to
be a mere warning rather than a compilation-halting failure (so old code that
used to have a useless no-op `#[must_use]` attribute now warns rather than
breaking). When we're on stable, we add a help note to clarify that the feature
isn't "on."

This is in support of #43302.
2017-08-22 20:37:14 -07:00
bors
528307ab1c Auto merge of #43830 - alexcrichton:path-display-regression, r=aturon
std: Respect formatting flags for str-like OsStr

Historically many `Display` and `Debug` implementations for `OsStr`-like
abstractions have gone through `String::from_utf8_lossy`, but this was updated
in #42613 to use an internal `Utf8Lossy` abstraction instead. This had the
unfortunate side effect of causing a regression (#43765) in code which relied on
these `fmt` trait implementations respecting the various formatting flags
specified.

This commit opportunistically adds back interpretation of formatting trait flags
in the "common case" where where `OsStr`-like "thing" is all valid utf-8 and can
delegate to the formatting implementation for `str`. This doesn't entirely solve
the regression as non-utf8 paths will format differently than they did before
still (in that they will not respect formatting flags), but this should solve
the regression for all "real world" use cases of paths and such. The door's also
still open for handling these flags in the future!

Closes #43765
2017-08-23 03:24:13 +00:00
Corey Farwell
1d5ee636d7 Thread spawning: don't run min_stack if the user has specified stack size. 2017-08-22 23:05:14 -04:00
Alex Crichton
4d7dfc1407 appveyor: Use InnoSetup from our mirror
Chocolatey has been pretty flaky, so let's not rely on it.

Closes #43985
2017-08-22 19:42:28 -07:00
Zack M. Davis
7b6e9b4b84 correct comment re feature-checking tooling
The featureck.py that this comment referred to was removed in 9dd3c54a (March
2016).
2017-08-22 17:34:18 -07:00
Zack M. Davis
0981211c62 hard feature-gate for #[must_use] on functions
We'll actually want a new "soft" warning-only gate to maintain
backwards-compatibility, but it's cleaner to start out with the established,
well-understood gate before implementing the alternative warn-only behavior in
a later commit.

This is in the matter of #43302.
2017-08-22 17:30:39 -07:00
Eduard-Mihai Burtescu
b9c69ec3c3 Speed up APFloat division by using short division for small divisors. 2017-08-23 02:57:34 +03:00
Jeffrey Seyfried
7e191685e3 Fix fallout in tests. 2017-08-22 15:50:21 -07:00
Jeffrey Seyfried
d54a6d9413 Ensure that generic arguments don't end up in attribute paths. 2017-08-22 15:50:19 -07:00
bors
1682f9d099 Auto merge of #44032 - pnkfelix:mir-borrowck-fix-orisnotand, r=eddyb
Fix logic error in test guarding prototype MIR borrowck code.

Fix logic error in test guarding prototype MIR borrowck code.

tl;dr: 🤦

(This crept in during the shift from a transform to a query (#44009); I didn't notice because my muscle memory was still always passing `-Z mir-borrowck`, while my test cases *also* had the `#[rustc_mir_borrowck]` attribute attached to them.)
2017-08-22 22:41:29 +00:00
Samuel Holland
e6cd941371 Update ignored tests for dynamic musl
Now that musl supports dynamic libraries (although not by default)
enable the tests that now pass. Additional currently-ignored tests
will pass if rustc is built with crt_static=false in config.toml.
2017-08-22 16:24:29 -05:00
Samuel Holland
565a863bc2 Support dynamic linking for musl-based targets
Note that this commit does not affect mips-musl targets, as they do not
inherit from linux_musl_base.
2017-08-22 16:24:29 -05:00
Samuel Holland
c9645678e8 Update libunwind dependencies for musl
Use libgcc_s when linking dynamically. Convert the static libunwind to
static-nobundle, as libunwind.a is copied from musl_root and available
in the library search path.
2017-08-22 16:24:29 -05:00
Samuel Holland
bab6911f8a Tell the linker when we want to link a static executable
If the C runtime is linked statically, explicitly tell the linker that
the executable should be static.
2017-08-22 16:24:29 -05:00
Samuel Holland
054f310868 Disable PIE when linking statically
Static PIE support, while supported on musl, requires a patch to GCC.
Until/unless it is merged, adding '-pie' to the linker command line will
override '-static' and create a binary that requires a dynamic
interpreter (ld.so).
2017-08-22 16:24:29 -05:00
Samuel Holland
12ceed013c Introduce target feature crt_static_allows_dylibs
Most UNIX-like platforms do not allow shared libraries to statically
link their own libc, as libc expects to have consistent process-global
state. On those platforms, when we do not have a shared libc available,
we must not attempt to link dylibs or cdylibs. On Windows, however, it
is expected to statically link the CRT into dynamic libraries.

This feature is only relevant for targets that support both fully-static
and fully-dynamic linkage, such as musl on Linux.
2017-08-22 16:24:29 -05:00
Samuel Holland
beb8abe9a5 Introduce temporary target feature crt_static_respected
This feature allows targets to opt in to full support of the crt-static
feature. Currently, crt-static is allowed on all targets, even those
that really can't or really shouldn't support it. This works because it
is very loose in the specification of its effects. Changing the behavior
of crt-static to be more strict in how it chooses libraries and links
executables would likely cause compilation to fail on these platforms.

To avoid breaking existing uses of crt-static, whitelist targets that
support the new, stricter behavior. For all other targets, this changes
crt-static from being "mostly a no-op" to "explicitly a no-op".
2017-08-22 16:24:29 -05:00
Samuel Holland
3cb987862f Factor out a helper for the getting C runtime linkage
This commit makes no functional changes.
2017-08-22 16:24:29 -05:00
Samuel Holland
52832439ad Inline crt-static choice for pc-windows-msvc
This avoids the possibility of a duplicate or conflicting crt-static
command line option sent to rustc.
2017-08-22 16:24:29 -05:00
Samuel Holland
4b09dc6e39 Introduce crt_static target option in config.toml
This controls the value of the crt-static feature used when building the
standard library for a target, as well as the compiler itself when that
target is the host.
2017-08-22 16:24:29 -05:00
Samuel Holland
0c7a0e9851 Copy musl startup objects before building std
They are required for linking it, even though it is a library, because
crtn.o in post_link_objects, as hardcoded in src/librustc_back/target/
linux_musl_base.rs, is added to the linker command line for both
executables and libraries.
2017-08-22 16:24:29 -05:00
Samuel Holland
8606782bc1 Infer a default musl_root for native builds 2017-08-22 16:24:29 -05:00
Samuel Holland
1757a8701d Improve explanation of musl_root 2017-08-22 16:24:29 -05:00