]> git.lizzy.rs Git - rust.git/log
rust.git
5 years ago#[feature(uniform_paths)]: allow `use x::y;` to resolve through `self::x`, not just...
Taylor Cramer [Fri, 13 Jul 2018 19:38:49 +0000 (12:38 -0700)]
#[feature(uniform_paths)]: allow `use x::y;` to resolve through `self::x`, not just `::x`.

5 years agorustc_resolve: fix special-case for one-segment import paths.
Eduard-Mihai Burtescu [Thu, 9 Aug 2018 13:29:22 +0000 (16:29 +0300)]
rustc_resolve: fix special-case for one-segment import paths.

5 years agosyntax: gensym the injected std/core extern crates in the Rust 2018 edition.
Eduard-Mihai Burtescu [Fri, 10 Aug 2018 13:01:32 +0000 (16:01 +0300)]
syntax: gensym the injected std/core extern crates in the Rust 2018 edition.

5 years agosyntax: add `uniform_paths` feature-gate.
Eduard-Mihai Burtescu [Thu, 9 Aug 2018 20:50:04 +0000 (23:50 +0300)]
syntax: add `uniform_paths` feature-gate.

5 years agoAuto merge of #53270 - petrochenkov:macuse-regr, r=alexcrichton
bors [Mon, 13 Aug 2018 17:10:04 +0000 (17:10 +0000)]
Auto merge of #53270 - petrochenkov:macuse-regr, r=alexcrichton

Fix a few regressions from enabling macro modularization

The first commit restores the old behavior for some minor unstable stuff (`rustc_*` and `derive_*` attributes) and adds a new feature gate for arbitrary tokens in non-macro attributes.

The second commit fixes https://github.com/rust-lang/rust/issues/53205

The third commit fixes https://github.com/rust-lang/rust/issues/53144.
Same technique is used as for other things blocking expansion progress - if something causes indeterminacy too often, then prohibit it.
In this case referring to crate-local macro-expanded `#[macro_export]` macros via module-relative paths is prohibited, see comments in code for more details.

cc https://github.com/rust-lang/rust/pull/50911

5 years agoAuto merge of #53161 - michaelwoerister:cstrings, r=wesleywiser
bors [Mon, 13 Aug 2018 11:19:07 +0000 (11:19 +0000)]
Auto merge of #53161 - michaelwoerister:cstrings, r=wesleywiser

Avoid many allocations for CStrings during codegen.

Giving in to my irrational fear of dynamic allocations. Let's see what perf says to this.

5 years agoAuto merge of #53238 - nrc:update, r=kennytm
bors [Mon, 13 Aug 2018 06:42:15 +0000 (06:42 +0000)]
Auto merge of #53238 - nrc:update, r=kennytm

Update RLS

Should fix RLS toolstate

5 years agoAuto merge of #53051 - varkor:trait-method-pattern-arguments-error, r=petrochenkov
bors [Mon, 13 Aug 2018 02:28:13 +0000 (02:28 +0000)]
Auto merge of #53051 - varkor:trait-method-pattern-arguments-error, r=petrochenkov

Emit error for pattern arguments in trait methods

The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors.

This improves the error message described in https://github.com/rust-lang/rust/issues/53046.

r? @petrochenkov

5 years agoAuto merge of #53297 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 12 Aug 2018 21:52:22 +0000 (21:52 +0000)]
Auto merge of #53297 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 15 pull requests

Successful merges:

 - #52955 (Update compiler test documentation)
 - #53019 (Don't collect() when size_hint is useless)
 - #53025 (Consider changing assert! to debug_assert! when it calls visit_with)
 - #53059 (Remove explicit returns where unnecessary)
 - #53165 ( Add aarch64-unknown-netbsd target)
 - #53210 (Deny future duplication of rustc-ap-syntax)
 - #53223 (A few cleanups for rustc_data_structures)
 - #53230 ([nll] enable feature(nll) on various crates for bootstrap: part 4)
 - #53231 (Add let keyword doc)
 - #53240 (Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`)
 - #53253 (Remove unwanted console log)
 - #53264 (Show that Command can be reused and remodified)
 - #53267 (Fix styles)
 - #53273 (Add links to std::char::REPLACEMENT_CHARACTER from docs.)
 - #53283 (wherein we suggest float for integer literals where a float was expected)

