Commit Graph

83367 Commits

Author SHA1 Message Date
Aaron Power
3c1efcd6a7 Updated 1.29 release notes with --document-private-items flag 2018-09-12 11:19:23 +01:00
bors
a2b991b530 Auto merge of #51159 - pacman82:master, r=oli-obk
First step towards `u128` instead of `Const` in `PatternKind::Range`

This PR accomplishes two things:
* It adds `ty::Ty` to `PatternKind::Range`. The extra type information will make it easier to remove it from the `hi` and `lo` members.
* It exchanges `Const` for `u128` in `Constructor::ConstantRange`.
2018-09-12 01:56:48 +00:00
bors
58063894d2 Auto merge of #53913 - petrochenkov:biattr4, r=alexcrichton
resolve: Future proof resolutions for potentially built-in attributes

This is not full "pass all attributes through name resolution", but a more conservative solution.
If built-in attribute is ambiguous with any other macro in scope, then an error is reported.

What complications arise with the full solution - https://github.com/rust-lang/rust/pull/53913#issuecomment-418204136.

cc https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393
cc https://github.com/rust-lang/rust/issues/52269
Closes https://github.com/rust-lang/rust/issues/53531
2018-09-11 23:28:39 +00:00
Markus Klein
26c05b13e1 Add ty::Ty to PatternKind::Range;u128 for Const in Constructor::ConstantRange 2018-09-12 00:26:07 +02:00
bors
2f1547c0aa Auto merge of #53873 - nikomatsakis:nll-universe-subtyping-and-pattern-ascription, r=pnkfelix
support ascription for patterns in NLL

