]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #53363 - llogiq:num-individual-nonzero-docs, r=steveklabnik
kennytm [Tue, 21 Aug 2018 03:08:28 +0000 (11:08 +0800)]
Rollup merge of #53363 - llogiq:num-individual-nonzero-docs, r=steveklabnik

add individual docs to `core::num::NonZero*`

5 years agoRollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister
kennytm [Tue, 21 Aug 2018 03:07:45 +0000 (11:07 +0800)]
Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister

syntax: Optimize some literal parsing

Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).

5 years agoRollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
kennytm [Mon, 20 Aug 2018 17:20:25 +0000 (01:20 +0800)]
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor

Fix typos found by codespell.

5 years agoRollup merge of #53492 - danc86:lld-riscv, r=alexcrichton
kennytm [Mon, 20 Aug 2018 17:20:24 +0000 (01:20 +0800)]
Rollup merge of #53492 - danc86:lld-riscv, r=alexcrichton

update lld submodule to include RISCV patch

This pulls in one new commit, to add support for linking static RISCV
binaries, suitable for the new riscv32imac-unknown-none-elf target.
See: https://github.com/rust-lang/lld/pull/1

5 years agoRollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkor
kennytm [Mon, 20 Aug 2018 17:20:21 +0000 (01:20 +0800)]
Rollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkor

Remove LinkMeta struct

Fixes #53291

5 years agoRollup merge of #53452 - tromey:lldb-manifest-fix, r=alexcrichton
kennytm [Mon, 20 Aug 2018 17:20:19 +0000 (01:20 +0800)]
Rollup merge of #53452 - tromey:lldb-manifest-fix, r=alexcrichton

Change target triple used to check for lldb in build-manifest

The wrong target triple was used for lldb in build-manifest.  lldb is
only built for macOS, so update the triple to reflect that.

This is an attempt to fix bug#48168.

5 years agoRollup merge of #53405 - oconnor663:search_esc, r=GuillaumeGomez
kennytm [Mon, 20 Aug 2018 17:20:18 +0000 (01:20 +0800)]
Rollup merge of #53405 - oconnor663:search_esc, r=GuillaumeGomez

restore the page title after escaping out of a search

Currently if I start a search in the docs, but then hit ESC, the "Results for..." title is still there in my browser tab. This is a simple attempt to fix that. I see that there's a separate `var previousTitle = document.title` thing happening in `startSearch()`, but as far as I can tell that's only related to the back stack? I'd also appreciate feedback on the right place to declare the `titleBeforeSearch` variable.

Testing-wise, I've confirmed by hand that the tab title restores correctly after building with `./x.py doc --stage 1 src/libstd`, but nothing more involved than that. What else should I test?

5 years agoRollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichton
kennytm [Mon, 20 Aug 2018 17:20:16 +0000 (01:20 +0800)]
Rollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichton

Mark libserialize functions as inline

Got to thinking: "what if that big pile of tiny functions isn't inlining as it should?"
So a few `replace-regex` later the local perf run says this:
<details>