Failed merges:

r? @ghost

5 years agoRollup merge of #53283 - zackmdavis:and_the_case_of_the_flotation_device, r=estebank
Guillaume Gomez [Sun, 12 Aug 2018 21:27:05 +0000 (23:27 +0200)]
Rollup merge of #53283 - zackmdavis:and_the_case_of_the_flotation_device, r=estebank

wherein we suggest float for integer literals where a float was expected

@sunjay pointed out that this is a nice thing that we could do.

Resolves #53280.

r? @estebank

5 years agoRollup merge of #53273 - frewsxcv:frewsxcv-ufffd, r=GuillaumeGomez
Guillaume Gomez [Sun, 12 Aug 2018 21:27:04 +0000 (23:27 +0200)]
Rollup merge of #53273 - frewsxcv:frewsxcv-ufffd, r=GuillaumeGomez

Add links to std::char::REPLACEMENT_CHARACTER from docs.

There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!

5 years agoRollup merge of #53267 - GuillaumeGomez:fix-styles, r=QuietMisdreavus
Guillaume Gomez [Sun, 12 Aug 2018 21:27:02 +0000 (23:27 +0200)]
Rollup merge of #53267 - GuillaumeGomez:fix-styles, r=QuietMisdreavus

Fix styles

Fixes #53262.

r? @QuietMisdreavus

5 years agoRollup merge of #53264 - Havvy:patch-3, r=GuillaumeGomez
Guillaume Gomez [Sun, 12 Aug 2018 21:27:01 +0000 (23:27 +0200)]
Rollup merge of #53264 - Havvy:patch-3, r=GuillaumeGomez

Show that Command can be reused and remodified

The prior documentation did not make it clear this was possible.

I wanted to make the `list_dir` example work on Windows, but I don't know if passing "/" will error or show the root of the current volume (e.g. `C:`).

r? @GuillaumeGomez

5 years agoRollup merge of #53253 - GuillaumeGomez:remove-console, r=kennytm
Guillaume Gomez [Sun, 12 Aug 2018 21:26:59 +0000 (23:26 +0200)]
Rollup merge of #53253 - GuillaumeGomez:remove-console, r=kennytm

Remove unwanted console log

Forgot to remove a `console.log`, now it's fixed.

r? @QuietMisdreavus