This implements the strategy outlined in [this comment](https://github.com/rust-lang/rust/issues/47184#issuecomment-416669986):

- We first extend the NLL subtyping code so it can handle inference variables and subtyping.
- Then we extend HAIR patterns with type ascription.
- Then we treat the type `T` in `let pat: T = ...` as an ascription.

Before landing, a few things:

- [x] Fix the WF rule bug (filed a FIXME https://github.com/rust-lang/rust/issues/54105)
- [x] Fix an ICE I encountered locally around bound regions, or else file a follow-up
- [x] More tests probably =)

r? @pnkfelix
2018-09-11 20:59:11 +00:00
bors
f17c2306e2 Auto merge of #54111 - nikomatsakis:issue-53686-keywords-and-macros, r=alexcrichton
warn about keywords in macro invocations

Fixes #53686

r? @alexcrichton
2018-09-11 15:40:44 +00:00
Niko Matsakis
0cd8e0d03e we now successfully warn about async in macro invocations 2018-09-11 08:56:59 -04:00
bors
7ee72070bd Auto merge of #51363 - japaric:stable-used, r=cramertj
stabilize #[used]

closes #40289

RFC for stabilization: rust-lang/rfcs#2386

r? @Centril

Where should this be documented? Currently the documentation is in the unstable book
2018-09-11 08:54:11 +00:00
bors
1f02f23263 Auto merge of #54113 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update Cargo submodule

Bring in a few last-minute updates before the 1.30.0 release
2018-09-11 06:28:29 +00:00
bors
d6720cc810 Auto merge of #54092 - estebank:gotta-go-fast, r=nikomatsakis
Don't compute padding of braces unless they are unmatched

Follow up to #53949. Attempt to fix # #54083.

r? @nikomatsakis
2018-09-11 01:08:49 +00:00
Alex Crichton
00e6d54609 Update Cargo submodule
Bring in a few last-minute updates before the 1.30.0 release
2018-09-10 16:40:57 -07:00
Vadim Petrochenkov
de153d61f5 resolve: Reserve a few very special names in macro namespace 2018-09-11 01:13:55 +03:00
Vadim Petrochenkov
65c8c97bc7 resolve: Skip bang macros when resolving potentially built-in attributes 2018-09-11 00:30:44 +03:00
Vadim Petrochenkov
d0aaf895ee resolve: Future proof resolutions for potentially built-in attributes 2018-09-11 00:30:44 +03:00
Vadim Petrochenkov
730c5de281 resolve: Support resolving identifier macros without their own ID
Invocation/expansion ID (aka `Mark`) is not really necessary for resolving a macro path.
What is really necessary is its parent module, parent expansion and parent legacy scope.
This is required for validation resolutions of built-in attributes, which don't get their own `Mark`s
2018-09-11 00:30:44 +03:00
Niko Matsakis
f95f23f0c3 fix incremental test
We are now carrying the user-given type through MIR, so it makes sense
that this would change the hash.
2018-09-10 17:24:43 -04:00
Niko Matsakis
5adbdf82f3 add test case 2018-09-10 17:21:01 -04:00
Niko Matsakis
b1a9f9eae8 visit the paths in pre-expansion macros 2018-09-10 17:12:55 -04:00
Niko Matsakis
38774aaf7f make add_pre_expansion_builtin add a pre-expansion lint
Copy-and-paste error.
2018-09-10 17:10:11 -04:00
Niko Matsakis
df37678b76 add FIXME related to ref x bindings 2018-09-10 14:12:20 -04:00
bors
551244f05b Auto merge of #54093 - petrochenkov:noinner, r=alexcrichton
Feature gate non-builtin attributes in inner attribute position

Closes item 3 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393
2018-09-10 17:18:27 +00:00
Niko Matsakis
2b6f9664ed add link to https://github.com/rust-lang/rust/issues/54105 2018-09-10 11:03:11 -04:00
Niko Matsakis
e87bf30f5f propagate user-ascribes types down onto resulting bindings
But only in very simple cases.
2018-09-10 10:58:31 -04:00
Niko Matsakis
a8710539cb expand the patterns test with a bunch more scenarios 2018-09-10 09:39:43 -04:00
bors
3c3e372e18 Auto merge of #54000 - jkozlowski:fix-53174, r=cramertj
Allow named lifetimes in async functions.

- Fixes #53174

Code by @eddyb; @cramertj suggested I lift it off another change so we can fix #53174.

r? @cramertj
2018-09-10 12:58:04 +00:00
Jorge Aparicio
d37658afbd bump version 2018-09-10 14:34:04 +02:00
Niko Matsakis
2f6628ecec optimize let x: T = .. to avoid a temporary
For some weird reason this fixes `intrinsic-move-val`. It also affects
various test heuristics. I removed one test (`reborrow_basic`) that
didn't seem to really be testing anything in particular anymore,
compared to all the other tests we've got.
2018-09-10 08:28:56 -04:00
Niko Matsakis
16f4e8ac1d generalize AscribeUserType to handle sub or super type 2018-09-10 08:28:31 -04:00
Niko Matsakis
9c5e7941ef WIP remove incorrect nll.stderr reference files 2018-09-10 08:22:31 -04:00
Niko Matsakis
fced2b1200 fix SCCs containing mixture of universes
And add a test showing a universe violation getting caught.
2018-09-10 08:22:31 -04:00
Niko Matsakis
f0e3a09bb8 fixup: rename UserAssertTy to AscribeUserType
This is some rebase pain.
2018-09-10 08:22:31 -04:00
Niko Matsakis
05a6e1e73f pacify the mercilous tidy 2018-09-10 08:22:31 -04:00
Niko Matsakis
7e1b97884b insert AscribeUserType for ascriptions 2018-09-10 08:22:31 -04:00
Niko Matsakis
dd3cc9669a add the AscribeUserType statement kind
Make it have the semantics of subtype.
2018-09-10 08:22:31 -04:00
Niko Matsakis
22f9bcce04 matches/mod.rs: rustfmt 2018-09-10 08:22:31 -04:00
Niko Matsakis
50754d0513 add a AscribeUserType pattern, largely ignored 2018-09-10 08:22:31 -04:00
Niko Matsakis
4b5f19a0b0 remove the old UserAssertTy support 2018-09-10 08:22:31 -04:00
Niko Matsakis
34575e693b now that we can handle subtyping, fix higher-ranked equality 2018-09-10 08:22:31 -04:00
Niko Matsakis
07e21b1e4b add a test for variables used twice 2018-09-10 08:22:31 -04:00
bors
595345419d Auto merge of #54011 - eddyb:anchored-in-the-future, r=petrochenkov
rustc_resolve: inject `uniform_paths` canaries regardless of the feature-gate, on Rust 2018.

This PR is an attempt at future-proofing "anchored paths" by emitting the same ambiguity errors that `#![feature(uniform_paths)]` would, with slightly changed phrasing (see added UI tests).

Also, on top of #54005, this PR allows this as well:
```rust
use crate_name;
use crate_name::foo;
```
In that any ambiguity between an extern crate and an import *of that same crate* is ignored.

r? @petrochenkov cc @aturon @Centril @joshtriplett
2018-09-10 10:28:53 +00:00
Eduard-Mihai Burtescu
d5da94a3b1 rustc_resolve: ignore uniform_paths canaries that resolve to an import of the same crate. 2018-09-10 11:48:46 +03:00
Eduard-Mihai Burtescu
0a33de04cf rustc_resolve: inject uniform_paths canaries regardless of the feature-gate, on Rust 2018. 2018-09-10 11:48:46 +03:00
bors
b8d45da274 Auto merge of #53565 - PramodBisht:issue/53359_b, r=estebank
#53359: putting multiple unresolved import on single line

r? @estebank
Here is WIP implementation of #53359
this PR have clubbed multiple unresolved imports into a single line.
I think still two things need to improve like giving specific `label message` for each span of multi_span(how we can do this?) and second we are getting a warning while compiling, stating something like `E0432` have been passed before.
2018-09-10 07:48:45 +00:00
bors
fb945f0ebb Auto merge of #53854 - davidtwco:issue-53668, r=nikomatsakis
if- and while-let-chains, take 2 - edition changes

Part of #53668.

r? @nikomatsakis
2018-09-10 04:05:14 +00:00
bors
fdcd4a4a45 Auto merge of #53936 - petrochenkov:2macpre, r=alexcrichton
resolve: Split macro prelude into built-in and user-defined parts

This is a refactoring that will help to remove `unshadowable_attrs` when https://github.com/rust-lang/rust/pull/53410 lands.

UPDATE: The second commit actually removes `unshadowable_attrs`.
2018-09-10 01:42:11 +00:00
Vadim Petrochenkov
62c7d78a9a resolve: Remove unshadowable_attrs 2018-09-10 04:04:51 +03:00
Vadim Petrochenkov
a25c841e88 resolve: Split macro prelude into built-in and user-defined parts 2018-09-10 04:00:48 +03:00
Vadim Petrochenkov
615eaba14b Feature gate non-builtin attributes in inner attribute position 2018-09-10 03:35:47 +03:00
Esteban Küber
014a56ca9c Don't compute padding of braces unless they are unmatched 2018-09-09 14:55:46 -07:00
bors
2d4e34ca8b Auto merge of #53778 - petrochenkov:shadrelax2, r=nikomatsakis
resolve: Relax shadowing restrictions on macro-expanded macros

Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes.
Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros.
See comments to `fn may_appear_after` and added tests for more details and examples.

The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.
2018-09-09 21:00:55 +00:00