Commit Graph

67215 Commits

Author SHA1 Message Date
scalexm
d58b40e16b Use an helper struct 2017-08-14 15:07:22 +02:00
scalexm
e1f1798ba9 Handle unwinding, use a loop for arrays 2017-08-14 15:07:21 +02:00
scalexm
df7be435d3 Optimize clone shim for Copy types 2017-08-14 15:07:21 +02:00
scalexm
4e4e55aa77 Rename BuiltinShim -> CloneShim 2017-08-14 15:07:21 +02:00
scalexm
91aa99607f Do not store ty 2017-08-14 15:07:21 +02:00
scalexm
91e99a3215 Add a test 2017-08-14 15:07:21 +02:00
scalexm
f55dafee7e Remove dummy lang items 2017-08-14 15:07:21 +02:00
scalexm
0c3ac648f8 Make Clone a lang item and generate builtin impls.
Fixes #28229.
Fixes #24000.
2017-08-14 15:07:21 +02:00
Michael Woerister
3b92b97bfb Fix unused variable warnings in builds disabled debug-assertions. 2017-08-14 14:56:35 +02:00
John Kåre Alsaker
b045c201b2 Use a DepNode for the generator signature 2017-08-14 14:11:35 +02:00
bors
d49b730157 Auto merge of #43857 - michaelwoerister:fix-impl-trait-closure-vis, r=eddyb
Mark closures return via impl-trait as reachable.

This should fix some of the open `impl trait` issues, like #40839, #43135, and #35870.

r? @eddyb
2017-08-14 11:28:12 +00:00
Ariel Ben-Yehuda
e3495b2cfa emit StorageLive for box temporaries
We started emitting StorageDead, so we better emit the corrseponding
StorageLive to avoid problems.
2017-08-14 14:10:05 +03:00
Ariel Ben-Yehuda
a3a06b1677 remove the "defaulted unit" type bit during writeback
The defaulted unit bit is only relevant for the surrounding inference
context, and can cause trouble, including spurious lints and ICEs,
outside of it.

Fixes #43853.
2017-08-14 13:25:16 +03:00
kennytm
60377e48f0
save-analysis: Remove path span extraction methods from SpanUtils
Use the `span` field in PathSegment and TyParam instead.

Fix #43796. Close #41478.
2017-08-14 18:14:49 +08:00
Michael Woerister
f2df18579b Mark closures return via impl-trait as reachable. 2017-08-14 12:04:52 +02:00
Michael Woerister
6fd7d8586c Fix some merge fallout. 2017-08-14 11:21:34 +02:00
bors
b1ff235490 Auto merge of #43856 - sfackler:no-inline-debug, r=alexcrichton
Don't inline debug methods

The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843
2017-08-14 07:50:36 +00:00
John Kåre Alsaker
eff2884e5f Make generator interior types deterministic 2017-08-14 07:23:35 +02:00
bors
bae4fafdfb Auto merge of #43844 - arielb1:literally-nonstandard, r=eddyb
ast_validation: forbid "nonstandard" literal patterns

Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.

beta-nominating because regression.
r? @eddyb
2017-08-14 05:05:06 +00:00
Alex Crichton
742ca0caf2 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-13 21:07:03 -07:00
bors
e324594844 Auto merge of #43842 - bjorn3:no_llvm_cleanup, r=alexcrichton
Cleanup for "Support compiling rustc without LLVM (try 2)"

This includes a small patch to allow running tests without llvm. Also check if you are not trying to compile a dylib.

cc #42932
r? @alexcrichton
2017-08-14 02:11:18 +00:00
Steven Fackler
81f481d3c6 Don't inline debug methods
The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843
2017-08-13 17:06:17 -07:00
bors
f3cf206201 Auto merge of #43836 - taleks:issue-39827, r=arielb1
Fix for issue #39827

*Cause of the issue*

While preparing for `trans_intrinsic_call()` invoke arguments are processed with `trans_argument()` method which excludes zero-sized types from argument list (to be more correct - all arguments for which `ArgKind` is `Ignore` are filtered out). As result `volatile_store()` intrinsic gets one argument instead of expected address and value.

*How it is fixed*

Modification of the `trans_argument()` method may cause side effects, therefore change was implemented in `volatile_store()` intrinsic building code itself. Now it checks function signature and if it was specialised with zero-sized type, then emits `C_nil()` instead of accessing non-existing second argument.
2017-08-13 23:33:18 +00:00
Corey Farwell
10bd80d79b Indicate thread names get passed to the OS. 2017-08-13 16:23:13 -04:00
bors
ab40a7cb0e Auto merge of #43815 - alexcrichton:optimize-alloc, r=sfackler
Optimize allocation paths in RawVec

