Commit Graph

85049 Commits

Author SHA1 Message Date
Oliver Schneider
6a6b3309e6 update tests to changes on rustc master 2018-10-25 16:47:35 +02:00
Oliver Schneider
e6f7f4af50 Document error/lint cases in const eval 2018-10-25 16:47:35 +02:00
Oliver Schneider
d736197bc2 Explain the Reveal::UserFacing deduplication trick 2018-10-25 16:47:35 +02:00
Oliver Schneider
b4ee38ede3 Don't extend hir::Def when there's already a dedicated "function-like" detector 2018-10-25 16:47:35 +02:00
Oliver Schneider
73e2b4662d Prepare miri for unsized locals 2018-10-25 16:47:35 +02:00
Oliver Schneider
0f97048618 Deduplicate all the ~~things~~ errors 2018-10-25 16:47:35 +02:00
Oliver Schneider
d34232bcaf Fix rebase fallout 2018-10-25 16:47:34 +02:00
Oliver Schneider
6f84d6edf1 Layout errors can happen because something was too generic 2018-10-25 16:46:19 +02:00
Oliver Schneider
cce53b3631 Forward TooGeneric errors 2018-10-25 16:46:19 +02:00
Oliver Schneider
7fdf06cdde Report const eval error inside the query 2018-10-25 16:46:19 +02:00
bors
3476ac0bee Auto merge of #55323 - nikomatsakis:nll-ICE-55219-and-55241, r=pnkfelix
introduce type-op for user-type ascription in NLL

Handle user-type ascription in a type operator, which gives us a lot more flexibility around the order in which we resolve things.

r? @pnkfelix

Fixes #55219
Fixes #55241
2018-10-25 12:00:50 +00:00
bors
365b9001e5 Auto merge of #54658 - petrochenkov:experelude, r=nikomatsakis
Add `extern crate` items to extern prelude

With this patch each `extern crate orig_name as name` item adds name `name` into the extern prelude, as if it was passed with `--extern`.

What changes this causes in practice?
Almost none! After all, `--extern` passed from Cargo was supposed to replace `extern crate` items in source, so if some code has `extern crate` item (or had it on 2015 edition), then it most likely uses `--extern` as well...

... with exception of a few important cases.

- Crates using `proc_macro`. `proc_macro` is not passed with `--extern` right now and is therefore not in extern prelude.
Together with 2018 edition import behavior this causes problems like https://github.com/rust-lang/rust/issues/54418, e.g.
    ```rust
    extern crate proc_macro;
    use proc_macro::TokenStream;
    ```
    doesn't work.
It starts working after this patch.

