82631 Commits

Author SHA1 Message Date
Mark Mansi
3c3c642a05 Start working on a test 2018-08-24 15:48:00 -05:00
Mark Mansi
3e073ab111 fix compile error 2018-08-24 15:48:00 -05:00
Mark Mansi
d2dfc9cea3 Remove anon trait params from 2018 and beyond 2018-08-24 15:48:00 -05:00
bors
727eabd681 Auto merge of #53662 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #53311 (Window Mutex: Document that we properly initialize the SRWLock)
 - #53503 (Discourage overuse of mem::forget)
 - #53545 (Fix #50865: ICE on impl-trait returning functions reaching private items)
 - #53559 (add macro check for lint)
 - #53562 (Lament the invincibility of the Turbofish)
 - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())
 - #53592 (docs: minor stylistic changes to str/string docs)
 - #53594 (Update RELEASES.md to include clippy-preview)
 - #53600 (Fix a grammatical mistake in "expected generic arguments" errors)
 - #53614 (update nomicon and book)
 - #53617 (tidy: Stop requiring a license header)
 - #53618 (Add missing fmt examples)
 - #53636 (Prefer `.nth(n)` over `.skip(n).next()`.)
 - #53644 (Use SmallVec for SmallCStr)
 - #53664 (Remove unnecessary closure in rustc_mir/build/mod.rs)
 - #53666 (Added rustc_codegen_llvm to compiler documentation.)
2018-08-24 17:02:23 +00:00
kennytm
c6039de546
Rollup merge of #53666 - davidtwco:issue-51737, r=Mark-Simulacrum
Added rustc_codegen_llvm to compiler documentation.

Fixes #51737.
2018-08-24 23:27:57 +08:00
kennytm
a1ec2f76bb
Rollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov
Fix #50865: ICE on impl-trait returning functions reaching private items

Adds a test case as suggested in #50865, and implements @petrochenkov's suggestion. Fixes #50865.

Impl-trait-returning functions are marked under a new (low) access level, which they propagate rather than `AccessLevels::Reachable`. `AccessLevels::is_reachable` returns false for such items (leaving stability analysis unaffected), these items may still be visible to the lints phase however.
2018-08-24 23:27:16 +08:00
bors
61b0072707 Auto merge of #53044 - SergioBenitez:stable-attr-literals, r=petrochenkov
Stabilize 'attr_literals' feature.

RFC Issue: rust-lang/rfcs#1559
Tracking Issue: rust-lang/rust#34981

Reference PR: https://github.com/rust-lang-nursery/reference/pull/388.
2018-08-24 14:48:29 +00:00
kennytm
62f29c4fb8
Rollup merge of #53664 - IsaacWoods:fix_53608, r=oli-obk
Remove unnecessary closure in rustc_mir/build/mod.rs

Fixes #53608
2018-08-24 19:29:59 +08:00
kennytm
0009fad435
Rollup merge of #53644 - llogiq:smallvec-for-small-c-str, r=estebank
Use SmallVec for SmallCStr

This reuses the awesome optimizations from Servo's `SmallVec` to speed up `SmallCStr`.
2018-08-24 19:24:45 +08:00
kennytm
9dfb95b11f
Rollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppe
Prefer `.nth(n)` over `.skip(n).next()`.

Found by clippy.
2018-08-24 19:24:44 +08:00
kennytm
a37b69da9f
Rollup merge of #53618 - GuillaumeGomez:fmt-examples, r=QuietMisdreavus
Add missing fmt examples

r? @QuietMisdreavus
2018-08-24 19:24:42 +08:00
kennytm
cf90fd04dc
Rollup merge of #53617 - joshtriplett:tidy-no-license-header, r=Mark-Simulacrum
tidy: Stop requiring a license header

Previously approved in rust-lang/rust#43498 ; update tidy to match.
2018-08-24 19:24:40 +08:00
kennytm
ff4500c389
Rollup merge of #53614 - RalfJung:nomicon, r=kennytm
update nomicon and book
2018-08-24 19:24:38 +08:00
kennytm
7d990fa7cd
Rollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb
Fix a grammatical mistake in "expected generic arguments" errors

r? @eddyb
2018-08-24 19:24:37 +08:00
kennytm
3fbd72e66b
Rollup merge of #53594 - rust-lang:Aaronepower-patch-1, r=Mark-Simulacrum
Update RELEASES.md to include clippy-preview