5 years agoRollup merge of #53240 - llogiq:doc-num-swap-reverse, r=joshtriplett
Guillaume Gomez [Sun, 12 Aug 2018 21:26:58 +0000 (23:26 +0200)]
Rollup merge of #53240 - llogiq:doc-num-swap-reverse, r=joshtriplett

Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`

5 years agoRollup merge of #53231 - GuillaumeGomez:let-keyword, r=QuietMisdreavus
Guillaume Gomez [Sun, 12 Aug 2018 21:26:57 +0000 (23:26 +0200)]
Rollup merge of #53231 - GuillaumeGomez:let-keyword, r=QuietMisdreavus

Add let keyword doc

Part of #34601.

r? @rust-lang/docs

5 years agoRollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakis
Guillaume Gomez [Sun, 12 Aug 2018 21:26:56 +0000 (23:26 +0200)]
Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakis

[nll] enable feature(nll) on various crates for bootstrap: part 4

#53172

r? @nikomatsakis

5 years agoRollup merge of #53223 - ljedrz:cleanup_data_structures, r=oli-obk
Guillaume Gomez [Sun, 12 Aug 2018 21:26:55 +0000 (23:26 +0200)]
Rollup merge of #53223 - ljedrz:cleanup_data_structures, r=oli-obk

A few cleanups for rustc_data_structures

- remove a redundant `clone()`
- make some calls to `.iter()` implicit
- collapse/simplify a few operations
- remove some explicit `return`s
- make `SnapshotMap::{commit, rollback_to}` take references
- remove unnecessary struct field names
- change `transmute()`s in `IdxSet::{from_slice, from_slice_mut}` to casts
- remove some unnecessary lifetime annotations
- split 2 long literals

5 years agoRollup merge of #53210 - alexcrichton:deny-rustc-syntax, r=nrc
Guillaume Gomez [Sun, 12 Aug 2018 21:26:54 +0000 (23:26 +0200)]
Rollup merge of #53210 - alexcrichton:deny-rustc-syntax, r=nrc

Deny future duplication of rustc-ap-syntax

Enable the tidy check to forbid this!

Closes #53006

5 years agoRollup merge of #53165 - jakllsch:netbsd-ad22a005-b917-47f3-8156-f717d36f6bbe, r...
Guillaume Gomez [Sun, 12 Aug 2018 21:26:52 +0000 (23:26 +0200)]
Rollup merge of #53165 - jakllsch:netbsd-ad22a005-b917-47f3-8156-f717d36f6bbe, r=estebank

 Add aarch64-unknown-netbsd target

Depends on #53116.

5 years agoRollup merge of #53059 - ljedrz:unneeded_returns, r=kennytm
Guillaume Gomez [Sun, 12 Aug 2018 21:26:51 +0000 (23:26 +0200)]
Rollup merge of #53059 - ljedrz:unneeded_returns, r=kennytm

Remove explicit returns where unnecessary

5 years agoRollup merge of #53025 - ljedrz:debug_asserts_limited, r=varkor
Guillaume Gomez [Sun, 12 Aug 2018 21:26:50 +0000 (23:26 +0200)]
Rollup merge of #53025 - ljedrz:debug_asserts_limited, r=varkor

Consider changing assert! to debug_assert! when it calls visit_with

The perf run from #52956 revealed that there were 3 benchmarks that benefited most from changing `assert!`s to `debug_assert!`s:

- issue #46449: avg -4.7% for -check
- deeply-nested (AKA #38528): avg -3.4% for -check
- regression #31157: avg -3.2% for -check

I analyzed their fixing PRs and decided to look for potentially heavy assertions in the files they modified. I noticed that all of the non-trivial ones contained indirect calls to `visit_with()`.

It might be a good idea to consider changing `assert!` to `debug_assert!` in those places in order to get the performance wins shown by the benchmarks.

5 years agoRollup merge of #53019 - ljedrz:bad_collects, r=estebank
Guillaume Gomez [Sun, 12 Aug 2018 21:26:49 +0000 (23:26 +0200)]
Rollup merge of #53019 - ljedrz:bad_collects, r=estebank

Don't collect() when size_hint is useless

This adjusts PRs #52738 and #52697 by falling back to calculating capacity and extending or pushing in a loop where `collect()` can't be trusted to calculate the right capacity.

It is a performance win.

5 years agoRollup merge of #52955 - tromey:compiler-test-docs, r=nikomatsakis
Guillaume Gomez [Sun, 12 Aug 2018 21:26:48 +0000 (23:26 +0200)]
Rollup merge of #52955 - tromey:compiler-test-docs, r=nikomatsakis

Update compiler test documentation

Update the compiler test documentation to document ignore-gdb-version
and min-system-llvm-version; and expand the min-gdb-version,
min-lldb-version, and min-llvm-version documentation a little.

5 years agoProhibit using macro-expanded `macro_export` macros through module-relative paths
Vadim Petrochenkov [Sat, 11 Aug 2018 11:33:43 +0000 (14:33 +0300)]
Prohibit using macro-expanded `macro_export` macros through module-relative paths

5 years agowherein we suggest float for integer literals where a float was expected
Zack M. Davis [Sun, 12 Aug 2018 05:54:57 +0000 (22:54 -0700)]
wherein we suggest float for integer literals where a float was expected

Sunjay Varma pointed out that this is a nice thing that we could do.

Resolves #53280.

5 years agoClean up and add extra tests
varkor [Sat, 11 Aug 2018 20:25:48 +0000 (21:25 +0100)]
Clean up and add extra tests

5 years agoAdd E0642 to parser error
varkor [Fri, 10 Aug 2018 00:49:45 +0000 (01:49 +0100)]
Add E0642 to parser error

5 years agoEmit an error during parsing
varkor [Thu, 9 Aug 2018 22:23:08 +0000 (23:23 +0100)]
Emit an error during parsing

5 years agoImprove diagnostics
varkor [Mon, 6 Aug 2018 23:03:26 +0000 (00:03 +0100)]
Improve diagnostics

5 years agoFix handling of trait methods with bodies and improve efficiency
varkor [Mon, 6 Aug 2018 17:14:57 +0000 (18:14 +0100)]
Fix handling of trait methods with bodies and improve efficiency

5 years agoSuggest replacing patterns with underscores
varkor [Sat, 4 Aug 2018 10:48:33 +0000 (11:48 +0100)]
Suggest replacing patterns with underscores

5 years agoEmit error for pattern arguments in trait methods
varkor [Sat, 4 Aug 2018 01:23:21 +0000 (02:23 +0100)]
Emit error for pattern arguments in trait methods

The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors.

5 years agoFix indent
Havvy (Ryan Scheel) [Sat, 11 Aug 2018 20:02:49 +0000 (13:02 -0700)]
Fix indent

5 years agoAdd links to std::char::REPLACEMENT_CHARACTER from docs.
Corey Farwell [Sat, 11 Aug 2018 18:09:59 +0000 (14:09 -0400)]
Add links to std::char::REPLACEMENT_CHARACTER from docs.

There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!

5 years agoAdd let keyword doc
Guillaume Gomez [Sat, 11 Aug 2018 15:02:31 +0000 (17:02 +0200)]
Add let keyword doc

5 years agoDo not consider built-in attributes as candidates when resolving non-attribute macro...
Vadim Petrochenkov [Sat, 11 Aug 2018 13:58:28 +0000 (16:58 +0300)]
Do not consider built-in attributes as candidates when resolving non-attribute macro invocations

This is needed to avoid regressions on stable channel

5 years agoFeature gate arbitrary tokens in non-macro attributes with a separate gate
Vadim Petrochenkov [Sat, 11 Aug 2018 13:40:08 +0000 (16:40 +0300)]
Feature gate arbitrary tokens in non-macro attributes with a separate gate

Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`

