]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 agoAuto merge of #53031 - michaelwoerister:cross-lto, r=alexcrichton
bors [Thu, 9 Aug 2018 13:20:14 +0000 (13:20 +0000)]
Auto merge of #53031 - michaelwoerister:cross-lto, r=alexcrichton

Apply some fixes to cross-language LTO (especially when targeting MSVC)

This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.

r? @alexcrichton

5 years ago[nll] libunwind: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:52:12 +0000 (06:52 -0400)]
[nll] libunwind: enable feature(nll) for bootstrap

5 years ago[nll] libterm: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:51:56 +0000 (06:51 -0400)]
[nll] libterm: enable feature(nll) for bootstrap

5 years ago[nll] libsyntax_pos: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:51:42 +0000 (06:51 -0400)]
[nll] libsyntax_pos: enable feature(nll) for bootstrap

5 years ago[nll] librustc_target: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:51:13 +0000 (06:51 -0400)]
[nll] librustc_target: enable feature(nll) for bootstrap

5 years ago[nll] librustc_incremental: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:50:57 +0000 (06:50 -0400)]
[nll] librustc_incremental: enable feature(nll) for bootstrap

5 years ago[nll] librustc_driver: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:50:40 +0000 (06:50 -0400)]
[nll] librustc_driver: enable feature(nll) for bootstrap

5 years ago[nll] librustc_cratesio_shim: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:50:25 +0000 (06:50 -0400)]
[nll] librustc_cratesio_shim: enable feature(nll) for bootstrap

5 years ago[nll] librustc_apfloat: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:49:31 +0000 (06:49 -0400)]
[nll] librustc_apfloat: enable feature(nll) for bootstrap

5 years ago[nll] libpanic_unwind: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:49:12 +0000 (06:49 -0400)]
[nll] libpanic_unwind: enable feature(nll) for bootstrap

5 years ago[nll] libpanic_abort: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:48:53 +0000 (06:48 -0400)]
[nll] libpanic_abort: enable feature(nll) for bootstrap

5 years ago[nll] libfmt_macros: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 10:48:10 +0000 (06:48 -0400)]
[nll] libfmt_macros: enable feature(nll) for bootstrap

5 years agoUpdated tests after rebase.
David Wood [Thu, 9 Aug 2018 10:03:20 +0000 (12:03 +0200)]
Updated tests after rebase.

5 years agoinline some short functions
M Farkas-Dyck [Thu, 9 Aug 2018 09:27:48 +0000 (01:27 -0800)]
inline some short functions

5 years agoRollup merge of #53116 - jakllsch:netbsd-unsigned-char, r=alexcrichton
kennytm [Thu, 9 Aug 2018 08:58:44 +0000 (16:58 +0800)]
Rollup merge of #53116 - jakllsch:netbsd-unsigned-char, r=alexcrichton

NetBSD: fix signedess of char

5 years agoRollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
kennytm [Thu, 9 Aug 2018 08:58:42 +0000 (16:58 +0800)]
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc

Account for --remap-path-prefix in save-analysis

Fixes #52549.

Didn't add a test since save-analysis is still unstable, only tested this locally. Should I add a test for that? If so, is run-make-fulldeps an appropriate format?

Session is already created with remapped working directory, so use that instead of the actual cwd.
This was the only place affected, since the rest of the paths in save-analysis are directly derived from files in spans from `sess.codemap()`, which already creates remapped ones.

r? @nrc

5 years agoRollup merge of #53094 - GuillaumeGomez:automatic-expand, r=nrc
kennytm [Thu, 9 Aug 2018 08:58:41 +0000 (16:58 +0800)]
Rollup merge of #53094 - GuillaumeGomez:automatic-expand, r=nrc

Automatically expand section if url id point to one of its component

Fixes #52517.

r? @nrc

5 years agoRollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakis
kennytm [Thu, 9 Aug 2018 08:58:39 +0000 (16:58 +0800)]
Rollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakis

Avoid unnecessary pattern matching against Option and Result

5 years agoFallback to 'has type' error messages rather than 'lifetime appears in type'.
David Wood [Mon, 6 Aug 2018 21:09:36 +0000 (23:09 +0200)]
Fallback to 'has type' error messages rather than 'lifetime appears in type'.