- `#[no_std]` crates using `std` conditionally, like @aturon described in https://github.com/rust-lang/rust/issues/53166#issuecomment-425219286, and still wanting to write `std` instead of `crate::std`. This PR covers that case as well.
This allows us to revert placing `std` into the extern prelude unconditionally, which was, I think, a [bad idea](https://github.com/rust-lang/rust/issues/53166#issuecomment-425117829).

- Later `extern crate` syntax can be extended to support adding an alias to some local path to extern prelude, as it may be required for resolving https://github.com/rust-lang/rust/issues/54647.

Notes:
- Only `extern crate` items from the root module added to the prelude, mostly because this behavior for items from inner modules would look very strange, rather than for technical reasons.
This means you can opt out from the prelude additions with something like
    ```rust
    mod inner {
        pub(crate) extern crate foo;
    }
    use inner::foo;
    ```
- I haven't updated logic for 2018 import canaries to work fully correctly with this. The cases where it matters are pretty exotic (the `extern crate` item must be "sufficiently macro expanded") and I'd rather spend the time on eliminating the canaries entirely.
2018-10-25 09:18:17 +00:00
Niko Matsakis
62f0fc5112 port the relate-types code from NLL type-check into a type-op
Add regression tests for #55219 and #55241

Also another test where a duplicate-like error appears to have been
suppressed; I'm not 100% sure why this output changes, though I could
imagine that some duplicate suppression is enabled by this PR.
2018-10-24 15:12:50 -04:00
Niko Matsakis
7c8887ccbf introduce (but do not use) ascribe_user_type goal
Lots of annoying boilerplate.
2018-10-24 15:12:40 -04:00
Vadim Petrochenkov
d1e337bded Prohibit macro-expanded extern crate items shadowing crates passed with --extern 2018-10-24 01:33:35 +03:00
Vadim Petrochenkov
7976aa32a9 Minor doc improvements 2018-10-24 00:14:50 +03:00
Vadim Petrochenkov
faefc83a7a Feature gate extern prelude additions from extern crate items
Fix rustdoc and fulldeps tests
2018-10-24 00:14:50 +03:00
Vadim Petrochenkov
0f625ac48d Add extern crate items to extern prelude 2018-10-24 00:14:50 +03:00
bors
f99911a4a0 Auto merge of #55229 - nikomatsakis:issue-54692-closure-signatures, r=MatthewJasper
enforce user annotations in closure signatures

Not *quite* ready yet but I'm opening anyway. Still have to finish running tests locally.

Fixes #54692
Fixes #54124

r? @matthewjasper
2018-10-23 17:44:19 +00:00
Niko Matsakis
4394c83cb7 type_check/mod.rs: rustfmt 2018-10-23 10:57:06 -04:00
Niko Matsakis
1371cd27d0 check the self type is well-formed
This fixes `issue-28848.rs` -- it also handles another case that the
AST region checker gets wrong (`wf-self-type.rs`).  I don't actually
think that this is the *right way* to be enforcing this constraint --
I think we should probably do it more generally, perhaps by editing
`predicates_of` for the impl itself. The chalk-style implied bounds
setup ought to fix this.
2018-10-23 10:32:46 -04:00
bors
d74b40205f Auto merge of #55281 - alexcrichton:revert-demote, r=petrochenkov
Revert "rustc: Fix (again) simd vectors by-val in ABI"

This reverts commit 3cc8f738d4.
2018-10-23 10:56:41 +00:00
bors
7cfe5de214 Auto merge of #55113 - mockersf:master, r=estebank
#45829 when a renamed import conflict with a previous import

Fix the suggestion when a renamed import conflict.

It check if the snipped contains `" as "`, and if so uses everything before for the suggestion.
2018-10-23 08:17:18 +00:00
Alex Crichton
086f5a55be Revert "rustc: Fix (again) simd vectors by-val in ABI"
This reverts commit 3cc8f738d4.
2018-10-23 00:59:14 -07:00
bors
d570b36cd9 Auto merge of #54778 - scottmcm:stabilize-ihle, r=pnkfelix
Stabilize impl_header_lifetime_elision in 2015

~~This is currently blocked on https://github.com/rust-lang/rust/issues/54902; it should be good after that~~

It's already stable in 2018; this finishes the stabilization.

FCP completed (https://github.com/rust-lang/rust/issues/15872#issuecomment-417953153), proposal (https://github.com/rust-lang/rust/issues/15872#issuecomment-412759783).

Tracking issue: https://github.com/rust-lang/rust/issues/15872
Usage examples (from libcore): https://github.com/rust-lang/rust/pull/54687
2018-10-23 04:05:50 +00:00
bors
979fb16db9 Auto merge of #55231 - zackmdavis:determinate, r=oli-obk
pick a reference issue for absolute-paths future incompatibility info

It would be kind of embarrassing to ship with the "issue TBD" message!
2018-10-23 01:24:26 +00:00
Niko Matsakis
64b5599352 stop reporting "unsatisfied lifetime bounds" errors after the first
In particular, after the first for a given region variable. This
suppresses a lot of duplicate errors.
2018-10-22 11:41:46 -04:00
Niko Matsakis
2921fbaaa8 flesh out closure-substs test 2018-10-22 10:04:47 -04:00
Niko Matsakis
0afccbb654 fix incremental test 2018-10-22 10:04:47 -04:00
Niko Matsakis
dbbdce51dc add regression test for #54124
Fixes #54124
2018-10-22 10:04:47 -04:00
Niko Matsakis
3a17880539 start enforcing closure types 2018-10-22 10:04:47 -04:00
Niko Matsakis
e0871ed318 record supplied sig of closure 2018-10-22 10:04:47 -04:00
Niko Matsakis
a8f3d6dafc convert user-provided signatures into def-id 2018-10-22 10:04:47 -04:00
Niko Matsakis
167b460961 add a table to track user-provided signatures 2018-10-22 10:00:32 -04:00
François Mockers
8fe6688fcf better dummy span detection and remove redundant branch 2018-10-22 09:08:09 +02:00
bors
a66dc8a148 Auto merge of #55224 - kryptan:master, r=matthewjasper
Use a keyword in raw identifier example

That's a very small documentation fix. The text says "you can now use keywords as identifiers" but example didn't use a keyword and would work without raw identifiers.
2018-10-22 03:41:28 +00:00
bors
5481485670 Auto merge of #55126 - GuillaumeGomez:improve-search-tabs, r=QuietMisdreavus
improve search tabs look

Fixes #55056.

![screenshot from 2018-10-16 19-06-48](https://user-images.githubusercontent.com/3050060/47034247-1e08b280-d177-11e8-9c1e-c7320af9b561.png)

![screenshot from 2018-10-16 19-09-39](https://user-images.githubusercontent.com/3050060/47034255-2365fd00-d177-11e8-8686-4765d3e56ff5.png)

With this, I think it'll be more obvious.

cc @memoryruins

r? @QuietMisdreavus
2018-10-22 01:04:52 +00:00
bors
424a749a01 Auto merge of #55179 - bjorn3:miri_public_op_field, r=RalfJung
Give OpTy access to locals for priroda

r? @oli-obk
2018-10-21 20:07:34 +00:00
bors
12a88a6b09 Auto merge of #55236 - petrochenkov:pfail, r=davidtwco
Move parse-fail tests to UI

cc https://github.com/rust-lang/rust/issues/53353

r? @davidtwco
2018-10-21 17:26:16 +00:00
Guillaume Gomez
dc5242592b improve search tabs look 2018-10-21 19:25:33 +02:00
bors
0e2f912050 Auto merge of #52984 - fabric-and-ink:remove-canonical-var, r=scalexm
Replace CanonicalVar with DebruijnIndex

Close #49887
2018-10-21 14:42:35 +00:00
bjorn3
b178553e55 Address review comments 2018-10-21 16:16:23 +02:00
bjorn3
c32cf25689 Rename read_local_of_frame to access_local 2018-10-21 15:49:20 +02:00
bjorn3
f46e3ba308 Rename alloc_map_ref to alloc_map 2018-10-21 15:49:20 +02:00
bjorn3
825b55e763 Add alloc_map accessor 2018-10-21 15:49:19 +02:00
bjorn3
3742892749 Use read_local_of_frame in eval_place_to_op
Also make `layout_of_local` accept any `Frame`
2018-10-21 15:49:19 +02:00
bjorn3
7d406c9146 Fix errors 2018-10-21 15:49:19 +02:00
bjorn3
3e62ba1af6 Add method to get OpTy for local from arbitrary frame 2018-10-21 15:49:19 +02:00
bjorn3
ea51e32043 Make OpTy field op public for priroda 2018-10-21 15:49:19 +02:00
bors
31b97f789f Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis
[NLL] Use new region infer errors when explaining borrows

Use the new free region infer errors for explaining borrows

This gives at least some explanation for why a borrow is expected to
last for a certain free region. Also:

* Reports E0373: "closure may outlive the current function" with NLL.
* Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515).
* Special case assigning a reference to a local variable in a closure to a captured variable. (E0521)

Closes #51026 - `regions-nested-fns-2.rs` isn't changed to that diagnostic, since that would not be the correct error here.
Closes #51169
cc #53882 - The error is (IMO) better now, but it could be better when we trace lifetimes in these error messages.

r? @nikomatsakis cc @pnkfelix
2018-10-21 12:04:25 +00:00