![](https://i.imgur.com/gvdJEgG.png)
</details>
Not huge, but still a win, which is interesting. Want to verify with the real perf run, but I understand there's a backlog.

I didn't notice any increase in compile time or binary sizes for rustc/libs.

5 years agoRollup merge of #53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertj
kennytm [Mon, 20 Aug 2018 17:20:15 +0000 (01:20 +0800)]
Rollup merge of #53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertj

Stabilize macro_vis_matcher

This PR should stabilize [macro_vis_matcher](https://github.com/rust-lang/rust/issues/41022) feature.

- [ ] "reference" book changes: https://github.com/rust-lang-nursery/reference/pull/400
- [ ] "Rust by example" book changes: https://github.com/rust-lang/rust-by-example/pull/1096
- [ ] "clippy" changes: https://github.com/rust-lang-nursery/rust-clippy/pull/3055

r? @cramertj

5 years agosyntax: Optimize some literal parsing
Alex Crichton [Mon, 20 Aug 2018 04:25:08 +0000 (21:25 -0700)]
syntax: Optimize some literal parsing

Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).

5 years agoRollup merge of #53296 - estebank:suggest-closure, r=KodrAus
kennytm [Mon, 20 Aug 2018 17:20:12 +0000 (01:20 +0800)]
Rollup merge of #53296 - estebank:suggest-closure, r=KodrAus

When closure with no arguments was expected, suggest wrapping

Fix #49694.

5 years agoRollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus
kennytm [Mon, 20 Aug 2018 17:20:10 +0000 (01:20 +0800)]
Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus

Stabilize IP associated constants

Fixes #44582

5 years agoRollup merge of #53030 - Aaronepower:master, r=Mark-Simulacrum
kennytm [Mon, 20 Aug 2018 17:20:08 +0000 (01:20 +0800)]
Rollup merge of #53030 - Aaronepower:master, r=Mark-Simulacrum

Updated RELEASES.md for 1.29.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release

5 years agoAuto merge of #47562 - Centril:feature/core_convert_id, r=oli-obk
bors [Mon, 20 Aug 2018 09:09:55 +0000 (09:09 +0000)]
Auto merge of #47562 - Centril:feature/core_convert_id, r=oli-obk

Add the identity function as core::convert::identity

## New notes

This implements rust-lang/rfcs#2306 (see https://github.com/rust-lang/rust/issues/53500).

## Old notes (ignore this in new reviews)

Adds the identity function `fn id<T>(x: T) -> T { x }` to core::convert and the prelude.
Some motivations for why this is useful are explained in the doc tests.
Another is that using the identity function instead of `{ x }` or `|x| x` makes it clear that you intended to use an identity conversion on purpose.

The reasoning:
+ behind adding this to `convert` and not `mem` is that this is an identity *conversion*.
+ for adding this to the prelude is that it should be easy enough to use that the ease of writing your own identity function or using a closure `|x| x` doesn't overtake that.

I've separated this out into two feature gates so that the addition to the prelude can be considered and stabilized separately.

cc @bluss

5 years agocore::convert::identity: fix issue number to #53500
Mazdak Farrokhzad [Mon, 20 Aug 2018 07:16:56 +0000 (09:16 +0200)]
core::convert::identity: fix issue number to #53500

5 years agoAuto merge of #53519 - Manishearth:clippyup, r=eddyb
bors [Mon, 20 Aug 2018 06:34:09 +0000 (06:34 +0000)]
Auto merge of #53519 - Manishearth:clippyup, r=eddyb

Update clippy

r? @oli-obk @eddyb

5 years agoUpdate clippy
Manish Goregaokar [Mon, 20 Aug 2018 02:17:24 +0000 (19:17 -0700)]
Update clippy

5 years agoAuto merge of #52101 - japaric:linker-flavor, r=alexcrichton
bors [Mon, 20 Aug 2018 01:12:58 +0000 (01:12 +0000)]
Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton

try to infer linker flavor from linker name and vice versa

This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121

With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`.

To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable.

With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD).

r? @alexcrichton

5 years agoAuto merge of #52953 - dsciarra:mv-codemap-sourcemap, r=petrochenkov
bors [Sun, 19 Aug 2018 23:08:26 +0000 (23:08 +0000)]
Auto merge of #52953 - dsciarra:mv-codemap-sourcemap, r=petrochenkov

Rename CodeMap/FileMap to SourceMap/SourceFile

A first renaming for #51574

5 years agofix: preserve msvc linker fallback logic
Jorge Aparicio [Sun, 19 Aug 2018 21:59:20 +0000 (23:59 +0200)]
fix: preserve msvc linker fallback logic

5 years agoAuto merge of #53316 - tristanburgess:52895_existential_type_ICE, r=oli-obk
bors [Sun, 19 Aug 2018 21:03:12 +0000 (21:03 +0000)]
Auto merge of #53316 - tristanburgess:52895_existential_type_ICE, r=oli-obk

52985: cause cycle err on inf trait normalization

Issue: #52985
 - If an existential type is defined, but no user code infers the
concrete type behind the existential type, normalization would
infinitely recurse on this existential type which is only defined in
terms of itself.
  - Instead of raising an inf recurse error, we cause a cycle error to
help highlight that the issue is that the type is only defined in terms
of itself.
  - Three known potential improvements:
    - If type folding itself was exposed as a query, used by
normalization and other mechanisms, cases that would cause infinite recursion would
automatically cause a cycle error.
    - The span for the cycle error should be improved to point to user
code that fails to allow inference of the concrete type of the existential type,
assuming that this error occurs because no user code can allow inference the
concrete type.
    - A mechanism to extend the cycle error with a helpful note would be nice. Currently,
the error is built and maintained by src/librustc/ty/query/plumbing,
with no known way to extend the information that the error gets built
with.

r? @oli-obk

5 years agofix tidy errors
Donato Sciarra [Sat, 18 Aug 2018 10:14:31 +0000 (12:14 +0200)]
fix tidy errors

5 years agomv CachingCodemapView CachingSourceMapView
Donato Sciarra [Sat, 18 Aug 2018 10:14:25 +0000 (12:14 +0200)]
mv CachingCodemapView CachingSourceMapView

5 years agomv codemap source_map
Donato Sciarra [Sat, 18 Aug 2018 10:14:14 +0000 (12:14 +0200)]
mv codemap source_map

5 years agomv codemap() source_map()
Donato Sciarra [Sat, 18 Aug 2018 10:14:09 +0000 (12:14 +0200)]
mv codemap() source_map()

5 years agomv (mod) codemap source_map
Donato Sciarra [Sat, 18 Aug 2018 10:14:03 +0000 (12:14 +0200)]
mv (mod) codemap source_map

5 years agomv filemap source_file
Donato Sciarra [Sat, 18 Aug 2018 10:13:56 +0000 (12:13 +0200)]
mv filemap source_file

5 years agomv FileMap SourceFile
Donato Sciarra [Sat, 18 Aug 2018 10:13:52 +0000 (12:13 +0200)]
mv FileMap SourceFile

5 years agomv CodeMap SourceMap
Donato Sciarra [Sat, 18 Aug 2018 10:13:35 +0000 (12:13 +0200)]
mv CodeMap SourceMap

5 years agoconvert-id: tests for const gating.
Mazdak Farrokhzad [Sun, 19 Aug 2018 19:06:43 +0000 (21:06 +0200)]
convert-id: tests for const gating.

5 years agoAuto merge of #53258 - nikomatsakis:issue-53189-optimize-reassignment-immutable-state...
bors [Sun, 19 Aug 2018 17:44:43 +0000 (17:44 +0000)]
Auto merge of #53258 - nikomatsakis:issue-53189-optimize-reassignment-immutable-state, r=pnkfelix

optimize reassignment immutable state

This is the "simple fix" when it comes to checking for reassignment. We just shoot for compatibility with the AST-based checker. Makes no attempt to solve #21232.

I opted for this simpler fix because I didn't want to think about complications [like the ones described here](https://github.com/rust-lang/rust/issues/21232#issuecomment-412219247).

Let's do some profiling measurements.

Fixes #53189

r? @pnkfelix

5 years agoremove feature(convert_id) from lib{core,std}/lib.rs
Mazdak Farrokhzad [Sun, 19 Aug 2018 17:25:35 +0000 (19:25 +0200)]
remove feature(convert_id) from lib{core,std}/lib.rs

5 years agoMake core::convert::identity a const fn.
Mazdak Farrokhzad [Sun, 19 Aug 2018 16:49:31 +0000 (18:49 +0200)]
Make core::convert::identity a const fn.

5 years agoGet rid of unnecessary #![feature(core_float)].
Mazdak Farrokhzad [Sun, 19 Aug 2018 16:37:00 +0000 (18:37 +0200)]
Get rid of unnecessary #![feature(core_float)].

5 years agoDrop `identity` from prelude.
Mazdak Farrokhzad [Sun, 19 Aug 2018 16:36:18 +0000 (18:36 +0200)]
Drop `identity` from prelude.

5 years agoMerge branch 'master' into feature/core_convert_id
Mazdak Farrokhzad [Sun, 19 Aug 2018 16:34:46 +0000 (18:34 +0200)]
Merge branch 'master' into feature/core_convert_id

5 years agoStabilize macro_vis_matcher
Jakub Kozlowski [Tue, 14 Aug 2018 23:24:55 +0000 (00:24 +0100)]
Stabilize macro_vis_matcher

5 years agoFix typos found by codespell.
Matthias Krüger [Sun, 19 Aug 2018 13:30:23 +0000 (15:30 +0200)]
Fix typos found by codespell.

5 years agoAuto merge of #53248 - nikomatsakis:nll-trivial-sized-predicate, r=eddyb
bors [Sun, 19 Aug 2018 15:22:18 +0000 (15:22 +0000)]
Auto merge of #53248 - nikomatsakis:nll-trivial-sized-predicate, r=eddyb

skip trivial `Sized` predicates

This came to about a 2% win for me in cargo. Small, but hey.

r? @eddyb

5 years agomove tests to borrowck directory, remove feature(nll)
Niko Matsakis [Tue, 14 Aug 2018 12:24:44 +0000 (08:24 -0400)]
move tests to borrowck directory, remove feature(nll)

now compare-mode can show us the differences

5 years agoadd tests for assigning fields without initializing var
Niko Matsakis [Sat, 11 Aug 2018 10:15:58 +0000 (06:15 -0400)]
add tests for assigning fields without initializing var

We did not seem to have any!

5 years agojust check whether a variable is initialized
Niko Matsakis [Fri, 10 Aug 2018 22:05:01 +0000 (18:05 -0400)]
just check whether a variable is initialized

Don't iterate over all things that are initialized.

5 years agotreat local variables specially
Niko Matsakis [Fri, 10 Aug 2018 21:34:56 +0000 (17:34 -0400)]
treat local variables specially

5 years agoAuto merge of #51131 - qnighy:unsized-locals, r=eddyb
bors [Sun, 19 Aug 2018 12:21:56 +0000 (12:21 +0000)]
Auto merge of #51131 - qnighy:unsized-locals, r=eddyb

Implement Unsized Rvalues

This PR is the first step to implement RFC1909: unsized rvalues (#48055).

## Implemented

- `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`)
- Unsized locations are allowed in MIR
- Unsized places and operands are correctly translated at codegen

## Not implemented in this PR

- Additional `Sized` checks:
  - tuple struct constructor (accidentally compiles now)
  - closure arguments at closure generation (accidentally compiles now)
  - upvars (ICEs now)
- Generating vtable for `fn method(self)` (ICEs now)
- VLAs: `[e; n]` where `n` isn't const
- Reduce unnecessary allocations

## Current status

- [x] Fix `__rust_probestack` (rust-lang-nursery/compiler-builtins#244)
  - [x] Get the fix merged
- [x] `#![feature(unsized_locals)]`
  - [x] Give it a tracking issue number
- [x] Lift sized checks in typeck and MIR-borrowck
  - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR
- [x] Minimum working codegen
- [x] Add more examples and fill in unimplemented codegen paths
- [ ] <del>Loosen object-safety rules (will be another PR)</del>
- [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del>
- [ ] <del>Reduce temporaries (will be another PR)</del>

5 years agoupdate lld submodule to include RISCV patch
Dan Callaghan [Sun, 19 Aug 2018 11:26:05 +0000 (21:26 +1000)]
update lld submodule to include RISCV patch

This pulls in one new commit, to add support for linking static RISCV
binaries, suitable for the new riscv32imac-unknown-none-elf target.
See: https://github.com/rust-lang/lld/pull/1

5 years agofix: use detected MSVC's link.exe
Jorge Aparicio [Sun, 19 Aug 2018 10:35:58 +0000 (12:35 +0200)]
fix: use detected MSVC's link.exe

5 years agoAuto merge of #52972 - RalfJung:from_raw_parts_align, r=alexcrichton
bors [Sun, 19 Aug 2018 09:40:36 +0000 (09:40 +0000)]
Auto merge of #52972 - RalfJung:from_raw_parts_align, r=alexcrichton

debug_assert to ensure that from_raw_parts is only used properly aligned

This does not help nearly as much as I would hope because everybody uses the distributed libstd which is compiled without debug assertions. For this reason, I am not sure if this is even worth it. OTOH, this would have caught the misalignment fixed by https://github.com/rust-lang/rust/issues/42789 *if* there had been any tests actually using ZSTs with alignment >1 (we have a CI runner which has debug assertions in libstd enabled), and it seems to currently [fail in the rg testsuite](https://ci.appveyor.com/project/rust-lang/rust/build/1.0.8403/job/v7dfdcgn8ay5j6sb). So maybe it is worth it, after all.

I have seen the attribute `#[rustc_inherit_overflow_checks]` in some places, does that make it so that the *caller's* debug status is relevant? Is there a similar attribute for `debug_assert!`? That could even subsume `rustc_inherit_overflow_checks`: Something like `rustc_inherit_debug_flag` could affect *all* places that change the generated code depending on whether we are in debug or release mode. In fact, given that we have to keep around the MIR for generic functions anyway, is there ever a reason *not* to handle the debug flag that way? I guess currently we apply debug flags like `cfg` so this is dropped early during the MIR pipeline?

EDIT: I learned from @eddyb that because of how `debug_assert!` works, this is not realistic. Well, we could still have it for the rustc CI runs and then maybe, eventually, when libstd gets compiled client-side and there is both a debug and a release build... then this will also benefit users.^^

5 years agoLinkerFlavor::Gcc defaults to cc, not gcc
Jorge Aparicio [Sun, 19 Aug 2018 07:39:19 +0000 (09:39 +0200)]
LinkerFlavor::Gcc defaults to cc, not gcc

5 years agoIntegrate OperandValue::UnsizedRef into OperandValue::Ref.
Masaki Hara [Fri, 3 Aug 2018 14:50:13 +0000 (23:50 +0900)]
Integrate OperandValue::UnsizedRef into OperandValue::Ref.

5 years agoIntegrate PassMode::UnsizedIndirect into PassMode::Indirect.
Masaki Hara [Fri, 3 Aug 2018 14:32:21 +0000 (23:32 +0900)]
Integrate PassMode::UnsizedIndirect into PassMode::Indirect.

5 years agoRemove a now-unnecessary paragraph.
Masaki Hara [Thu, 12 Jul 2018 11:27:10 +0000 (20:27 +0900)]
Remove a now-unnecessary paragraph.

The paragraph described a case where we can't optimize away repetitive
dynamic stack allocation. However, as arielb1 pointed out, it can
actually optimizable by dynamically delaying the stack unwinding.

5 years agoUpdate the unstable book regarding [e; dyn n].
Masaki Hara [Thu, 12 Jul 2018 11:26:13 +0000 (20:26 +0900)]
Update the unstable book regarding [e; dyn n].

5 years agoAdd an unstable-book article about unsized_locals.
Masaki Hara [Tue, 29 May 2018 15:33:01 +0000 (00:33 +0900)]
Add an unstable-book article about unsized_locals.

5 years agoImplement simple codegen for unsized rvalues.
Masaki Hara [Mon, 28 May 2018 15:12:55 +0000 (00:12 +0900)]
Implement simple codegen for unsized rvalues.

5 years agoLift some Sized checks.
Masaki Hara [Mon, 28 May 2018 15:11:34 +0000 (00:11 +0900)]
Lift some Sized checks.

5 years agoAdd #![feature(unsized_locals)].
Masaki Hara [Mon, 28 May 2018 15:10:09 +0000 (00:10 +0900)]
Add #![feature(unsized_locals)].

5 years agoAdd Builder::array_alloca.
Masaki Hara [Mon, 28 May 2018 15:07:23 +0000 (00:07 +0900)]
Add Builder::array_alloca.

5 years agoAdd notes on unsized argument errors.
Masaki Hara [Tue, 29 May 2018 15:25:56 +0000 (00:25 +0900)]
Add notes on unsized argument errors.

5 years agoAuto merge of #52592 - eddyb:or-default, r=Mark-Simulacrum
bors [Sat, 18 Aug 2018 21:58:37 +0000 (21:58 +0000)]
Auto merge of #52592 - eddyb:or-default, r=Mark-Simulacrum

Use the new Entry::or_default method where possible.

5 years agoAuto merge of #53324 - alexreg:self_in_typedefs, r=eddyb
bors [Sat, 18 Aug 2018 19:34:24 +0000 (19:34 +0000)]
Auto merge of #53324 - alexreg:self_in_typedefs, r=eddyb

`Self` in type definitions (self_in_typedefs)

This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](https://github.com/rust-lang/rust/issues/49303)).

r? @eddyb

CC @Centril

5 years agofully implement lld-flavor
Jorge Aparicio [Sat, 18 Aug 2018 18:16:04 +0000 (20:16 +0200)]
fully implement lld-flavor

5 years agoAdded page for feature to unstable book.
Alexander Regueiro [Tue, 14 Aug 2018 20:26:33 +0000 (21:26 +0100)]
Added page for feature to unstable book.

5 years agoAdded tests.
Alexander Regueiro [Wed, 15 Aug 2018 01:24:05 +0000 (02:24 +0100)]
Added tests.

5 years agoAdded feature gate.
Alexander Regueiro [Tue, 14 Aug 2018 17:45:44 +0000 (18:45 +0100)]
Added feature gate.

5 years agoUpdated diagnostics.
Alexander Regueiro [Tue, 14 Aug 2018 17:29:53 +0000 (18:29 +0100)]
Updated diagnostics.

5 years agoResolve `Self` within type definitions.
Alexander Regueiro [Tue, 14 Aug 2018 01:49:06 +0000 (02:49 +0100)]
Resolve `Self` within type definitions.

Currently type definitions include `struct`, `enum`, `union`, `existential type`.

5 years agoUse the new Entry::or_default method where possible.
Eduard-Mihai Burtescu [Sat, 21 Jul 2018 19:43:31 +0000 (22:43 +0300)]
Use the new Entry::or_default method where possible.

5 years agoAuto merge of #53436 - cuviper:trace_fn-stop, r=alexcrichton
bors [Sat, 18 Aug 2018 17:15:31 +0000 (17:15 +0000)]
Auto merge of #53436 - cuviper:trace_fn-stop, r=alexcrichton

std: stop backtracing when the frames are full

This is a defensive measure to mitigate the infinite unwind loop seen in #53372.  That case will still repeatedly unwind `__rust_try`, but now it will at least stop when `cx.frames` is full.

r? @alexcrichton

5 years agofatal -> bug
Jorge Aparicio [Sat, 18 Aug 2018 15:19:42 +0000 (17:19 +0200)]
fatal -> bug

5 years agowasm32-unknown-unknown uses the WASM LLD flavor
Jorge Aparicio [Sat, 18 Aug 2018 14:36:24 +0000 (16:36 +0200)]
wasm32-unknown-unknown uses the WASM LLD flavor

5 years agoAuto merge of #53286 - nagisa:cast-assumes, r=eddyb
bors [Sat, 18 Aug 2018 14:35:42 +0000 (14:35 +0000)]
Auto merge of #53286 - nagisa:cast-assumes, r=eddyb

Do not generate assumes for plain integer casts

I gave up on making anything more elegant for now.

r? @eddyb

5 years agoadd lld_flavor info to target spec
Jorge Aparicio [Sat, 18 Aug 2018 14:31:36 +0000 (16:31 +0200)]
add lld_flavor info to target spec

this field defaults to the LD / GNU flavor

5 years agoAuto merge of #53175 - matthewjasper:more-return-stuff, r=nikomatsakis
bors [Sat, 18 Aug 2018 11:57:46 +0000 (11:57 +0000)]
Auto merge of #53175 - matthewjasper:more-return-stuff, r=nikomatsakis

[NLL] Returns are interesting for free regions

Based on #53088 - creating now to get feedback.

Closes #51175

* Make assigning to the return type interesting.
* Use "returning this value" instead of "return" in error messages.
* Prefer one of the explanations that we have a name for to a generic interesting cause in some cases.
* Treat causes that involve the destination of a call like assignments.

5 years agoRemove LinkMeta struct
bjorn3 [Sat, 18 Aug 2018 10:08:06 +0000 (12:08 +0200)]
Remove LinkMeta struct

5 years agoAuto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapin
bors [Sat, 18 Aug 2018 08:56:12 +0000 (08:56 +0000)]
Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapin

Non-naive implementation of `VecDeque.append`

Replaces the old, simple implementation with a more manual (and **unsafe** 😱) one. I've added 1 more test and verified that it covers all 6 code paths in the function.

This new implementation was about 60% faster than the old naive one when I tried benchmarking it.

5 years agoAuto merge of #53437 - alexcrichton:fix-target-features, r=michaelwoerister
bors [Sat, 18 Aug 2018 02:50:39 +0000 (02:50 +0000)]
Auto merge of #53437 - alexcrichton:fix-target-features, r=michaelwoerister

Set more llvm function attributes for __rust_try

This shim is generated elsewhere in the compiler so this commit adds support to
ensure it goes through similar paths as the rest of the compiler to set llvm
function attributes like target features.

cc #53372

5 years agoAuto merge of #53369 - pnkfelix:partial-53351-make-some-ported-compile-fail-tests...
bors [Fri, 17 Aug 2018 23:33:31 +0000 (23:33 +0000)]
Auto merge of #53369 - pnkfelix:partial-53351-make-some-ported-compile-fail-tests-more-robust-wrt-nll, r=davidtwco

Make some ported cfail tests robust w.r.t. NLL

Updated the most glaring instances of weak tests w.r.t. NLL that came from #53196.

See also the bulletpoint list on #53351.

5 years agoAuto merge of #53356 - michaelwoerister:itlto, r=alexcrichton
bors [Fri, 17 Aug 2018 21:24:22 +0000 (21:24 +0000)]
Auto merge of #53356 - michaelwoerister:itlto, r=alexcrichton

Preliminary work for incremental ThinLTO (CGU name edition)

Bring back the first half of #52266 but hopefully without the performance regression.

5 years agoAuto merge of #50911 - petrochenkov:macuse, r=alexcrichton
bors [Fri, 17 Aug 2018 19:10:34 +0000 (19:10 +0000)]
Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton

Stabilize `use_extern_macros`

Closes https://github.com/rust-lang/rust/issues/35896

5 years agoAuto merge of #53449 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 17 Aug 2018 17:00:10 +0000 (17:00 +0000)]
Auto merge of #53449 - frewsxcv:rollup, r=frewsxcv

Rollup of 11 pull requests

Successful merges:

 - #52858 (Implement Iterator::size_hint for Elaborator.)
 - #53321 (Fix usage of `wasm_target_feature`)
 - #53326 ([nll] add regression test for issue #27868)
 - #53347 (rustc_resolve: don't allow paths starting with `::crate`.)
 - #53349 ([nll] add tests for #48697 and #30104)
 - #53357 (Pretty print btreemap for GDB)
 - #53358 (`{to,from}_{ne,le,be}_bytes` for unsigned integer types)
 - #53406 (Do not suggest conversion method that is already there)
 - #53407 (make more ported compile fail tests more robust w.r.t. NLL)
 - #53413 (Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.)
 - #53434 (wasm: Remove --strip-debug argument to LLD)

Failed merges:

r? @ghost

5 years agoRollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik
Corey Farwell [Fri, 17 Aug 2018 15:23:45 +0000 (08:23 -0700)]
Rollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik

wasm: Remove --strip-debug argument to LLD

Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.

5 years agoRollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor
Corey Farwell [Fri, 17 Aug 2018 15:23:44 +0000 (08:23 -0700)]
Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor

Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.

cc @varkor @petrochenkov @joshtriplett

5 years agoRollup merge of #53407 - pnkfelix:partial-53351-make-more-ported-compile-fail-tests...
Corey Farwell [Fri, 17 Aug 2018 15:23:43 +0000 (08:23 -0700)]
Rollup merge of #53407 - pnkfelix:partial-53351-make-more-ported-compile-fail-tests-more-robust-wrt-nll, r=nikomatsakis

make more ported compile fail tests more robust w.r.t. NLL

This is similar to PR #53369, except it covers a disjoint (and much smaller) set of tests that I needed to look at more carefully before being 100% certain they were the same kind of issue.

5 years agoRollup merge of #53406 - estebank:to_string-to_string, r=michaelwoerister
Corey Farwell [Fri, 17 Aug 2018 15:23:42 +0000 (08:23 -0700)]
Rollup merge of #53406 - estebank:to_string-to_string, r=michaelwoerister

Do not suggest conversion method that is already there

Fix #53348.

5 years agoRollup merge of #53358 - SimonSapin:int-bytes, r=shepmaster
Corey Farwell [Fri, 17 Aug 2018 15:23:40 +0000 (08:23 -0700)]
Rollup merge of #53358 - SimonSapin:int-bytes, r=shepmaster

`{to,from}_{ne,le,be}_bytes` for unsigned integer types

Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.

Tracking issue: https://github.com/rust-lang/rust/issues/52963

5 years agoRollup merge of #53357 - fukatani:pretty-print-btreemap, r=michaelwoerister
Corey Farwell [Fri, 17 Aug 2018 15:23:39 +0000 (08:23 -0700)]
Rollup merge of #53357 - fukatani:pretty-print-btreemap, r=michaelwoerister

Pretty print btreemap for GDB

Merge #53112 first, please.

5 years agoRollup merge of #53349 - memoryruins:nll-tests, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:38 +0000 (08:23 -0700)]
Rollup merge of #53349 - memoryruins:nll-tests, r=nikomatsakis

[nll] add tests for #48697 and #30104

Adds tests for the following issues:
- #48697 ``[NLL] ICE: unexpected region for local data with reference to closure``
- #30104 ``Destructuring boxes into multiple mutable references seems broken``

r? @nikomatsakis

5 years agoRollup merge of #53347 - eddyb:no-crate-in-root, r=petrochenkov
Corey Farwell [Fri, 17 Aug 2018 15:23:36 +0000 (08:23 -0700)]
Rollup merge of #53347 - eddyb:no-crate-in-root, r=petrochenkov

rustc_resolve: don't allow paths starting with `::crate`.

cc @aturon @joshtriplett
r? @petrochenkov

5 years agoRollup merge of #53326 - memoryruins:issue-27868-test, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:35 +0000 (08:23 -0700)]
Rollup merge of #53326 - memoryruins:issue-27868-test, r=nikomatsakis

[nll] add regression test for issue #27868

Adds a test for #27868 ``Inconsistent evaluation order for assignment operations``

apart of #47366 ``tracking issue for bugs fixed by the MIR borrow checker or NLL``

r? @nikomatsakis

5 years agoRollup merge of #53321 - alexcrichton:wasm-target-feature, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:34 +0000 (08:23 -0700)]
Rollup merge of #53321 - alexcrichton:wasm-target-feature, r=nikomatsakis

Fix usage of `wasm_target_feature`

Currently usage results in:

```
error: internal compiler error: librustc_typeck/collect.rs:1928: unknown target feature gate wasm_target_feature

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:579:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.30.0-nightly (d5a448b3f 2018-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C linker=/tmp/lld-shim -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `coresimd`.

To learn more, run the command again with --verbose.
```

and hopefully this should fix the ICE!

5 years agoRollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin
Corey Farwell [Fri, 17 Aug 2018 15:23:33 +0000 (08:23 -0700)]
Rollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin

Implement Iterator::size_hint for Elaborator.

None

5 years agoChange target triple used to check for lldb in build-manifest
Tom Tromey [Fri, 17 Aug 2018 14:40:16 +0000 (08:40 -0600)]
Change target triple used to check for lldb in build-manifest

The wrong target triple was used for lldb in build-manifest.  lldb is
only built for macOS, so update the triple to reflect that.

This is an attempt to fix bug#48168.

5 years agoAuto merge of #53288 - RalfJung:dropck, r=nikomatsakis
bors [Fri, 17 Aug 2018 14:16:54 +0000 (14:16 +0000)]
Auto merge of #53288 - RalfJung:dropck, r=nikomatsakis

unions are not always trivially dropable

Fixes #52786

r? @nikomatsakis

5 years agoGratuitous at byte boundaries in hex i32 literals in some doc-tests
Simon Sapin [Fri, 17 Aug 2018 12:01:57 +0000 (14:01 +0200)]
Gratuitous at byte boundaries in hex i32 literals in some doc-tests

5 years agoAuto merge of #53190 - sekineh:thumb-cortex-m, r=jamesmunns
bors [Fri, 17 Aug 2018 10:40:25 +0000 (10:40 +0000)]
Auto merge of #53190 - sekineh:thumb-cortex-m, r=jamesmunns

Add crate build test for `thumb*` targets. [IRR-2018-embedded]

## Summary

This PR adds `run-make` test that compiles `cortex-m` crate for all supported `thumb*-none-*` targets using `cargo` and stage2 `rustc`.

- Supported `thumb*-none-*` targets:
  - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
  - thumbv7em-none-eabi (Bare Cortex-M4, M7)
  - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
  - thumbv7m-none-eabi (Bare Cortex-M3)

## How to run & Example output
I tested locally and all targets succeeded like below:
```
./x.py clean
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
```
```
Check compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu -> thumbv6m-none-eabi)

running 5 tests
.....
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

## How to re-run

Remove `stamp` file for the test run.
```
rm build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/stamp
```
Then run `test`
```
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
(snip)
running 5 tests
iiii.
test result: ok. 1 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out
```

## Artifacts

You can examine the artifacts under the directory below:
```
sekineh@sekineh-VirtualBox:~/rustme10$ ls -l build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/
total 4
drwxrwxr-x 7 sekineh sekineh 4096  8月 14 22:40 cortex-m
```
where `build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/` is came from TMPDIR variable.

## Other notes

For `test.rs` modification, I used the same logic as:
- https://github.com/rust-lang/rust/blame/d8b3c830fbcdd14d085209a8dcc3399151f3286a/src/bootstrap/dist.rs#L652-L657
```
            if builder.no_std(target) == Some(true) {
                // the `test` doesn't compile for no-std targets
                builder.ensure(compile::Std { compiler, target });
            } else {
                builder.ensure(compile::Test { compiler, target });
            }
```
It is a useful snippet when adding `no_std` support to `src/bootstrap` code.

CC @kennytm @jamesmunns @nerdyvaishali

5 years agoFix undesirable fallout
Vadim Petrochenkov [Fri, 17 Aug 2018 10:17:39 +0000 (13:17 +0300)]
Fix undesirable fallout

compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs - resolution change for derive helper attributes with the same name as derive itself
run-pass/macro-comma-support.rs - indeterminate resolutions for macros in expression positions
ui/issues/issue-49074.rs - diagnostics regression, not enough recovery to report the second error
ui/object-lifetime/object-lifetime-default.stderr - unstable diagnostics?

5 years agoStabilize `use_extern_macros`
Vadim Petrochenkov [Mon, 14 May 2018 00:22:52 +0000 (03:22 +0300)]
Stabilize `use_extern_macros`

5 years agorustc_resolve: don't allow paths starting with `::crate`.
Eduard-Mihai Burtescu [Tue, 14 Aug 2018 09:54:43 +0000 (12:54 +0300)]
rustc_resolve: don't allow paths starting with `::crate`.

5 years agoAuto merge of #53383 - nnethercote:HybridIdxSetBuf, r=nikomatsakis
bors [Fri, 17 Aug 2018 07:20:23 +0000 (07:20 +0000)]
Auto merge of #53383 - nnethercote:HybridIdxSetBuf, r=nikomatsakis

Speed up NLL with HybridIdxSetBuf.

It's a sparse-when-small but dense-when-large index set that is very
efficient for sets that (a) have few elements, (b) have large
universe_size values, and (c) are cleared frequently. Which makes it
perfect for the `gen_set` and `kill_set` sets used by the new borrow
checker.

This patch reduces `tuple-stress`'s NLL-check time by 40%, and up to 12%
for several other benchmarks. And it halves the max-rss for `keccak`,
and has smaller wins for `inflate` and `clap-rs`.

5 years agofix license
Ralf Jung [Thu, 16 Aug 2018 18:36:34 +0000 (20:36 +0200)]
fix license