]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoMake assigning to the return type interesting
Matthew Jasper [Tue, 7 Aug 2018 20:17:59 +0000 (21:17 +0100)]
Make assigning to the return type interesting

5 years agoAuto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz
bors [Tue, 14 Aug 2018 15:09:37 +0000 (15:09 +0000)]
Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz

Move SmallVector and ThinVec out of libsyntax

- move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec`
- remove `libsyntax::util::SmallVector`
- move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec`

Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.

5 years agoAuto merge of #53196 - davidtwco:compile-fail-to-ui, r=nikomatsakis
bors [Tue, 14 Aug 2018 12:55:23 +0000 (12:55 +0000)]
Auto merge of #53196 - davidtwco:compile-fail-to-ui, r=nikomatsakis

Move `compile-fail` tests to `ui`

Fixes #46841, #52531, #44844.

r? @nikomatsakis

5 years agoAuto merge of #53335 - eddyb:issue-53333, r=petrochenkov
bors [Tue, 14 Aug 2018 10:41:55 +0000 (10:41 +0000)]
Auto merge of #53335 - eddyb:issue-53333, r=petrochenkov

rustc_resolve: crates only exist in the type namespace.

Fixes #53333 by resolving `::crate_name` in `TypeNS` alone, which was overlooked in #52923 and didn't break tests, since having `use crate_name;` and a `crate_name` value in the same scope is rare.

5 years agoMoved problematic tests on x86_64-gnu-nopt back to compile-fail.
David Wood [Tue, 14 Aug 2018 09:11:58 +0000 (11:11 +0200)]
Moved problematic tests on x86_64-gnu-nopt back to compile-fail.

5 years agoMoved problematic tests on x86_64-pc-windows-gnu back to compile-fail.
David Wood [Mon, 13 Aug 2018 22:38:05 +0000 (00:38 +0200)]
Moved problematic tests on x86_64-pc-windows-gnu back to compile-fail.

5 years agoMoved problematic tests on armhf-gnu back to compile-fail.
David Wood [Mon, 13 Aug 2018 17:23:51 +0000 (19:23 +0200)]
Moved problematic tests on armhf-gnu back to compile-fail.

5 years agoMoved problematic tests on wasm32-unknown back to compile-fail.
David Wood [Mon, 13 Aug 2018 15:12:20 +0000 (17:12 +0200)]
Moved problematic tests on wasm32-unknown back to compile-fail.

5 years agoMoved problematic tests on dist-x86_64-musl back to compile-fail.
David Wood [Mon, 13 Aug 2018 09:56:01 +0000 (11:56 +0200)]
Moved problematic tests on dist-x86_64-musl back to compile-fail.

5 years agoMoved problematic tests on i586-unknown-linux-gnu back to compile-fail.
David Wood [Fri, 10 Aug 2018 23:51:17 +0000 (01:51 +0200)]
Moved problematic tests on i586-unknown-linux-gnu back to compile-fail.

5 years agoNormalize tests for i686 Windows.
David Wood [Fri, 10 Aug 2018 21:46:59 +0000 (22:46 +0100)]
Normalize tests for i686 Windows.

5 years agoFixed 'no such file or directory' mismatch between Windows and Linux.
David Wood [Fri, 10 Aug 2018 10:27:46 +0000 (12:27 +0200)]
Fixed 'no such file or directory' mismatch between Windows and Linux.

5 years agoMoved problematic tests on Windows back to compile-fail.
David Wood [Fri, 10 Aug 2018 10:17:49 +0000 (12:17 +0200)]
Moved problematic tests on Windows back to compile-fail.

5 years agoMoved tests back to compile-test if they don't work on ui.
David Wood [Thu, 9 Aug 2018 16:11:35 +0000 (18:11 +0200)]
Moved tests back to compile-test if they don't work on ui.

5 years agoFix no-link-with-link-args by introducing another normalization.
David Wood [Thu, 9 Aug 2018 15:17:20 +0000 (17:17 +0200)]
Fix no-link-with-link-args by introducing another normalization.

