Commit Graph

66763 Commits

Author SHA1 Message Date
Guillaume Gomez
16a189863c Rollup merge of #43993 - tamird:better-wording-error, r=arielb1
borrowck: name the correct type in error message

Closes #36407.

r? @Mark-Simulacrum
2017-08-22 13:36:17 +02:00
bors
7e5578da8c Auto merge of #44003 - LukasKalbertodt:patch-1, r=nikomatsakis
Add PartialEq/Eq impls to proc_macro::{Spacing, Delimiter}

I don't see a reason why those two types shouldn't be tested for equality. But I hardly know anything about proc macros, so I'm probably wrong :)
2017-08-22 08:32:14 +00:00
bors
6722996923 Auto merge of #43854 - estebank:missing-cond, r=nikomatsakis
Point out missing if conditional

On a case where an else conditional is missing, point this out
instead of the token immediately after the (incorrect) else block:

```
error: missing condition for `if` statemementt push fork -f

  --> $DIR/issue-13483.rs:16:5
   |
13 |    } else if {
   |             ^ expected if condition here
```

instead of

```
error: expected `{`, found `else`
  --> ../../src/test/ui/issue-13483.rs:14:7
   |
14 |     } else {
   |       ^^^^
```

Fix #13483.
2017-08-22 04:28:49 +00:00
bors
942711e115 Auto merge of #43690 - scalexm:issue-28229, r=nikomatsakis
Generate builtin impls for `Clone`

This fixes a long-standing ICE and limitation where some builtin types implement `Copy` but not `Clone` (whereas `Clone` is a super trait of `Copy`).

However, this PR has a few side-effects:
* `Clone` is now marked as a lang item.
* `[T; N]` is now `Clone` if `T: Clone` (currently, only if `T: Copy` and for `N <= 32`).
* `fn foo<'a>() where &'a mut (): Clone { }` won't compile anymore because of how bounds for builtin traits are handled (e.g. same thing currently if you replace `Clone` by `Copy` in this example). Of course this function is unusable anyway, an error would pop as soon as it is called.

Hence, I'm wondering wether this PR would need an RFC...
Also, cc-ing @nikomatsakis, @arielb1.

Related issues: #28229, #24000.
2017-08-22 01:34:54 +00:00
bors
8df670b6a6 Auto merge of #43540 - petrochenkov:pathrelax, r=nikomatsakis
syntax: Relax path grammar

TLDR: Accept the disambiguator `::` in "type" paths (`Type::<Args>`), accept the disambiguator `::` before parenthesized generic arguments (`Fn::(Args)`).

The "turbofish" disambiguator `::<>` in expression paths is a necessary evil required for path parsing to be both simple and to give reasonable results.
Since paths in expressions usually refer to values (but not necessarily, e.g. `Struct::<u8> { field: 0 }` is disambiguated, but refers to a type), people often consider `::<>` to be inherent to *values*, and not *expressions* and want to write disambiguated paths for values even in contexts where disambiguation is not strictly necessary, for example when a path is passed to a macro `m!(Vec::<i32>::new)`.
The problem is that currently, if the disambiguator is not *required*, then it's *prohibited*. This results in confusion - see https://github.com/rust-lang/rust/issues/41740, https://internals.rust-lang.org/t/macro-path-uses-novel-syntax/5561.

This PR makes the disambiguator *optional* instead of prohibited in contexts where it's not strictly required, so people can pass paths to macros in whatever form they consider natural (e.g. disambiguated form for value paths).
This PR also accepts the disambiguator in paths with parenthesized arguments (`Fn::(Args)`) for consistency and to simplify testing of stuff like https://github.com/rust-lang/rust/pull/41856#issuecomment-301219194.

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

cc @rust-lang/lang
r? @nikomatsakis
2017-08-21 23:03:57 +00:00
bors
4fdb4bedfd Auto merge of #44009 - pnkfelix:mir-borrowck-as-query, r=arielb1
Mir borrowck as query

Turn the `mir-borrowck` pass (aka "transform") into a query.

(If I had realized how relatively easy this was going to be, I would have made it part of #43108. `let hindsight = 20/20;`)
2017-08-21 20:16:21 +00:00
bors
80be2f8697 Auto merge of #43971 - alexcrichton:lint-statements, r=michaelwoerister
rustc: Add `Local` to the HIR map of parents

When walking parents for lints we want to be sure to hit `let` statements which
can have attributes, so hook up these statements in the HIR map.

Closes #43910
2017-08-21 17:38:26 +00:00
Felix S. Klock II
224c6ca2ee Moved support code for rustc_mir::borrow_check query out of mod transform. 2017-08-21 13:10:13 +02:00
Felix S. Klock II
c280afcc1c Remove the rustc_mir::transform entry point for mir-borrowck. 2017-08-21 12:49:18 +02:00
Felix S. Klock II
4da2a88abc Expose mir-borrowck via a query.
(A followup commit removes the mir::transform based entry point.)
2017-08-21 12:49:18 +02:00
bors
757b7ac2ab Auto merge of #43986 - petrochenkov:pubcrate3, r=pnkfelix
rustc: Remove some dead code

Extracted from https://github.com/rust-lang/rust/pull/43192

r? @eddyb
2017-08-21 08:14:17 +00:00
bors
06bf94a129 Auto merge of #43929 - oli-obk:use_placement, r=nrc
Improve placement of `use` suggestions

r? @nrc

cc @estebank @Mark-Simulacrum

fixes #42835
fixes #42548
fixes #43769
2017-08-21 05:18:03 +00:00
bors
cf56cf360e Auto merge of #44004 - frewsxcv:frewsxcv-bors-docs, r=Mark-Simulacrum
Fix broken homu link in CONTRIBUTING.md.

Fixes the docs aspect of https://github.com/rust-lang/rust/issues/43898.
2017-08-21 01:27:00 +00:00
Corey Farwell
c7cd79b58f Fix broken homu link in CONTRIBUTING.md.
Fixes the docs aspect of https://github.com/rust-lang/rust/issues/43898.
2017-08-20 21:24:14 -04:00
Tamir Duberstein
c1ed862bc4
borrowck: name the correct type in error message
Closes #36407.
2017-08-20 18:31:36 -04:00
Lukas Kalbertodt
4ba242b7e0 Add PartialEq/Eq impls to proc_macro::{Spacing, Delimiter}
I don't see a reason why those two types shouldn't be tested for equality.
2017-08-20 23:20:34 +02:00
bors
8c303ed879 Auto merge of #44000 - ids1024:redox-exec-error, r=alexcrichton
redox: Correct error on exec when file is not found

`.raw_os_error()` (called in `spawn()`) returned None, so this produced an incorrect error.
2017-08-20 20:29:08 +00:00
Ian Douglas Scott
a41c4f80d9
redox: Correct error on exec when file is not found
`.raw_os_error()` (called in `spawn()`) returned None, so this produced an incorrect error.
2017-08-20 10:10:03 -07:00
bors
c1111dfcac Auto merge of #43996 - shanavas786:fix-typo, r=frewsxcv
Fix typo in doc
2017-08-20 15:58:05 +00:00
bors
3d9f57a292 Auto merge of #43978 - GuillaumeGomez:missing-links, r=frewsxcv
Missing links

r? @rust-lang/docs
2017-08-20 13:28:18 +00:00
bors
fe895bfb90 Auto merge of #43976 - dylanmckay:update-builtins, r=alexcrichton
Update the compiler_builtins submodule

Fixes #43411
2017-08-20 09:39:12 +00:00
Shanavas M
ee3463eb7f Fix typo in doc 2017-08-20 11:07:42 +03:00
bors
5fa54ee063 Auto merge of #43911 - arthurprs:update-jemalloc, r=alexcrichton
Update jemalloc to 4.5.0

Second try, including the fix for osx deadlock jemalloc/jemalloc#895.

cc https://github.com/rust-lang/rust/pull/41861 @alexcrichton @RalfJung
2017-08-20 07:18:38 +00:00
bors
498a8f36bf Auto merge of #43965 - frewsxcv:frewsxcv-filter-map, r=QuietMisdreavus
Minor Iterator::filter_map description rewording.

Fixes https://github.com/rust-lang/rust/issues/39294.
2017-08-20 04:50:22 +00:00
bors
e822e4e62f Auto merge of #43950 - redox-os:redox_docker, r=alexcrichton
Add x86_64-unknown-redox to build manifest target list

This should fix the issue of `x86_64-unknown-redox` not being available for `rustup target add`
2017-08-20 02:25:20 +00:00
bors
b07e730a36 Auto merge of #43936 - oli-obk:patch-6, r=alexcrichton
Upgrade a comment to a doc comment

r? @alexcrichton

cc @bjorn3
2017-08-19 23:53:53 +00:00
bors
5af17242cc Auto merge of #43990 - tamird:defid-not-name, r=eddyb
librustc_typeck: store a DefId rather than a Name

r? @eddyb

cc @tschottdorf
2017-08-19 21:09:09 +00:00
Tamir Duberstein
ceeb399cea
librustc_typeck: store a DefId rather than a Name 2017-08-19 13:41:10 -07:00
Vadim Petrochenkov
de4dbe5789 rustc: Remove some dead code 2017-08-19 13:27:16 +03:00
bors
7f397bdb06 Auto merge of #43919 - frewsxcv:frewsxcv-char-primitive, r=QuietMisdreavus
Minor rewrite of char primitive unicode intro.

Opened primarily to address #36998.

Despite my love for emoji, the heart example is a little confusing because both heart characters start with the same code point and there can be stark rendering differences across browsers. I also spelled out what each of the code points is in the code block, which (hopefully) sheds light why one character is one code point while the other is two.

Very much open to suggestion and improvements. I'm pretty tired when I wrote this so I might wake up and realize that this is making things more confusing 😅
2017-08-19 05:46:46 +00:00
bors
c7e3c7932c Auto merge of #43933 - topecongiro:bad-span-for-attributes, r=petrochenkov
Fix bad span for attributes

Closes #42641.
2017-08-19 01:59:36 +00:00
Corey Farwell
aac3008d12 Minor Iterator::filter_map description rewording.
Fixes https://github.com/rust-lang/rust/issues/39294.
2017-08-18 21:19:30 -04:00
Alex Crichton
4ba2df11d8 rustc: Add Local to the HIR map of parents
When walking parents for lints we want to be sure to hit `let` statements which
can have attributes, so hook up these statements in the HIR map.

Closes #43910
2017-08-18 10:36:39 -07:00
Guillaume Gomez
b88773f588 Add missing links for String module and type 2017-08-18 17:17:46 +02:00
bors
230a379a45 Auto merge of #43917 - ids1024:redox-unwind, r=alexcrichton
Enable unwinding panics on Redox
2017-08-18 15:11:46 +00:00
Guillaume Gomez
a5a1739945 Add missing urls for Result struct 2017-08-18 16:48:07 +02:00
Guillaume Gomez
86fd9a552d Add missing url for fmt module 2017-08-18 16:32:38 +02:00
Dylan McKay
9eb6975010 Update the compiler_builtins submodule
Fixes #43411
2017-08-18 23:03:37 +12:00
bors
b8ce1a3d2e Auto merge of #43901 - GuillaumeGomez:unsized-union-field, r=petrochenkov
udpdate error message for unsized union field

Fixes #36312.
2017-08-18 10:57:55 +00:00
Oliver Schneider
8f56322694
Add an additional empty line between the suggested use and the next item 2017-08-18 12:46:28 +02:00
Guillaume Gomez
c3c99b92c7 Handle structs, unions and enums unsized field/variant separately 2017-08-18 10:24:53 +02:00
bors
e6ab51165a Auto merge of #43904 - topecongiro:libsyntax/parse-attr, r=petrochenkov
Eat open paren when parsing list in libsyntax/parse/attr.rs

This PR adds a small refactoring:
```diff
      pub fn parse_meta_item_kind(&mut self) -> PResult<'a, ast::MetaItemKind> {
         Ok(if self.eat(&token::Eq) {
             ast::MetaItemKind::NameValue(self.parse_unsuffixed_lit()?)
-        } else if self.token == token::OpenDelim(token::Paren) {
+        } else if self.eat(&token::OpenDelim(token::Paren)) {
             ast::MetaItemKind::List(self.parse_meta_seq()?)
         } else {
-            self.eat(&token::OpenDelim(token::Paren));
             ast::MetaItemKind::Word
         })
     }
```
in `parse_meta_item_kind()`, the parser calls `self.eat(&token::OpenDelim(token::Paren));` before returning `ast::MetaItemKind::Word` just to add `(` to expected token. It seems more natural to eat the paren when parsing `ast::MetaItemKind::List`.
2017-08-18 08:17:45 +00:00
Alex Crichton
9b6f9d0bc4 rustc: Rename NodeLocal to NodeBinding 2017-08-17 23:00:57 -07:00
bors
8016eea9dc Auto merge of #43900 - TobiasSchaffner:net_out_of_io, r=alexcrichton
Refactoring: move net specific file descriptor methods

Move the implementations of net specific file descriptor methods from
io to net. This makes it easier to exclude net at all if it is not needed
for a target.
2017-08-18 05:47:56 +00:00
Esteban Küber
f06323337d Verify that an if condition block returns a value 2017-08-17 20:25:46 -07:00
bors
7f3be0a4b2 Auto merge of #43897 - lu-zero:master, r=alexcrichton
More PowerPC intrinsics
2017-08-18 03:15:01 +00:00
bors
4ac7646d39 Auto merge of #43832 - huntiep:compiler-desugaring-enum, r=nikomatsakis
Implement CompilerDesugaringKind enum

This is the first step outlined in #35946. I think that the variants of `CompilerDesugaringKind` should be changed, I didn't know what the official names for `...` and `<-` are.

I'm not to sure how tests for the compiler work, but I would imagine that tests should be added such that
`Symbol::intern(s) == CompilerDesugaringKind::from(s).as_symbol()` for valid `s`.
2017-08-18 00:26:08 +00:00
Esteban Küber
20a2716206 Check for else keyword on missing if condition 2017-08-17 15:48:39 -07:00
Jeremy Soller
2fdade4c2a Add x86_64-unknown-redox to build manifest target list 2017-08-17 14:58:47 -06:00
Esteban Küber
c4672f8e87 Point out missing if conditional
On a case where an else conditional is missing, point this out
instead of the token immediately after the (incorrect) else block:

```
error: missing condition for `if` statemementt push fork -f

  --> $DIR/issue-13483.rs:16:5
   |
13 |    } else if {
   |             ^ expected if condition here
```

instead of

```
error: expected `{`, found `else`
  --> ../../src/test/ui/issue-13483.rs:14:7
   |
14 |     } else {
   |       ^^^^
```
2017-08-17 10:18:06 -07:00