bors
052d24e6c8
Auto merge of #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelix
...
[NLL] Suggest let binding
Closes #49821
Also adds an alternative to `explain_why_borrow_contains_point` that allows changing error messages based on the reason that will be given. This will also be useful for #51026 , #51169 and maybe further changes to does not live long enough messages.
2018-09-14 15:45:02 +00:00
David Wood
18c1374bf8
Update from TyKind::Anon to TyKind::Opaque
2018-09-13 12:07:23 +02:00
David Wood
37e18b1c51
Updated suggestion/help messages.
2018-09-13 10:01:18 +02:00
David Wood
7a89e93519
Emit appropriate suggestion when there's already 'static bound on the return type.
2018-09-13 10:01:18 +02:00
David Wood
65e2539666
Don't suggest adding a synthesized region name.
2018-09-13 10:01:18 +02:00
David Wood
6bf131f3f4
Added help message for impl trait static constraint.
2018-09-13 10:01:18 +02: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
16f4e8ac1d
generalize AscribeUserType
to handle sub or super type
2018-09-10 08:28: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
05a6e1e73f
pacify the mercilous tidy
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
34575e693b
now that we can handle subtyping, fix higher-ranked equality
2018-09-10 08:22:31 -04:00
Matthew Jasper
ea6fe08751
Split explain_why_borrow_contains_point into two functions
...
Allows callers to change other parts of their message based on the
explanation
2018-09-09 19:43:10 +01:00
Niko Matsakis
aa52e12658
add generalization
2018-09-09 14:31:05 -04:00
Niko Matsakis
5f43b099cd
instantiate traversed binders rather than saving the scopes
2018-09-09 14:14:41 -04:00
Niko Matsakis
39b9281562
add a first_free_index
parameter
2018-09-09 14:14:41 -04:00
Niko Matsakis
5c5741bf76
add some comments
2018-09-09 14:14:41 -04:00
Niko Matsakis
d6a98db7cb
factor out lookup_bound_region
2018-09-09 14:14:41 -04:00
Niko Matsakis
09f4172bed
remove extra lifetime bound
2018-09-09 14:14:41 -04:00
Niko Matsakis
fa1f564426
document the purpose of ScopeInstantiator
2018-09-09 14:14:41 -04:00
bors
b24330fb7d
Auto merge of #53705 - ms2300:tmp, r=oli-obk
...
#53576 Renaming TyAnon -> TyOpaque
Fixes #53576
2018-09-08 14:16:37 +00:00
kennytm
51c387931e
Rollup merge of #53315 - nikomatsakis:newtype-index, r=Mark-Simulacrum
...
use `NonZeroU32` in `newtype_index!`macro, change syntax
Various improvements to the `newtype_index!` macro:
- Use `NonZeroU32` so that `Option<T>` is cheap
- More ergonomic helper method, no need to import `Idx` trait all the time
- Improve syntax to use `struct` keyword so that ripgrep works to find type def'n
Fixes https://github.com/rust-lang/rust/issues/50337
I'm curious to see if this passes tests =)
2018-09-08 18:28:13 +08:00
Niko Matsakis
bb8c4c0db9
print less info to stabilize tests
2018-09-07 17:24:46 -04:00
Niko Matsakis
43e758798c
avoid propagating outlives obligations on locals if we can
2018-09-07 17:08:22 -04:00
Niko Matsakis
db169e53e5
move annotate
onto a method of UniversalRegions
...
This allows it to print out the "late-bound regions" from the closure
context more easily. Besides, all the state that is being printed it
is private to the `UniversalRegions`.
2018-09-07 17:08:21 -04:00
Niko Matsakis
b7f871363b
region_infer: rustfmt
2018-09-07 16:41:15 -04:00
Niko Matsakis
8eb789f4c7
region_infer.rs: add some debug!
2018-09-07 16:41:15 -04:00
Niko Matsakis
5aee959e9f
make field always private, add From
impls
2018-09-07 11:37:46 -04:00
Niko Matsakis
1242639b88
change syntax of newtype_index
to look like a struct decl
2018-09-07 11:34:41 -04:00
Niko Matsakis
81f64b7fa3
universal_regions.rs: rustfmt
2018-09-06 19:58:23 -04:00
Niko Matsakis
da12d02b37
useful debug in universal_regions
2018-09-06 19:58:23 -04:00
Niko Matsakis
bf6fe2a51e
region_name: rustfmt
2018-09-06 19:58:23 -04:00
Niko Matsakis
2eb76fc8a1
add a useful debug to give_region_a_name
2018-09-06 19:58:22 -04:00
Wesley Wiser
4e706f56bd
[nll] teach SCC about 'static
...
Fixes #53178
2018-09-06 19:58:22 -04:00
Wesley Wiser
db01b6789d
[nll] Refactor the Edges
iterator to return OutlivesConstraints
...
Part of #53178
2018-09-06 19:58:22 -04:00
bors
a8c11d216b
Auto merge of #53575 - matthewjasper:unsized-is-an-error, r=estebank
...
Don't reduce E0161 to a warning in NLL migrate mode
This error has been on stable for a while, and allowing such code cause the compile to later ICE (since we can't codegen it). Errors `box UNSIZED EXPR` with unsized locals because it's not compatible with the current evaluation order (create the box before evaluating the expressions).
cc #53469 (fixes the ICE in this case)
cc @qnighy
2018-09-06 21:02:35 +00:00
ms2300
6c14360c32
Changing TyAnon -> TyOpaque and relevant functions
2018-09-05 13:01:16 -06:00
Felix S. Klock II
8d231ec872
Fix definition of LocalUseMapBuild
so that it can build under stage0,
...
which does not have as many feature gates enabled.
2018-08-28 10:59:15 +02:00
Niko Matsakis
09feec6d5c
make to_location
O(1)
2018-08-27 13:57:55 -04:00
Niko Matsakis
7eec37b2f9
merge PointIndexMap
and RegionValueElements
2018-08-27 13:57:55 -04:00
Niko Matsakis
af3ff10c7d
improve comment on LiveVar
2018-08-27 13:57:55 -04:00
Niko Matsakis
94697ba4b6
rename LocalWithRegion
to LiveVar
2018-08-27 13:57:55 -04:00
Niko Matsakis
437485527e
comment what trace
does
2018-08-27 13:57:55 -04:00
Niko Matsakis
9394a99f8e
fix comment
2018-08-27 13:57:55 -04:00
Niko Matsakis
12f50a6e75
implement liveness tracing, remove old liveness system
2018-08-27 13:57:55 -04:00
Niko Matsakis
a13e4aea81
remove the liveness mode and simplify categorize
...
Less modes!
2018-08-27 13:48:40 -04:00
bors
8785e348ba
Auto merge of #53580 - nikomatsakis:nll-issue-53568, r=pnkfelix
...
fix NLL ICEs
Custom type-ops reuse some of the query machinery -- but while query results are canonicalized after they are constructed, custom type ops are not, and hence we have to resolve the type variables to avoid an ICE here.
Also, use the type-op machinery for implied outlives bounds.
Fixes #53568
Fixes #52992
Fixes #53680
2018-08-27 14:44:13 +00:00
Niko Matsakis
fa787454c5
pacify the mercilous tidy: user-ty on rvalue assignments
2018-08-24 13:27:38 -04:00
Niko Matsakis
56506cfa25
support user-given types in adts
2018-08-24 13:27:38 -04:00