5 years agoNormalize crateresolve1.rs to support different candidate ordering between executions.
David Wood [Thu, 9 Aug 2018 14:19:11 +0000 (16:19 +0200)]
Normalize crateresolve1.rs to support different candidate ordering between executions.

5 years agoSuggested trait implementation ordering is now deterministic.
David Wood [Thu, 9 Aug 2018 12:37:27 +0000 (14:37 +0200)]
Suggested trait implementation ordering is now deterministic.

5 years agoFixed truncated path not being normalized.
David Wood [Thu, 9 Aug 2018 10:48:31 +0000 (12:48 +0200)]
Fixed truncated path not being normalized.

5 years agoNormalize test build directory and root build directory.
David Wood [Thu, 9 Aug 2018 08:58:16 +0000 (10:58 +0200)]
Normalize test build directory and root build directory.

5 years agoTidy no longer fails when there are no files or subdirectories in a test directory.
David Wood [Wed, 8 Aug 2018 19:37:58 +0000 (21:37 +0200)]
Tidy no longer fails when there are no files or subdirectories in a test directory.

5 years agoMerged migrated compile-fail tests and ui tests. Fixes #46841.
David Wood [Wed, 8 Aug 2018 12:50:16 +0000 (14:50 +0200)]
Merged migrated compile-fail tests and ui tests. Fixes #46841.

5 years agoUpdated new UI tests to pass with NLL compare-mode
David Wood [Wed, 8 Aug 2018 16:01:04 +0000 (18:01 +0200)]
Updated new UI tests to pass with NLL compare-mode

These tests need a review to ensure that those marked as
ignore-compare-mode-nll should be ignored and that this isn't a bug in NLL.

5 years agoMoved compile-fail tests to ui tests.
David Wood [Wed, 8 Aug 2018 12:28:26 +0000 (14:28 +0200)]
Moved compile-fail tests to ui tests.

5 years agoCheck error-patterns on UI tests. Fixes #52531.
David Wood [Wed, 8 Aug 2018 11:31:42 +0000 (13:31 +0200)]
Check error-patterns on UI tests. Fixes #52531.

Previously, even if no expected errors were supplied, if a test execution failed
then supplied error patterns would not be checked. This commit modifies the
conditional that determines whether error patterns or expected errors are checked
to remedy this.