5 years agoShow that Command can be reused and remodified
Ryan Scheel [Sat, 11 Aug 2018 10:13:29 +0000 (03:13 -0700)]
Show that Command can be reused and remodified

The prior documentation did not make it clear this was possible.

5 years agoFix styles
Guillaume Gomez [Sat, 11 Aug 2018 11:34:15 +0000 (13:34 +0200)]
Fix styles

5 years agoUpdate RLS
Nick Cameron [Thu, 9 Aug 2018 21:36:41 +0000 (09:36 +1200)]
Update RLS

5 years agoaarch64-unknown-netbsd: add openssl configuration
Jonathan A. Kollasch [Fri, 10 Aug 2018 18:42:31 +0000 (13:42 -0500)]
aarch64-unknown-netbsd: add openssl configuration

5 years agoAuto merge of #53177 - nikomatsakis:nll-redundant-borrows-and-escaping-values, r...
bors [Fri, 10 Aug 2018 19:18:22 +0000 (19:18 +0000)]
Auto merge of #53177 - nikomatsakis:nll-redundant-borrows-and-escaping-values, r=pnkfelix

optimize redundant borrows and escaping paths in NLL

This builds on https://github.com/rust-lang/rust/pull/53168 and adds a commit that addresses https://github.com/rust-lang/rust/issues/53176 -- or at least I think it does. I marked this as WIP because I want to see the test results (and measure the performance). I also want to double check we're not adding in any unsoundness here.

5 years agoRemove unwanted console log
Guillaume Gomez [Fri, 10 Aug 2018 16:48:36 +0000 (18:48 +0200)]
Remove unwanted console log

5 years agoLink compiler test documentation to rustc-guide
Tom Tromey [Wed, 1 Aug 2018 17:36:28 +0000 (11:36 -0600)]
Link compiler test documentation to rustc-guide

Update the compiler test documentation to point to the relevant
rustc-guide page.

5 years ago[nll] librustc_codegen_llvm: remove unused mut annotation
memoryruins [Fri, 10 Aug 2018 10:31:40 +0000 (06:31 -0400)]
[nll] librustc_codegen_llvm: remove unused mut annotation

5 years ago[nll] librustc_codegen_llvm: change Child signature to fix error pointed out by nll
memoryruins [Fri, 10 Aug 2018 10:31:10 +0000 (06:31 -0400)]
[nll] librustc_codegen_llvm: change Child signature to fix error pointed out by nll