5 years agoCorrectly identify named early bound regions.
David Wood [Mon, 6 Aug 2018 19:15:15 +0000 (21:15 +0200)]
Correctly identify named early bound regions.

5 years ago[nll] librustc_tsan: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:11:06 +0000 (04:11 -0400)]
[nll] librustc_tsan: enable feature(nll) for bootstrap

5 years ago[nll] librustc_traits: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:10:46 +0000 (04:10 -0400)]
[nll] librustc_traits: enable feature(nll) for bootstrap

5 years ago[nll] librustc_save_analysis: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:10:26 +0000 (04:10 -0400)]
[nll] librustc_save_analysis: enable feature(nll) for bootstrap

5 years ago[nll] librustc_resolve: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:10:08 +0000 (04:10 -0400)]
[nll] librustc_resolve: enable feature(nll) for bootstrap

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

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

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

5 years ago[nll] librustc_errors: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:08:45 +0000 (04:08 -0400)]
[nll] librustc_errors: enable feature(nll) for bootstrap

5 years ago[nll] librustc_asan: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:08:17 +0000 (04:08 -0400)]
[nll] librustc_asan: enable feature(nll) for bootstrap

5 years ago[nll] libarena: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 08:07:59 +0000 (04:07 -0400)]
[nll] libarena: enable feature(nll) for bootstrap

5 years agoUse Cow<str> in describe_num_args
ljedrz [Thu, 9 Aug 2018 07:58:36 +0000 (09:58 +0200)]
Use Cow<str> in describe_num_args

5 years agoRelax the target-cpu-on-function codegen test so it just checks for presence of the...
Michael Woerister [Thu, 9 Aug 2018 07:39:02 +0000 (09:39 +0200)]
Relax the target-cpu-on-function codegen test so it just checks for presence of the attribute.

5 years agoAuto merge of #53108 - RalfJung:mutex, r=alexcrichton
bors [Thu, 9 Aug 2018 07:30:14 +0000 (07:30 +0000)]
Auto merge of #53108 - RalfJung:mutex, r=alexcrichton

clarify partially initialized Mutex issues

Using a `sys_common::mutex::Mutex` without calling `init` is dangerous, and yet there are some places that do this. I tried to find all of them and add an appropriate comment about reentrancy.

I found two places where (I think) reentrancy can actually occur, and was not able to come up with an argument for why this is okay. Someone who knows `io::lazy` and/or `sys_common::at_exit_imp` should have a careful look at this.

5 years agoRefactor expand_preparsed_format_args
ljedrz [Wed, 8 Aug 2018 16:59:59 +0000 (18:59 +0200)]
Refactor expand_preparsed_format_args

5 years agoliballoc: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:50:49 +0000 (01:50 -0400)]
liballoc: enable feature(nll) for bootstrap

5 years agoliballoc_jemalloc: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:50:37 +0000 (01:50 -0400)]
liballoc_jemalloc: enable feature(nll) for bootstrap

5 years agoliballoc_system: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:50:22 +0000 (01:50 -0400)]
liballoc_system: enable feature(nll) for bootstrap

5 years agolibgraphviz: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:50:08 +0000 (01:50 -0400)]
libgraphviz: enable feature(nll) for bootstrap

5 years agolibrustc_borrowck: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:49:46 +0000 (01:49 -0400)]
librustc_borrowck: enable feature(nll) for bootstrap

5 years agolibrustc_lint: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:49:25 +0000 (01:49 -0400)]
librustc_lint: enable feature(nll) for bootstrap

5 years agolibrustc_metadata: enable feature(nll) for bootstrap
memoryruins [Thu, 9 Aug 2018 05:49:07 +0000 (01:49 -0400)]
librustc_metadata: enable feature(nll) for bootstrap

5 years agoAuto merge of #53100 - VPashkov:issue-52456-improper_ctypes, r=eddyb
bors [Thu, 9 Aug 2018 01:38:13 +0000 (01:38 +0000)]
Auto merge of #53100 - VPashkov:issue-52456-improper_ctypes, r=eddyb

Fix improper_ctypes lint for individual foreign items

Fixes #52456.

r? @eddyb

5 years agoAuto merge of #53186 - mikhail-m1:master, r=nikomatsakis
bors [Wed, 8 Aug 2018 23:30:12 +0000 (23:30 +0000)]
Auto merge of #53186 - mikhail-m1:master, r=nikomatsakis