Since the `Alloc` trait was introduced (https://github.com/rust-lang/rust/pull/42313) and it was integrated everywhere (https://github.com/rust-lang/rust/pull/42727) there's been some slowdowns and regressions that have slipped through. The intention of this PR is to try to tackle at least some of them, but they've been very difficult to quantify up to this point so it probably doesn't solve everything.

This PR primarily targets the `RawVec` type, specifically the `double` function. The codegen for this function is now much closer to what it was before #42313 landed as many runtime checks have been elided.
2017-08-13 19:28:57 +00:00
Corey Farwell
150713ce9f Rewrite docs for stack size/thread names for spawned threads.
* Moves docs about stack size and thread naming from `Builder` to the
  `std::thread` module
* Adds more links to the new module-level documentation
* Mentions the 2 MiB stack size default, but indicate it's subject to
  change

Fixes https://github.com/rust-lang/rust/issues/43805.
2017-08-13 13:20:00 -04:00
bjorn3
005bc2c3a5 Fix error 2017-08-13 18:51:07 +02:00
Ariel Ben-Yehuda
a2adb7db68 ast_validation: forbid "nonstandard" literal patterns
Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.
2017-08-13 18:35:44 +03:00
Corey Farwell
5d036cc8a6 Remove my mailmap entry. 2017-08-13 11:29:28 -04:00
Alex Crichton
8b2bdc56d0 rustc: Fix unknown_lints next to an unknown lint
The lint refactoring in #43522 didn't account for `#[allow(unknown_lints)]`
happening at the same node as an unknown lint itself, so this commit updates the
handling to ensure that the local set of lint configuration being built is
queried before looking at the chain of lint levels.

Closes #43809
2017-08-13 08:09:46 -07:00
bjorn3
61ab991405 Update driver.rs 2017-08-13 16:50:17 +02:00
bjorn3
1c28cf5b68 Change run-make ignore message 2017-08-13 16:49:09 +02:00
bjorn3
bf0eb6a22d Change a #[cfg()] to a cfg!() 2017-08-13 16:47:47 +02:00
bjorn3
6135b2dff5
Fix tidy errors 2017-08-13 15:56:35 +02:00
bjorn3
0c97bbf424
Remove some more cfg's 2017-08-13 12:30:54 +02:00
bors
a80a873209 Auto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 8 pull requests

- Successful merges: #43782, #43803, #43814, #43819, #43821, #43822, #43824, #43833
- Failed merges:
2017-08-13 10:22:45 +00:00
Alexey Tarasov
faf6b84304 Addresses comments in PR #43836
- removes warnings introduced in changeset 0cd3587
- makes documentation more neat and grammatically correct
2017-08-13 19:28:04 +10:00
Ruud van Asseldonk
e63d979e22 Docs: restore link text after renaming anchor
The text does not need the hyphen, but the anchor name does.
2017-08-13 11:20:52 +02:00
Ruud van Asseldonk
01000fb5c6 Replace space in Markdown link label
With the space, the tidy check does not recognize it as
a link label. See also the comment above in line_is_url()
in src/tools/tidy/src/style.rs.
2017-08-13 11:20:52 +02:00
Ruud van Asseldonk
f51e64f7e9 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. It
seems that 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.
2017-08-13 11:20:52 +02:00
Guillaume Gomez
a7ead41aec Rollup merge of #43833 - dtolnay:connect-timeout, r=sfackler
Fix TcpStream::connect_timeout tracking issue number

Before: https://github.com/rust-lang/rust/pull/43709
After: https://github.com/rust-lang/rust/issues/43079

r? @sfackler
2017-08-13 11:03:15 +02:00
Guillaume Gomez
09ac9fd272 Rollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov
Fix `-Z hir-stats` always panics.

Fix #43232.
2017-08-13 11:03:14 +02:00
Guillaume Gomez
31916ac398 Rollup merge of #43822 - topecongiro:missing-span-let, r=petrochenkov
Include 'let' keyword to the span for ast::Local

Currently the span for `ast::Local` does not the include the `let` keyword. This PR fixes it.
2017-08-13 11:03:13 +02:00
Guillaume Gomez
b1a742794e Rollup merge of #43821 - NilSet:redox-dns, r=alexcrichton
Handle DNS label compression in more places in Redox name resolution
2017-08-13 11:03:12 +02:00
Guillaume Gomez
a91e8a2053 Rollup merge of #43819 - frewsxcv:frewsxcv-include, r=QuietMisdreavus
Improve doc examples for `include*` macros.
2017-08-13 11:03:11 +02:00
Guillaume Gomez
bc6659a8fe Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkov
Fix some typos

Follow up of #43794

If refined my script a little bit and found some more.
2017-08-13 11:03:11 +02:00
Guillaume Gomez
9191fe1ef4 Rollup merge of #43803 - GuillaumeGomez:missing-links-doc, r=frewsxcv
Missing links doc

r? @rust-lang/docs
2017-08-13 11:03:10 +02:00
Guillaume Gomez
7ebd81377d Rollup merge of #43782 - nrc:include, r=GuillaumeGomez
Fix include! in doc tests

By making the path relative to the current file.

Fixes #43153

[breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.
2017-08-13 11:03:09 +02:00
bors
d4fbc7a4e7 Auto merge of #43813 - pengowen123:unused_result, r=estebank
Fix unused_result lint triggering when a function returns `()`, `!` or an empty enum

Also added a test to prevent this from happening again.

Fixes #43806
2017-08-13 07:50:36 +00:00
bors
adbce60d6f Auto merge of #43630 - Mark-Simulacrum:rustbuild-cleanups, r=alexcrichton
Rustbuild cleanups/fixes and improvements

Each commit is a standalone change, and can/should be reviewed separately.

This adds two new functionalities:

 - `--target` and `--host` can be passed without changing config.toml, and we'll respect the users' wishes, instead of requiring that all possible targets are passed.
   - Note that this means that `./x.py clean` won't be quite as wide-spread as before, since it limits itself to the configured hosts, not all hosts. This could be considered a feature as well.
 - `ignore-git` field in `config.toml` which tells Rustbuild to not attempt to load git hashes from `.git`.

This is a precursor to eventual further simplification of the configuration system, but I want to get this merged first so that later work can be made in individual PRs.

r? @alexcrichton
2017-08-13 05:24:49 +00:00