As explained by eddyb in #53221, "An &ArchiveChild doesn't point into the archive itself, it points to an owned object that itself points to the archive, and LLVMRustArchiveMemberNew copies the ArchiveChild (whereas the current signature suggests it keeps the &ArchiveChild)."

5 years ago[nll] librustc_codegen_llvm: enable feature(nll) for bootstrap
memoryruins [Fri, 10 Aug 2018 10:28:24 +0000 (06:28 -0400)]
[nll] librustc_codegen_llvm: enable feature(nll) for bootstrap

5 years ago[nll] librustc_mir: enable feature(nll) for bootstrap
memoryruins [Fri, 10 Aug 2018 10:27:35 +0000 (06:27 -0400)]
[nll] librustc_mir: enable feature(nll) for bootstrap

5 years ago[nll] libstd: enable feature(nll) for bootstrap
memoryruins [Fri, 10 Aug 2018 10:27:10 +0000 (06:27 -0400)]
[nll] libstd: enable feature(nll) for bootstrap

5 years agoAdd individual documentation for <integer>`.swap_bytes`/.`reverse_bits`
Andre Bogus [Fri, 10 Aug 2018 04:53:07 +0000 (06:53 +0200)]
Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`

5 years agoIntroduce SmallCStr and use it where applicable.
Michael Woerister [Tue, 7 Aug 2018 14:04:34 +0000 (16:04 +0200)]
Introduce SmallCStr and use it where applicable.

5 years agoIntroduce const_cstr!() macro and use it where applicable.
Michael Woerister [Tue, 7 Aug 2018 14:03:57 +0000 (16:03 +0200)]
Introduce const_cstr!() macro and use it where applicable.

5 years agodon't walk MIR if no local variables need liveness
Niko Matsakis [Fri, 10 Aug 2018 08:17:46 +0000 (04:17 -0400)]
don't walk MIR if no local variables need liveness

This is true for tuple-stress and html5ever

5 years agoAuto merge of #53131 - davidtwco:issue-52663-thread-local-static, r=nikomatsakis
bors [Fri, 10 Aug 2018 06:54:11 +0000 (06:54 +0000)]
Auto merge of #53131 - davidtwco:issue-52663-thread-local-static, r=nikomatsakis

NLL says something "does not live long enough" when talking about a (thread-local) static

Part of #52663.

r? @nikomatsakis

5 years agoConsider changing assert! to debug_assert! when it calls visit_with
ljedrz [Fri, 3 Aug 2018 11:19:17 +0000 (13:19 +0200)]
Consider changing assert! to debug_assert! when it calls visit_with

5 years agoAuto merge of #53124 - davidtwco:issue-52742, r=nikomatsakis
bors [Fri, 10 Aug 2018 02:18:21 +0000 (02:18 +0000)]
Auto merge of #53124 - davidtwco:issue-52742, r=nikomatsakis

region error messages involving impls are confusing

Part of #52742.

r? @nikomatsakis

5 years agoAuto merge of #53073 - Mark-Simulacrum:data-structures, r=pnkfelix
bors [Fri, 10 Aug 2018 00:14:52 +0000 (00:14 +0000)]
Auto merge of #53073 - Mark-Simulacrum:data-structures, r=pnkfelix

Cleanup to librustc::session and related code

No functional changes, just some cleanup.

This also creates the `rustc_fs_util` crate, but I can remove that change if desired. It felt a little odd to force crates to depend on librustc for some fs utilities; and also seemed good to generally keep the size of librustc lower (for compile times); fs_util will compile in parallel with essentially the first crate since it has no dependencies beyond std.

5 years agoAuto merge of #52788 - LukasKalbertodt:improve-index-mut-error, r=estebank
bors [Thu, 9 Aug 2018 22:05:18 +0000 (22:05 +0000)]
Auto merge of #52788 - LukasKalbertodt:improve-index-mut-error, r=estebank

Add help message for missing `IndexMut` impl

Code:
```rust
let mut map = HashMap::new();
map.insert("peter", 23);
map["peter"] = 27;
```

Before:
```
error[E0594]: cannot assign to immutable indexed content
 --> src/main.rs:7:5
  |
7 |     map["peter"] = 27;
  |     ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
```

With this change (just the `help` was added):
```
error[E0594]: cannot assign to immutable indexed content
 --> index-error.rs:7:5
  |