Fixes #53119.

Fixes #53119.

I minimized sample little bit more, but I checked the sample from issue too.
r? @nikomatsakis

5 years agoupdate target-feature-gate.stderr output
gnzlbg [Wed, 8 Aug 2018 22:56:30 +0000 (00:56 +0200)]
update target-feature-gate.stderr output

5 years agoAuto merge of #53163 - oli-obk:const_prop_ice, r=nikomatsakis
bors [Wed, 8 Aug 2018 20:16:25 +0000 (20:16 +0000)]
Auto merge of #53163 - oli-obk:const_prop_ice, r=nikomatsakis

Remove an overly pedantic and wrong assertion

fixes #53157
fixes #53087

5 years agoadd comment
Niko Matsakis [Wed, 8 Aug 2018 18:36:40 +0000 (14:36 -0400)]
add comment

5 years agomissed one
Ralf Jung [Wed, 8 Aug 2018 16:14:06 +0000 (18:14 +0200)]
missed one

5 years agoavoid using the word 'initialized' to talk about that non-reentrant-capable state...
Ralf Jung [Wed, 8 Aug 2018 16:12:33 +0000 (18:12 +0200)]
avoid using the word 'initialized' to talk about that non-reentrant-capable state of the mutex

5 years agoAuto merge of #53192 - oli-obk:clippyup, r=kennytm
bors [Wed, 8 Aug 2018 15:10:34 +0000 (15:10 +0000)]
Auto merge of #53192 - oli-obk:clippyup, r=kennytm

Update clippy submodule

r? @kennytm

fixes breakage from https://github.com/rust-lang/rust/pull/53053#issuecomment-411364171

5 years agoAuto merge of #53088 - matthewjasper:closure-region-spans, r=nikomatsakis
bors [Wed, 8 Aug 2018 12:48:32 +0000 (12:48 +0000)]
Auto merge of #53088 - matthewjasper:closure-region-spans, r=nikomatsakis

[NLL] Use span of the closure args in free region errors

Also adds a note when one of the free regions is BrEnv.
In a future PR I'll change these messages to say "return requires", which should improve them a bit more.

r? @nikomatsakis

5 years agoAddress review comments for #53031 and fix some merge fallout.
Michael Woerister [Mon, 6 Aug 2018 09:16:28 +0000 (11:16 +0200)]
Address review comments for #53031 and fix some merge fallout.

5 years agoUpdate clippy submodule
Oliver Schneider [Wed, 8 Aug 2018 11:19:30 +0000 (13:19 +0200)]
Update clippy submodule

5 years agoAuto merge of #52872 - faern:use-modern-alignment-libc, r=TimNN
bors [Wed, 8 Aug 2018 10:42:04 +0000 (10:42 +0000)]
Auto merge of #52872 - faern:use-modern-alignment-libc, r=TimNN

Make IpvXAddr::new const fns and the well known addresses associated constants

Implements/fixes https://github.com/rust-lang/rust/issues/44582