[Rendered](https://github.com/rust-lang/rust/blob/Aaronepower-patch-1/RELEASES.md#misc)

r? @Mark-Simulacrum
2018-08-24 19:24:35 +08:00
kennytm
c51903c73e
Rollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton
docs: minor stylistic changes to str/string docs

std::string::String.repeat(): slightly rephrase to be more in-line with other descriptions.

add ticks around a few keywords in other descriptions.
2018-08-24 19:24:32 +08:00
bors
57e13babe9 Auto merge of #53653 - petrochenkov:moreregr, r=Mark-Simulacrum
Address two regressions

Remove assert checking that expansion data is immutable until I have time to investigate why it's firing, cc https://github.com/rust-lang/rust/issues/52363
Turn the error for module-relative access to macro-expanded `macro_export` macros into a deprecation lint, closes https://github.com/rust-lang/rust/issues/53495
2018-08-24 11:22:11 +00:00
David Wood
c802be6f30
Added rustc_codegen_llvm to compiler documentation. 2018-08-24 13:09:34 +02:00
Isaac Woods
b24a30e94d
Remove unnecessary closure in rustc_mir/build/mod.rs 2018-08-24 11:21:15 +01:00
kennytm
d13c61208a
Rollup merge of #53563 - matthiaskrgr:String, r=varkor
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()
2018-08-24 16:44:35 +08:00
kennytm
714e5b3c46
Rollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa
Lament the invincibility of the Turbofish

Here a test case is added to ensure that any others attempting to drive the Turbofish to extinction have second thoughts. Previously the [entire test suite would succeed](https://github.com/rust-lang/rust/pull/53511) if generic arguments were accepted without disambiguation, making for [confusing and heartbreaking circumstances](https://github.com/rust-lang/rfcs/pull/2527).
2018-08-24 16:44:34 +08:00
kennytm
7f396bad9e
Rollup merge of #53559 - Dylan-DPC:fix/missing-doc-lint, r=kennytm
add macro check for lint

Fixes #53537
2018-08-24 16:44:32 +08:00
kennytm
973428d522
Rollup merge of #53503 - kornelski:master, r=dtolnay
Discourage overuse of mem::forget

Some uses of `mem::forget` have been replaced by better methods of `Box`, so I've removed obsoleted use-cases from these docs.

I've removed emphasis on leaking, because it's not obvious `mem::forget` does not guarantee leaking of memory: memory of stack-allocated objects and values partially moved out of `Box` will still be freed. That's a potential error when used to pass objects to FFI, so it's better to direct users to `Box::into_raw` instead.
2018-08-24 16:44:31 +08:00
kennytm
ab5a71b034
Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998
Window Mutex: Document that we properly initialize the SRWLock

See https://github.com/rust-lang/rust/issues/35836
2018-08-24 16:44:30 +08:00
Sergio Benitez
ed0bd38cac Stabilize 'attr_literals' feature. 2018-08-23 19:06:07 -07:00
Vadim Petrochenkov
77f2a2fe35 Turn the error for module-relative access to macro-expanded macro_export macros into a deprecation lint 2018-08-24 02:51:41 +03:00
Vadim Petrochenkov
7a8b726811 Add a test for reset expansion info 2018-08-24 02:50:34 +03:00
Vadim Petrochenkov
6fdb400ff2 Revert "hygiene: Make sure expansion info is set at most once for a given Mark"
This reverts commit b15785b67133b5017f141d1fda1dd3dcf331b4b4.
2018-08-24 02:21:52 +03:00
bors
63d66494af Auto merge of #53638 - flip1995:clippy, r=nrc
Update clippy

r? @oli-obk @Manishearth
2018-08-23 22:52:29 +00:00
flip1995
cd8fcb6140
Update clippy again 2018-08-23 23:31:55 +02:00
Andre Bogus
25a83e3a88 Use SmallVec for SmallCStr 2018-08-23 23:13:14 +02:00
bors
5ce5e08606 Auto merge of #53588 - tristanburgess:52985_diagnostics_no_concrete_type_behind_existential_type, r=oli-obk
52985 diagnostics no concrete type behind existential type

@oli-obk FYI. See below for new cycle error generated.

```rust
error[E0391]: cycle detected when processing `Foo`
 --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:3:1
  |
3 | existential type Foo: Copy;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: ...which requires processing `bar`...
 --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:6:23
  |
6 |   fn bar(x: Foo) -> Foo {
  |  _______________________^
7 | |     x
8 | | }
  | |_^
  = note: ...which again requires processing `Foo`, completing the cycle

error: aborting due to previous error

For more information about this error, try `rustc --explain E0391`.
```
2018-08-23 20:34:12 +00:00
Guillaume Gomez
2cc2e01e04 Add missing fmt examples 2018-08-23 20:20:58 +02:00
dylan_DPC
747722e444 fix testcase 2018-08-23 23:21:54 +05:30
bors
54d82d0880 Auto merge of #53571 - MaloJaffre:vecdeque-emergency, r=RalfJung
Fix unsoundness for VecDeque

 See individual commit for more details.

r? @RalfJung.

Fixes https://github.com/rust-lang/rust/issues/53566, fixes https://github.com/rust-lang/rust/issues/53529
2018-08-23 17:13:44 +00:00
bors
e5284b0b57 Auto merge of #53384 - gootorov:use-servo-smallvec, r=michaelwoerister
Use optimized SmallVec implementation

This PR replaces current SmallVec implementation with the one from the Servo project.

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

r? @Mark-Simulacrum
2018-08-23 14:40:22 +00:00
Kornel
e7709b3d44 Discourage overuse of mem::forget 2018-08-23 15:01:28 +01:00
flip1995
65c0ebd8ab
Update clippy 2018-08-23 16:00:04 +02:00
Corey Farwell
9e0ff24b6d Prefer .nth(n) over .skip(n).next().
Found by clippy.
2018-08-23 09:35:49 -04:00
Kyle Simpson
85a05d1815 Light restructuring. 2018-08-23 13:12:53 +01:00
bors
35bf1ae257 Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakis
Implement try block expressions

I noticed that `try` wasn't a keyword yet in Rust 2018, so...

~~Fix​es https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135
cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412
2018-08-23 11:46:24 +00:00
bors
827e57c2f6 Auto merge of #53459 - petrochenkov:stabmore, r=nrc
Stabilize a few secondary macro features

- `tool_attributes` - closes https://github.com/rust-lang/rust/issues/44690
- `proc_macro_path_invoc` - this feature was created due to issues with tool attributes (https://github.com/rust-lang/rust/issues/51277), those issues are now fixed (https://github.com/rust-lang/rust/pull/52841)
- partially `proc_macro_gen` - this feature was created due to issue https://github.com/rust-lang/rust/issues/50504, the issue is now fixed (https://github.com/rust-lang/rust/pull/51952), so proc macros can generate modules. They still can't generate `macro_rules` items though due to unclear hygiene interactions.
2018-08-23 08:38:22 +00:00
Matthias Krüger
ede1f7d2a5 use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into() 2018-08-23 10:14:52 +02:00
Igor Gutorov
4d81fe9243 Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
bors
c648b0bb2b Auto merge of #53235 - varkor:gat_impl_where, r=estebank
Feature gate where clauses on associated type impls

Fixes #52913. This doesn't address the core problem, which is tracked by https://github.com/rust-lang/rust/issues/47206. However, it fixes the stable-to-stable regression: you now have to enable `#![feature(generic_associated_types)]` to trigger the weird behaviour.
2018-08-23 06:34:11 +00:00
bors
e73077e106 Auto merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikomatsakis
Merge `IdxSet` and `IdxSetBuf`

Because it simplifies things.

@r? nikomatsakis
2018-08-23 02:54:24 +00:00
Tristan Burgess
7440125d62 52985: formatting PR files 2018-08-22 18:57:10 -04:00
Tristan Burgess
3045ffa512 52985: better cycle error for existential types
- Original cycle error diagnostics PR'd against this issue caught
panic-causing error while resolving std::mem::transmute calls
  - Now, catch invalid use case of not providing a concrete sized type
behind existential type in definining use case.
  - Update relevant test to reflect this new error

52985: revert normalize query changes
      - PR 53588 invalidates 53316, causing a correct cycle error to occur
    with a good span.
      - Don't need to revert the whole merge as the test files are
    still fine, just need to revert the normalize query changes.
      - It should now be correct that infinite recursion detected during
    normalize query type folding is a bug, should have been caught earlier
    (when resolving the existential type's defining use cases).

52985: code review impl
  - Only cause cycle error if anonymous type resolves to anonymous type
that has the same def id (is the same type) as the original (parent)
type.
  - Add test case to cover this case for existential types.

52985: remove Ty prefix from TyAnon
  - To align with changes per commit 6f637da50c56a22f745fd056691da8c86824cd9b
2018-08-22 18:56:16 -04:00
varkor
b188c2a4eb Lament the invincibility of the Turbofish 2018-08-22 23:25:28 +01:00
Josh Triplett
a15b61780b tidy: Stop requiring a license header
Previously approved in rust-lang/rust#43498 ; update tidy to match.
2018-08-22 15:18:45 -07:00