Further, this commit modifies the error pattern checking logic so that each pattern
is checked against all lines of the string. This is required for UI tests as the
stderr is in JSON format - all on one line - so in the previous implementation when the
first pattern was found on the first line (which was actually the entire error) then
no other patterns would be found on subsequent lines (as there weren't any).

5 years agoAuto merge of #53033 - RalfJung:manually_dro, r=SimonSapin
bors [Tue, 14 Aug 2018 08:32:59 +0000 (08:32 +0000)]
Auto merge of #53033 - RalfJung:manually_dro, r=SimonSapin

unsized ManuallyDrop

I think this matches what @eddyb had in https://github.com/rust-lang/rust/pull/52711 originally.

~~However, I have never added a `CoerceUnsized` before so I am not sure if I did this right. I copied the `unstable` attribute on the `impl` from elsewhere, but AFAIK it is useless because `impl`'s are insta-stable... so shouldn't this rather say "stable since 1.30"?~~

This is insta-stable and hence requires FCP, at least.

Fixes https://github.com/rust-lang/rust/issues/47034

5 years agorustc_resolve: crates only exist in the type namespace.
Eduard-Mihai Burtescu [Tue, 14 Aug 2018 08:26:44 +0000 (11:26 +0300)]
rustc_resolve: crates only exist in the type namespace.

5 years agoAuto merge of #52895 - draganmladjenovic:minmax_qnan, r=alexcrichton
bors [Tue, 14 Aug 2018 06:31:10 +0000 (06:31 +0000)]
Auto merge of #52895 - draganmladjenovic:minmax_qnan, r=alexcrichton

run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips

Workaround for #52746.
r? @gnzlbg

5 years agoAuto merge of #52923 - eddyb:relative-imports, r=petrochenkov
bors [Tue, 14 Aug 2018 04:22:14 +0000 (04:22 +0000)]
Auto merge of #52923 - eddyb:relative-imports, r=petrochenkov

#[feature(uniform_paths)]: allow `use x::y;` to resolve through `self::x`, not just `::x`.

_Branch originally by @cramertj, based on @petrochenkov's [description on the internals forum](https://internals.rust-lang.org/t/relative-paths-in-rust-2018/7883/30?u=petrochenkov)._
_(note, however, that the approach has significantly changed since)_

Implements `#[feature(uniform_paths)]` from #53130, by treating unqualified `use` paths as maybe-relative. That is, `use x::y;`, where `x` is a plain identifier (not a keyword), is no longer the same as `use ::x::y;`, and before picking an external crate named `x`, it first looks for an item named `x` in the same module (i.e. `self::x`) and prefers that local item instead.

Such a "maybe-relative" `x` can only resolve to an external crate if it's listed in "`extern_prelude`" (i.e. `core` / `std` and all the crates passed to `--extern`; the latter includes Cargo dependencies) - this is the same condition as being able to refer to the external crate from an unqualified, non-`use` path.
All other crates must be explicitly imported with an absolute path, e.g. `use ::x::y;`

To detect an ambiguity between the external crate and the local item with the same name, a "canary" import (e.g. `use self::x as _;`), tagged with the `is_uniform_paths_canary` flag, is injected. As the initial implementation is not sophisticated enough to handle all possible ways in which `self::x` could appear (e.g. from macro expansion), this also guards against accidentally picking the external crate, when it might actually get "shadowed" later.
Also, more canaries are injected for each block scope around the `use`, as `self::x` cannot resolve to any items named `x` in those scopes, but non-`use` paths can, and that could be confusing or even backwards-incompatible.

Errors are emitted only if the main "canary" import succeeds while an external crate exists (or if any of the block-scoped ones succeed at all), and ambiguities have custom error reporting, e.g.:
```rust
#![feature(uniform_paths)]
pub mod foo {
    use std::io;
    pub mod std { pub mod io {} }
}
```
```rust
error: import from `std` is ambiguous
 --> test.rs:3:9
  |
3 |     use std::io;
  |         ^^^ could refer to external crate `::std`
4 |     pub mod std { pub mod io {} }
  |     ----------------------------- could also refer to `self::std`
  |
  = help: write `::std` or `self::std` explicitly instead
  = note: relative `use` paths enabled by `#![feature(uniform_paths)]`
```
Another example, this time with a block-scoped item shadowing a module-scoped one:
```rust
#![feature(uniform_paths)]
enum Foo { A, B }
fn main() {
    enum Foo {}
    use Foo::*;
}
```
```rust
error: import from `Foo` is ambiguous
 --> test.rs:5:9
  |
4 |     enum Foo {}
  |     ----------- shadowed by block-scoped `Foo`
5 |     use Foo::*;
  |         ^^^
  |
  = help: write `::Foo` or `self::Foo` explicitly instead
  = note: relative `use` paths enabled by `#![feature(uniform_paths)]`
```

Additionally, this PR, because replacing "the `finalize_import` hack" was a blocker:
* fixes #52140
* fixes #52141
* fixes #52705

cc @aturon @joshtriplett

5 years agorustc_resolve: also inject canaries to detect block scopes shadowing `uniform_paths...
Eduard-Mihai Burtescu [Mon, 13 Aug 2018 15:24:08 +0000 (18:24 +0300)]
rustc_resolve: also inject canaries to detect block scopes shadowing `uniform_paths` imports.

5 years agorustc_resolve: inject ambiguity "canaries" when #![feature(uniform_paths)] is enabled.
Eduard-Mihai Burtescu [Sat, 11 Aug 2018 08:13:57 +0000 (11:13 +0300)]
rustc_resolve: inject ambiguity "canaries" when #![feature(uniform_paths)] is enabled.

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 agoMove SmallVec and ThinVec out of libsyntax
ljedrz [Sun, 5 Aug 2018 10:04:56 +0000 (12:04 +0200)]
Move SmallVec and ThinVec out of libsyntax

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.