7 |     map["peter"] = 27;
  |     ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
  |
  = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for std::collections::HashMap<&str, i32>
```

---

Yesterday I did some pair programming with a Rust-beginner. We created a type and implemented `Index` for it. Trying to modify the value returned by the index operation returns in a rather vague error that was not very clear for the Rust beginner. So I tried to improve the situation.

## Notes/questions for reviewers:
- Is the formulation OK like that? I'm fine with changing it.
- Can we be absolutely sure that `IndexMut` is actually not implemented in the case my `help` message is added? I'm fairly sure myself, but there could be some cases I didn't think of. Also, I don't know the compiler very well, so I don't know what exactly certain enum variants are used for.
  - It would be nice to test if `IndexMut` is in fact not implemented for the type, but I couldn't figure out how to check that. If you think that additional check would be beneficial, could you tell me how to check if a trait is implemented?
- Do you think I should change the error message instead of only adding an additional help message?

5 years ago[nll] librustc_data_structures: remove unused mut annotation in test
memoryruins [Thu, 9 Aug 2018 21:31:15 +0000 (17:31 -0400)]
[nll] librustc_data_structures: remove unused mut annotation in test

5 years ago[nll] librustdoc: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:35:06 +0000 (15:35 -0400)]
[nll] librustdoc: enable feature(nll) for bootstrap

5 years ago[nll] librustc_typeck: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:34:54 +0000 (15:34 -0400)]
[nll] librustc_typeck: enable feature(nll) for bootstrap

5 years ago[nll] librustc_platform_intrinsics: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:34:31 +0000 (15:34 -0400)]
[nll] librustc_platform_intrinsics: enable feature(nll) for bootstrap

5 years ago[nll] librustc_msan: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:34:05 +0000 (15:34 -0400)]
[nll] librustc_msan: enable feature(nll) for bootstrap

5 years ago[nll] librustc_lsan: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:33:50 +0000 (15:33 -0400)]
[nll] librustc_lsan: enable feature(nll) for bootstrap

5 years ago[nll] librustc_llvm: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:33:24 +0000 (15:33 -0400)]
[nll] librustc_llvm: enable feature(nll) for bootstrap

5 years ago[nll] librustc_codegen_utils: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:33:06 +0000 (15:33 -0400)]
[nll] librustc_codegen_utils: enable feature(nll) for bootstrap

5 years ago[nll] libproc_macro: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:32:45 +0000 (15:32 -0400)]
[nll] libproc_macro: enable feature(nll) for bootstrap

5 years ago[nll] libsyntax_ext: remove unnecessary mut annotation on variable
memoryruins [Thu, 9 Aug 2018 19:32:23 +0000 (15:32 -0400)]
[nll] libsyntax_ext: remove unnecessary mut annotation on variable

Pointed out by nll. It is correct that the mut annotation is not needed.

5 years ago[nll] libsyntax_ext: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 19:28:39 +0000 (15:28 -0400)]
[nll] libsyntax_ext: enable feature(nll) for bootstrap

5 years agoAuto merge of #53216 - kennytm:rollup, r=kennytm
bors [Thu, 9 Aug 2018 19:05:14 +0000 (19:05 +0000)]
Auto merge of #53216 - kennytm:rollup, r=kennytm

Rollup of 15 pull requests

Successful merges:

 - #52773 (Avoid unnecessary pattern matching against Option and Result)
 - #53082 (Fix doc link (again))
 - #53094 (Automatically expand section if url id point to one of its component)
 - #53106 (atomic ordering docs)
 - #53110 (Account for --remap-path-prefix in save-analysis)
 - #53116 (NetBSD: fix signedess of char)
 - #53179 (Whitelist wasm32 simd128 target feature)
 - #53183 (Suggest comma when missing in macro call)
 - #53207 (Add individual docs for rotate_{left, right})
 - #53211 ([nll] enable feature(nll) on various crates for bootstrap)
 - #53214 ([nll] enable feature(nll) on various crates for bootstrap: part 2)
 - #53215 (Slightly refactor syntax_ext/format)
 - #53217 (inline some short functions)
 - #53219 ([nll] enable feature(nll) on various crates for bootstrap: part 3)
 - #53222 (A few cleanups for rustc_target)

5 years agoRollup merge of #53207 - llogiq:num-rotate-docs, r=QuietMisdreavus
kennytm [Thu, 9 Aug 2018 17:55:31 +0000 (01:55 +0800)]
Rollup merge of #53207 - llogiq:num-rotate-docs, r=QuietMisdreavus

Add individual docs for rotate_{left, right}

5 years agoA few cleanups for rustc_data_structures
ljedrz [Thu, 9 Aug 2018 15:00:14 +0000 (17:00 +0200)]
A few cleanups for rustc_data_structures

5 years agoChange transmute()s in IdxSet::{from_slice, from_slice_mut} to casts
ljedrz [Thu, 9 Aug 2018 14:59:10 +0000 (16:59 +0200)]
Change transmute()s in IdxSet::{from_slice, from_slice_mut} to casts

5 years agoMake SnapshotMap::{commit, rollback_to} take references
ljedrz [Thu, 9 Aug 2018 14:57:55 +0000 (16:57 +0200)]
Make SnapshotMap::{commit, rollback_to} take references

5 years agoRollup merge of #53222 - ljedrz:cleanup_rustc_target, r=Mark-Simulacrum
kennytm [Thu, 9 Aug 2018 17:04:10 +0000 (01:04 +0800)]
Rollup merge of #53222 - ljedrz:cleanup_rustc_target, r=Mark-Simulacrum

A few cleanups for rustc_target

- remove redundant struct field names
- shorten a self-assignment
- prefer `unwrap_or_else` in case of function calls
- collapse an `if`
- collapse a double `map()`
- match on dereferenced objects
- consume `self` if it implements `Copy`

5 years agoRollup merge of #53215 - ljedrz:refactor_format, r=estebank
kennytm [Thu, 9 Aug 2018 17:03:45 +0000 (01:03 +0800)]
Rollup merge of #53215 - ljedrz:refactor_format, r=estebank

Slightly refactor syntax_ext/format

expand_preparsed_format_args:
- move a potential error `return` earlier in the processing
- pre-allocate some of the required space for `cx.pieces` and `cx.str_pieces`
- create `cx`-independent objects before `cx`
- build `pieces` and `errs` using `collect` instead of a `push` loop

describe_num_args:
- return `Cow<str>` instead of `String`

5 years agoRollup merge of #53219 - memoryruins:nll_bootstrap_3, r=nikomatsakis
kennytm [Thu, 9 Aug 2018 13:35:35 +0000 (21:35 +0800)]
Rollup merge of #53219 - memoryruins:nll_bootstrap_3, r=nikomatsakis

[nll] enable feature(nll) on various crates for bootstrap: part 3

#53172

5 years agoRollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis
kennytm [Thu, 9 Aug 2018 13:35:23 +0000 (21:35 +0800)]
Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis

[nll] enable feature(nll) on various crates for bootstrap: part 2

#53172

5 years agoRollup merge of #53211 - memoryruins:nll_bootstrap, r=nikomatsakis
kennytm [Thu, 9 Aug 2018 13:35:01 +0000 (21:35 +0800)]
Rollup merge of #53211 - memoryruins:nll_bootstrap, r=nikomatsakis

[nll] enable feature(nll) on various crates for bootstrap

#53172

5 years agoRollup merge of #53082 - felixrabe:fix-doc-link-again, r=GuillaumeGomez
kennytm [Thu, 9 Aug 2018 13:34:36 +0000 (21:34 +0800)]
Rollup merge of #53082 - felixrabe:fix-doc-link-again, r=GuillaumeGomez

Fix doc link (again)

Similar to #52404. The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)

-   https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)

-   https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)

This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):

    rg -l dynamically-sized-types-and-sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)

5 years agoRollup merge of #53217 - strake:inline, r=nagisa
kennytm [Thu, 9 Aug 2018 13:33:49 +0000 (21:33 +0800)]
Rollup merge of #53217 - strake:inline, r=nagisa

inline some short functions

I found these were outline in binaries i link. I think they ought to be inline, considering their size.

5 years agoRollup merge of #53106 - RalfJung:ordering, r=stjepang
kennytm [Thu, 9 Aug 2018 13:31:41 +0000 (21:31 +0800)]
Rollup merge of #53106 - RalfJung:ordering, r=stjepang

atomic ordering docs

Discussion in https://github.com/rust-lang/rfcs/pull/2503 revealed that this could be improved. I hope this helps.

5 years agoRollup merge of #53183 - estebank:println-comma, r=oli-obk
kennytm [Thu, 9 Aug 2018 08:58:49 +0000 (16:58 +0800)]
Rollup merge of #53183 - estebank:println-comma, r=oli-obk

Suggest comma when missing in macro call

When missing a comma in a macro call, suggest it, regardless of
position. When a macro call doesn't match any of the patterns, check
if the call's token stream could be missing a comma between two idents,
and if so, create a new token stream containing the comma and try to
match against the macro patterns. If successful, emit the suggestion.

This works on arbitrary macros, with no need of special support from
the macro writers.

```
error: no rules expected the token `d`
  --> $DIR/missing-comma.rs:26:18
   |
