Commit Graph

205 Commits

Author SHA1 Message Date
Santiago Pastorino 8429d11a0b
Use AllFacts from polonius-engine 2018-05-24 19:56:02 -03:00
toidiu 9a8400c3ff implement Ord for OutlivesPredicate and other types 2018-05-24 00:01:35 -04:00
John Kåre Alsaker aace842a08 Get rid of literal_alloc_cache 2018-05-22 04:15:28 +02:00
Eduard-Mihai Burtescu e3df729c25 rustc: make mk_substs_trait take &[Kind] instead of &[Ty]. 2018-05-21 12:13:17 +03:00
Oliver Schneider 6630678428 Go through an allocation when accessing fields of constants 2018-05-19 14:24:24 +02:00
Irina Popa b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
bors 448cc578a9 Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakis
Implement RFC 2056 trivial constraints in where clauses

This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet.

Some things that are worth noting and are maybe not want we want

* `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow.
* ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~

r? @nikomatsakis
2018-05-16 09:03:38 +00:00
Matthew Jasper be2900c33b Make is_global true for latebound regions 2018-05-15 21:48:35 +01:00
varkor 9200bdee26 Refactor generic params loops 2018-05-15 14:21:32 +01:00
varkor 4bed895cab Pull common parameters into GenericParamDef
This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.
2018-05-15 14:21:32 +01:00
varkor 06f0a7c89f Rename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDef 2018-05-15 14:20:19 +01:00
varkor de1c29c95e Reduce parent_params to parent_count 2018-05-15 14:20:19 +01:00
John Kåre Alsaker fdd9787777 Introduce ConstValue and use it instead of miri's Value for constant values 2018-05-11 13:01:44 +02:00
John Kåre Alsaker c9d9c249ec Insert fields from TypeAndMut into TyRef to allow layout optimization 2018-05-08 16:21:58 +02:00
John Kåre Alsaker 710b4ad2a5 Store the GeneratorInterior in the new GeneratorSubsts 2018-05-08 16:21:58 +02:00
John Kåre Alsaker 0edc8f4270 Store generator movability outside GeneratorInterior 2018-05-08 16:21:58 +02:00
Sean Griffin 360cbf2f48 change skolemizations to use universe index
This is sort of confusing "side step". All it does is to change the
representation of a skolemized region. but the source of that universe
index is not the inference context, which is what we eventually want,
but rather an internal counter in the region inference context.

We'll patch that up later. But doing this now ought to help with
confusing diffs later.
2018-05-02 07:36:10 -06:00
Niko Matsakis 149ab1bc39 put ReSkolemized into the global tcx 2018-04-30 14:06:46 -04:00
Niko Matsakis 69400751ab make needs_infer specific to inference variables
Notably, excluding ReSkolemized
2018-04-30 14:06:45 -04:00
Niko Matsakis 2e59e467a0 remove some (apparently) dead code 2018-04-30 13:36:43 -04:00
bors ada45fd49a Auto merge of #50275 - kennytm:rollup, r=kennytm
Rollup of 7 pull requests

Successful merges:

 - #49707 (Add "the Rustc book")
 - #50222 (Bump bootstrap compiler to 2018-04-24)
 - #50227 (Fix ICE with erroneous `impl Trait` in a trait impl)
 - #50229 (Add setting to go to item if there is only one result)
 - #50231 (Add more doc aliases)
 - #50246 (Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.)
 - #49894 (Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString)

Failed merges:
2018-04-27 09:59:12 +00:00
bors 9822b5709c Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton
compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.
2018-04-27 07:43:46 +00:00
John Kåre Alsaker 4d52751d12 Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString 2018-04-27 03:35:32 +02:00
Irina Popa 04fa0e7bb3 rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
Tyler Mandry 9ffe9bea53 Remove methods with implicit Binder::skip_bound
Fixes #20664.
2018-04-24 22:12:07 -05:00
Tyler Mandry 98546f8b26 Make Binder's field private and clean up its usage 2018-04-24 22:12:07 -05:00
Josh Stone a42db7dbfd Add a stopgap for #49889 2018-04-24 16:16:49 -07:00
Guillaume Gomez 05275dafaa Remove unwanted auto-linking and update 2018-04-16 23:37:11 +02:00
varkor 6234d4192a Use InternedString rather than Name for RegionParameterDef
This makes it consistent with TypeParameterDef.
2018-04-13 18:41:40 +01:00
Michael Woerister abfc8c267c Use InternedString instead of Symbol for type parameters. 2018-04-06 10:32:31 +02:00
bors dca14701a5 Auto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakis
Remove universes from `ty::ParamEnv`

This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now.

r? @nikomatsakis
2018-03-29 05:44:40 +00:00
Sean Griffin 26cebda208 Revert "change skolemizations to use universe index"
This reverts commit 35e78b5cdd.
2018-03-23 13:18:50 -06:00
Alex Crichton 6fd3cc585a Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebank
Produce nice array lengths on a best effort basis

fixes #49208

r? @estebank
2018-03-23 10:16:10 -07:00
Niko Matsakis 9d5ec9ef1a work around fallout from these changes in rustc 2018-03-21 05:40:59 -04:00
Oliver Schneider df76629da7
Remove outdated comment 2018-03-20 17:14:33 +01:00
Mark Mansi 50f2884dcd Replace many of the last references to readmes 2018-03-16 12:43:22 -05:00
Andrew Cann 9b15ddb29e remove defaulting to unit
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
2018-03-14 12:44:51 +08:00
Niko Matsakis 993c1488cc add `canonicalize` method to `InferCtxt` [VIC] 2018-03-13 11:21:31 -04:00
Niko Matsakis 35e78b5cdd change skolemizations to use universe index 2018-03-01 08:04:26 -07:00
Manish Goregaokar 2dba874d57
Rollup merge of #48452 - varkor:unpacked-kind, r=eddyb
Introduce UnpackedKind

This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker will be able to catch more potential issues.

r? @eddyb
cc @yodaldevoid
2018-02-24 15:52:15 -08:00
varkor 8b2037c6fe Introduce UnpackedKind
This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker should catch more potential issues.
2018-02-23 01:13:54 +00:00
Tatsuyuki Ishi 0e26bb7287 Revert "Implement Ord as necessary"
This reverts commit c6772b4dcb.
2018-02-22 16:57:39 +09:00
bors 5570cdcc9e Auto merge of #46714 - leodasvacas:refactor-structurally-resolve-type, r=nikomatsakis
Refactor diverging and numeric fallback.

This refactoring tries to make numeric fallback easier to reason about. Instead of applying all fallbacks at an arbitrary point in the middle of inference, we apply the fallback only when necessary and only for
the variable that requires it. The only place that requires early fallback is the target of numeric casts.

The  visible consequences is that some error messages that got `i32` now get `{integer}` because we are less eager about fallback.

The bigger goal is to make it easier to integrate user fallbacks into inference, if we ever figure that out.
2018-02-16 03:38:44 +00:00
bors 3d292b793a Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakis
Generator bugfixes

r? @nikomatsakis
2018-02-03 17:28:08 +00:00
John Kåre Alsaker 4325c6375e Allow access of the state field before the generator transform. Fixes #47482, #46476 2018-01-30 11:40:39 +01:00
Eduard-Mihai Burtescu 800166cf96 rustc: remove `LvaluePreference` argument from `Ty::builtin_deref`. 2018-01-29 00:42:51 +02:00
leonardo.yvens 3d83fc914a Lazy numeric fallback.
This refactoring tries to make numeric fallback easier to reason about.
Instead of applying all fallbacks at an arbitrary point in the middle
of inference, we apply the fallback only when necessary and only for
the variable that requires it, which for numeric fallback turns out to
be just casts.

The only visible consequence seems to be some error messages where
instead of getting `i32` we get `{integer}` because we are less eager
about fallback.

The bigger goal is to make it easier to integrate user fallbacks into
inference, if we ever figure that out.
2018-01-27 15:42:54 -02:00
Alex Crichton 014931be8e Rollup merge of #47656 - ishitatsuyuki:patch-1, r=nikomatsakis
[perf] Use std based dedup in projection

Unstable sort was added recently, and the code that is being modified is 3 years old. As quicksort doesn't allocate it will likely perform as well as, or better than linear search.

I didn't benchmark. Have a perf run.
2018-01-25 13:49:48 -08:00
John Kåre Alsaker ccf0d8399e Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093. 2018-01-23 05:10:38 +01:00
Tatsuyuki Ishi c6772b4dcb Implement Ord as necessary 2018-01-23 09:56:28 +09:00