summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2015-07-06rebase onto beta branchNiko Matsakis-1/+2
2015-07-06Fix some merge conflictsNiko Matsakis-1/+1
2015-07-06After inferring regions, scan for any bounds that are due to a lifetimeNiko Matsakis-0/+47
bound that is likely to change. In that case, it will change to 'static, so then scan down the graph to see whether there are any hard constraints that would prevent 'static from being a valid value here. Report a warning.
2015-07-06Add a boolean flag to ExistentialBounds tracking whether theNiko Matsakis-15/+108
region-bound is expected to change in Rust 1.3, but don't use it for anything in this commit. Note that this is not a "significant" part of the type (it's not part of the formal model) so we have to normalize this away or trans starts to get confused because two equal types wind up with distinct LLVM types.
2015-07-06Code up the new lifetime default rules, but leave them disabledNiko Matsakis-1/+8
for now.
2015-06-23Auto merge of #26354 - jroesch:remove-param-bounds-take-n, r=nikomatsakisbors-78/+16
This pull request removes `ParamBounds` a old holdover in the type checker that we (@nikomatsakis and I) had wanted to remove. I'm not sure if the current form is the best possible refactor but I figured we can use this as a place to discuss it. r? @nikomatsakis
2015-06-23Auto merge of #26519 - oli-obk:camel_case_const_val, r=eddybbors-136/+132
2015-06-23change `const_val` enum and its variants to camel-caseOliver Schneider-136/+132
2015-06-23Remove the mostly unecessary ParamBounds structJared Roesch-78/+16
2015-06-22Fix parallel codegen regressionNick Cameron-0/+1
Regressed by #26326
2015-06-22Do not consider fields matched by wildcard patterns to be usedSeo Sanghyeon-0/+3
2015-06-21Make expr_is_lval more robustAriel Ben-Yehuda-129/+28
Previously it also tried to find out the best way to translate the expression, which could ICE during type-checking. Fixes #23173 Fixes #24322 Fixes #25757
2015-06-19Auto merge of #24527 - nikomatsakis:issue-24085, r=nikomatsakisbors-12/+36
Expand the "givens" set to cover transitive relations. The givens array stores relationships like `'c <= '0` (where `'c` is a free region and `'0` is an inference variable) that are derived from closure arguments. These are (rather hackily) ignored for purposes of inference, preventing spurious errors. The current code did not handle transitive cases like `'c <= '0` and `'0 <= '1`. Fixes #24085. r? @pnkfelix cc @bkoropoff *But* I am not sure whether this fix will have a compile-time hit. I'd like to push to try branch observe cycle times.
2015-06-19Expand the "givens" set to cover transitive relations. The givens arrayNiko Matsakis-12/+36
stores relationships like `'c <= '0` (where `'c` is a free region and `'0` is an inference variable) that are derived from closure arguments. These are (rather hackily) ignored for purposes of inference, preventing spurious errors. The current code did not handle transitive cases like `'c <= '0` and `'0 <= '1`. Fixes #24085.
2015-06-19Remove extra fmt::Debug impl for VtableClosureData from #26147.Eduard Burtescu-6/+0
2015-06-19rustc: add more doc comments to ty::Lift and ty::with_ctxt.Eduard Burtescu-0/+10
2015-06-19rustc: remove Repr and UserString.Eduard Burtescu-691/+649
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-744/+430
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-4/+47
2015-06-19Clean up unused argument/variable warnings.Eduard Burtescu-27/+8
2015-06-19rustc: use the TLS type context in Repr and UserString.Eduard Burtescu-709/+709
2015-06-19rustc: allow "lifting" T<'a> to T<'tcx> if the value is part of ty::ctxt<'tcx>.Eduard Burtescu-0/+122
2015-06-19rustc: store the type context in TLS and allow safe access to it.Eduard Burtescu-4/+25
2015-06-19rustc: leave only one free top-level function in ppaux, and private.Eduard Burtescu-5/+125
2015-06-19rustc: use Repr and UserString instead of ppaux::ty_to_string.Eduard Burtescu-52/+37
2015-06-19rustc: reduce ppaux's public footprint to 5 functions.Eduard Burtescu-11/+15
2015-06-19rustc: enforce stack discipline on ty::ctxt.Eduard Burtescu-11/+15
2015-06-19rustc: remove ownership of tcx from trans' context.Eduard Burtescu-2/+1
2015-06-18Normalize associated types in closure signaturesAriel Ben-Yehuda-44/+130
Fixes #25700.
2015-06-18Simplify and type_known_to_meet_builtin_bound and make it more correct whenAriel Ben-Yehuda-59/+16
associated types are involved.
2015-06-18Rollup merge of #26348 - eefriedman:unused-interiorsafety, r=luqmanaManish Goregaokar-21/+4
2015-06-17Auto merge of #26326 - nikomatsakis:optimize-fulfillment-cache-in-tcx, ↵bors-33/+174
r=pcwalton When we successfully resolve a trait reference with no type/lifetime parameters, like `i32: Foo` or `Box<u32>: Sized`, this is in fact globally true. This patch adds a simple global to the tcx to cache such cases. The main advantage of this is really about caching things like `Box<Vec<Foo>>: Sized`. It also points to the need to revamp our caching infrastructure -- the current caches make selection cost cheaper, but we still wind up paying a high cost in the confirmation process, and in particular unrolling out dependent obligations. Moreover, we should probably do caching more uniformly and with a key that takes the where-clauses into account. But that's for later. For me, this shows up as a reasonably nice win (20%) on Servo's script crate (when built in dev mode). This is not as big as my initial measurements suggested, I think because I was building my rustc with more debugging enabled at the time. I've not yet done follow-up profiling and so forth to see where the new hot spots are. Bootstrap times seem to be largely unaffected. cc @pcwalton This is technically a [breaking-change] in that functions with unsatisfiable where-clauses may now yield errors where before they may have been accepted. Even before, these functions could never have been *called* by actual code. In the future, such functions will probably become illegal altogether, but in this commit they are still accepted, so long as they do not rely on the unsatisfiable where-clauses. As before, the functions still cannot be called in any case.
2015-06-17Auto merge of #25961 - sanxiyn:dead-variant-2, r=huonwbors-1/+51
Rebase of #21468. Fix #25960.
2015-06-16Remove unused type InteriorSafety.Eli Friedman-21/+4
2015-06-16Fix merge errorsNiko Matsakis-2/+3
2015-06-15Rather than expanding the where-clauses in the environment over and overNiko Matsakis-23/+38
again, do it once and then just remember the expanded form. At the same time, filter globally nameable predicates out of the environment, since they can cause cache errors (and they are not necessary in any case).
2015-06-15Add a (somewhat hacky) cache to the tcx that tracks "global" trait refsNiko Matsakis-10/+135
that are known to have been satisfied *somewhere*. This means that if one fn finds that `SomeType: Foo`, then every other fn can just consider that to hold. Unfortunately, there are some complications: 1. If `SomeType: Foo` includes dependent conditions, those conditions may trigger an error. This error will be repored in the first fn where `SomeType: Foo` is evaluated, but not in the other fns, which can lead to uneven error reporting (which is sometimes confusing). 2. This kind of caching can be unsound in the presence of unsatisfiable where clauses. For example, suppose that the first fn has a where-clause like `i32: Bar<u32>`, which in fact does not hold. This will "fool" trait resolution into thinking that `i32: Bar<u32>` holds. This is ok currently, because it means that the first fn can never be calle (since its where clauses cannot be satisfied), but if the first fn's successful resolution is cached, it can allow other fns to compile that should not. This problem is fixed in the next commit.
2015-06-15Make impl-trait-ref associated types work in methodsAriel Ben-Yehuda-0/+4
2015-06-12Split TyArray into TyArray and TySlice.Eli Friedman-83/+70
Arrays and slices are closely related, but not that closely; making the separation more explicit is generally more clear.
2015-06-12Cleanup: rename middle::ty::sty and its variants.Eli Friedman-690/+739
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-62/+59
Pull request for #26188.
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-20/+20
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-56/+53
2015-06-10Auto merge of #26182 - Manishearth:rollup, r=Manishearthbors-6/+6
- Successful merges: #26142, #26143, #26145, #26146, #26164, #26174 - Failed merges:
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-3/+3
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-10Rollup merge of #26143 - steveklabnik:gh25851, r=alexcrichtonManish Goregaokar-3/+3
Still some references left to this old term, I've updated them to say boxes. Related to #25851
2015-06-10Auto merge of #26141 - eddyb:ast_map, r=nikomatsakisbors-14/+17
Gets libsyntax one step closer to running on stable (see #24518). Closes #24757, erickt's previous attempt at this.
2015-06-10Auto merge of #26058 - Kimundi:issue15609, r=nikomatsakisbors-9/+21
Closes #15609
2015-06-10Auto merge of #26055 - arielb1:smart-fold, r=nikomatsakisbors-74/+127
Before: 581.72user 4.75system 7:42.74elapsed 126%CPU (0avgtext+0avgdata 1176224maxresident)k llvm took 359.183 After: 550.63user 5.09system 7:20.28elapsed 126%CPU (0avgtext+0avgdata 1165516maxresident)k llvm took 354.801
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-14/+17