I just got a PR towards libc (https://github.com/rust-lang/libc/pull/1044) merged. With the new feature added in that PR it is now possible to create `in6_addr` instances as consts. This enables us to finally make the constructors of the IP structs const fns and to make the localhost/unspecified addresses associated constants, as agreed in the above mentioned tracking issue.

I also added a BROADCAST constant. Personally this is the well known address I tend to need the most often.

5 years agoUse repr(align(x)) for redox in6_addr
Linus Färnstrand [Wed, 8 Aug 2018 07:57:40 +0000 (09:57 +0200)]
Use repr(align(x)) for redox in6_addr

5 years agoUpdate libc to 0.2.43 in Cargo.lock
Linus Färnstrand [Tue, 7 Aug 2018 20:33:22 +0000 (22:33 +0200)]
Update libc to 0.2.43 in Cargo.lock

5 years agoSimplify Ipv6Addr::from(octets) to not use unsafe
Linus Färnstrand [Mon, 6 Aug 2018 13:51:11 +0000 (15:51 +0200)]
Simplify Ipv6Addr::from(octets) to not use unsafe

5 years agoSimplify is_broadcast
Linus Färnstrand [Sun, 29 Jul 2018 20:35:31 +0000 (22:35 +0200)]
Simplify is_broadcast

5 years agoAdd Ipv4Addr BROADCAST assoc const
Linus Färnstrand [Sun, 29 Jul 2018 20:24:19 +0000 (22:24 +0200)]
Add Ipv4Addr BROADCAST assoc const

5 years agoMove IPs to assoc consts
Linus Färnstrand [Fri, 20 Jul 2018 07:09:48 +0000 (09:09 +0200)]
Move IPs to assoc consts

5 years agoMake Ipv{4,6}Addr::new const fns
Linus Färnstrand [Thu, 19 Jul 2018 23:14:56 +0000 (01:14 +0200)]
Make Ipv{4,6}Addr::new const fns

5 years agoUpdate libc and activate align feature
Linus Färnstrand [Tue, 17 Jul 2018 18:15:58 +0000 (20:15 +0200)]
Update libc and activate align feature

5 years agoAuto merge of #53053 - petrochenkov:custattr, r=alexcrichton
bors [Wed, 8 Aug 2018 08:37:56 +0000 (08:37 +0000)]
Auto merge of #53053 - petrochenkov:custattr, r=alexcrichton

resolve:  Support custom attributes when macro modularization is enabled

Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute.

Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`).
Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it).

The first two commits are preliminary cleanups/refactorings.

5 years agoFixes #53119.
Mikhail Modin [Wed, 8 Aug 2018 07:02:47 +0000 (08:02 +0100)]
Fixes #53119.

5 years agoAuto merge of #53141 - nrc:update, r=nrc
bors [Wed, 8 Aug 2018 06:38:13 +0000 (06:38 +0000)]
Auto merge of #53141 - nrc:update, r=nrc

Update RLS, Rustfmt, and Clippy

Fixes bustage due to https://github.com/rust-lang/rust/pull/52332

r? @kennytm

5 years agoPrevent duplication of rust-ap-syntax
Nick Cameron [Wed, 8 Aug 2018 06:09:36 +0000 (18:09 +1200)]
Prevent duplication of rust-ap-syntax

author: alexcrichton

5 years agoUpdate RLS and Rustfmt
Nick Cameron [Mon, 6 Aug 2018 23:47:58 +0000 (11:47 +1200)]
Update RLS and Rustfmt

5 years agoSuggest comma when missing in macro call
Esteban Küber [Wed, 8 Aug 2018 05:28:09 +0000 (22:28 -0700)]
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.

5 years agoAuto merge of #52993 - alexcrichton:fix-some-vis, r=michaelwoerister
bors [Wed, 8 Aug 2018 01:24:15 +0000 (01:24 +0000)]
Auto merge of #52993 - alexcrichton:fix-some-vis, r=michaelwoerister

rustc: Tweak visibility of some lang items

This commit tweaks the linker-level visibility of some lang items that rustc
uses and defines. Notably this means that `#[panic_implementation]` and
`#[alloc_error_handler]` functions are never marked as `internal`. It's up to
the linker to eliminate these, not rustc.

Additionally `#[global_allocator]` generated symbols are no longer forced to
`Default` visibility (fully exported), but rather they're relaxed to `Hidden`
visibility). This symbols are *not* needed across DLL boundaries, only as a
local implementation detail of the compiler-injected allocator symbols, so
`Hidden` should suffice.

Closes #51342
Closes #52795

5 years agoadd feature-gate test
gnzlbg [Wed, 8 Aug 2018 00:10:06 +0000 (02:10 +0200)]
add feature-gate test

5 years agoadd wasm_target_feature feature gate
gnzlbg [Tue, 7 Aug 2018 23:43:00 +0000 (01:43 +0200)]
add wasm_target_feature feature gate

5 years agoAdd wasm32 simd128 target feature
gnzlbg [Tue, 7 Aug 2018 23:39:52 +0000 (01:39 +0200)]
Add wasm32 simd128 target feature

5 years agoAdd and update tests for `IndexMut` help message
Lukas Kalbertodt [Tue, 7 Aug 2018 21:09:08 +0000 (23:09 +0200)]
Add and update tests for `IndexMut` help message

5 years agoAuto merge of #52397 - estebank:println-comma, r=oli-obk
bors [Tue, 7 Aug 2018 22:15:25 +0000 (22:15 +0000)]
Auto merge of #52397 - estebank:println-comma, r=oli-obk

Suggest comma when writing `println!("{}" a);`

Fix #49370.