summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2015-07-06rebase onto beta branchNiko Matsakis-1/+2
2015-07-06Fix some merge conflictsNiko Matsakis-10/+11
2015-07-06After inferring regions, scan for any bounds that are due to a lifetimeNiko Matsakis-0/+83
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-16/+122
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-9/+16
for now.
2015-06-23Auto merge of #26354 - jroesch:remove-param-bounds-take-n, r=nikomatsakisbors-197/+34
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-197/+34
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-20Auto merge of #26417 - brson:feature-err, r=steveklabnikbors-52/+3
It now says '#[feature] may not be used on the stable release channel'. I had to convert this error from a lint to a normal compiler error. I left the lint previously-used for this in place since removing it is a breaking change. It will just go unused until the end of time. Fixes #24125
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-19Auto merge of #26351 - eddyb:tls-tcx, r=nikomatsakisbors-2760/+1974
Pre-requisite for splitting the type context into global and local parts. The `Repr` and `UserString` traits were also replaced by `Debug` and `Display`.
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-19Replace "Bad example" by a better sentenceGuillaume Gomez-2/+36
2015-06-19Add E0016 explanationGuillaume Gomez-0/+15
2015-06-18Make a better error message for using #[feature] on stable rustBrian Anderson-52/+3
It now says '#[feature] may not be used on the stable release channel'. I had to convert this error from a lint to a normal compiler error. I left the lint previously-used for this in place since removing it is a breaking change. It will just go unused until the end of time. Fixes #24125
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-717/+653
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-1727/+907
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-46/+59
2015-06-19rustc: remove some unused UserString and Repr impls.Eduard Burtescu-26/+1
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-1222/+1280
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/+26
2015-06-19rustc: leave only one free top-level function in ppaux, and private.Eduard Burtescu-357/+318
2015-06-19rustc: use Repr and UserString instead of ppaux::ty_to_string.Eduard Burtescu-65/+56
2015-06-19rustc: reduce ppaux's public footprint to 5 functions.Eduard Burtescu-114/+82
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-18Auto merge of #26147 - arielb1:assoc-trans, r=nikomatsakisbors-103/+146
Fixes #25700 r? @nikomatsakis
2015-06-18Normalize associated types in closure signaturesAriel Ben-Yehuda-44/+130
Fixes #25700.
2015-06-18Auto merge of #26192 - alexcrichton:features-clean, r=aturonbors-3/+18
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized. A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
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-17More test fixes and fallout of stability changesAlex Crichton-1/+1
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+2
2015-06-17std: Split the `std_misc` featureAlex Crichton-1/+2
2015-06-17collections: Split the `collections` featureAlex Crichton-0/+8
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-17core: Split apart the global `core` featureAlex Crichton-2/+7
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
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.