LL |     foo!(a, b, c d, e);
   |                 -^
   |                 |
   |                 help: missing comma here
```
Follow up to #52397.

5 years agoRollup merge of #53179 - gnzlbg:patch-3, r=alexcrichton
kennytm [Thu, 9 Aug 2018 08:58:48 +0000 (16:58 +0800)]
Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichton

Whitelist wasm32 simd128 target feature

r? @alexcrichton

5 years agoMove span_bug and bug helper functions to util
Mark Rousskov [Sat, 4 Aug 2018 12:51:33 +0000 (06:51 -0600)]
Move span_bug and bug helper functions to util

5 years agoCache ignored attributes inside ICH entirely
Mark Rousskov [Sat, 4 Aug 2018 00:39:28 +0000 (18:39 -0600)]
Cache ignored attributes inside ICH entirely

5 years agoMove Fingerprint to data structures
Mark Rousskov [Sat, 4 Aug 2018 00:34:23 +0000 (18:34 -0600)]
Move Fingerprint to data structures

5 years agoReuse Hash impls for session data structures
Mark Rousskov [Fri, 3 Aug 2018 22:41:30 +0000 (16:41 -0600)]
Reuse Hash impls for session data structures

5 years agoRemove dependency on rustc::ty from code_stats
Mark Rousskov [Fri, 3 Aug 2018 22:10:33 +0000 (16:10 -0600)]
Remove dependency on rustc::ty from code_stats

5 years agoMove path2cstr to rustc_fs_util
Mark Rousskov [Fri, 3 Aug 2018 21:37:15 +0000 (15:37 -0600)]
Move path2cstr to rustc_fs_util

5 years agoMove rustc::util::fs into separate (new) crate
Mark Rousskov [Fri, 3 Aug 2018 21:31:03 +0000 (15:31 -0600)]
Move rustc::util::fs into separate (new) crate

5 years agoMove SVH structure to data structures
Mark Rousskov [Fri, 3 Aug 2018 18:22:22 +0000 (12:22 -0600)]
Move SVH structure to data structures

5 years agoAdd individual docs for rotate_{left, right}
Andre Bogus [Wed, 8 Aug 2018 21:42:33 +0000 (23:42 +0200)]
Add individual docs for rotate_{left, right}

5 years agoDeny future duplication of rustc-ap-syntax
Alex Crichton [Thu, 9 Aug 2018 04:42:26 +0000 (21:42 -0700)]
Deny future duplication of rustc-ap-syntax

Enable the tidy check to forbid this!

Closes #53006

5 years agoA few cleanups for rustc_target
ljedrz [Thu, 9 Aug 2018 13:42:43 +0000 (15:42 +0200)]
A few cleanups for rustc_target

5 years ago[nll] libtest: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 13:22:45 +0000 (09:22 -0400)]
[nll] libtest: enable feature(nll) for bootstrap

5 years ago[nll] libsyntax: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 13:22:33 +0000 (09:22 -0400)]
[nll] libsyntax: enable feature(nll) for bootstrap

5 years ago[nll] libserialize: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 13:22:08 +0000 (09:22 -0400)]
[nll] libserialize: enable feature(nll) for bootstrap

5 years ago[nll] librustc_data_structures: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 13:21:23 +0000 (09:21 -0400)]
[nll] librustc_data_structures: enable feature(nll) for bootstrap