summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2015-07-06Fix some merge conflictsNiko Matsakis-9/+10
2015-07-06Add a boolean flag to ExistentialBounds tracking whether theNiko Matsakis-0/+4
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-06-23Remove the mostly unecessary ParamBounds structJared Roesch-33/+0
2015-06-19rustc: remove Repr and UserString.Eduard Burtescu-26/+4
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-982/+476
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-42/+12
2015-06-19rustc: remove some unused UserString and Repr impls.Eduard Burtescu-26/+1
2015-06-19rustc: use the TLS type context in Repr and UserString.Eduard Burtescu-513/+571
2015-06-19rustc: leave only one free top-level function in ppaux, and private.Eduard Burtescu-352/+193
2015-06-19rustc: use Repr and UserString instead of ppaux::ty_to_string.Eduard Burtescu-13/+19
2015-06-19rustc: reduce ppaux's public footprint to 5 functions.Eduard Burtescu-103/+67
2015-06-12Split TyArray into TyArray and TySlice.Eli Friedman-6/+5
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-26/+26
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-5/+5
2015-06-10Auto merge of #26141 - eddyb:ast_map, r=nikomatsakisbors-1/+1
Gets libsyntax one step closer to running on stable (see #24518). Closes #24757, erickt's previous attempt at this.
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-1/+1
2015-06-08Skip useless recursion in freshening and late-bound-region substitutioAriel Ben-Yehuda-2/+2
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-08review changes - only show closure ids in verbose modeNick Cameron-3/+14
2015-06-08Tidying up, fix some minor linkage bugs, use ty flags to avoid caching ↵Nick Cameron-5/+8
closure types.
2015-06-02Auto merge of #25868 - alexcrichton:issue-25505, r=brsonbors-12/+29
The compiler already has special support for fixing up verbatim paths with disks on Windows to something that can be correctly passed down to gcc, and this commit adds support for verbatim UNC paths as well. Closes #25505
2015-05-28rustc: Fixup verbatim UNC paths as well on WindowsAlex Crichton-12/+29
The compiler already has special support for fixing up verbatim paths with disks on Windows to something that can be correctly passed down to gcc, and this commit adds support for verbatim UNC paths as well. Closes #25505
2015-05-26Implement defaults for associated typesAriel Ben-Yehuda-1/+1
2015-05-15Don't use <Duration as Display>::display() in time passesNick Cameron-4/+9
2015-05-14Auto merge of #24920 - alexcrichton:duration, r=aturonbors-2/+2
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-13std: Redesign Duration, implementing RFC 1040Alex Crichton-2/+2
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-12Create a FreshFloatTy separate from FreshIntTyAriel Ben-Yehuda-1/+2
There is no subtyping relationship between the types (or their non-freshened variants), so they can not be merged. Fixes #22645 Fixes #24352 Fixes #23825 Should fix #25235 (no test in issue). Should fix #19976 (test is outdated).
2015-05-11Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnikbors-1/+1
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-05rustc: Fix more verbatim paths leaking to gccAlex Crichton-0/+38
Turns out that a verbatim path was leaking through to gcc via the PATH environment variable (pointing to the bundled gcc provided by the main distribution) which was wreaking havoc when gcc itself was run. The fix here is to just stop passing verbatim paths down by adding more liberal uses of `fix_windows_verbatim_for_gcc`. Closes #25072
2015-05-03Update old uses of ~ in comments and debugging statementsCarol Nichols-1/+1
2015-04-30Stop using Rc in TraitRef and TraitDefAriel Ben-Yehuda-1/+1
The former stopped making sense when we started interning substs and made TraitRef a 2-word copy type, and I'm moving the latter into an arena as they live as long as the type context.
2015-04-23Structural changes for associated constantsSean Patrick Santos-1/+32
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-0/+98
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-18Auto merge of #24209 - nikomatsakis:refactor-unification, r=nrcbors-186/+0
I'm on a quest to slowly refactor a lot of the inference code. A first step for that is moving the "pure data structures" out so as to simplify what's left. This PR moves `snapshot_vec`, `graph`, and `unify` into their own crate (`librustc_data_structures`). They can then be unit-tested, benchmarked, etc more easily. As a benefit, I improved the performance of unification slightly on the benchmark I added vs the original code. r? @nrc
2015-04-17Auto merge of #24461 - nikomatsakis:issue-22077-unused-lifetimes, r=aturonbors-9/+9
This makes it illegal to have unconstrained lifetimes that appear in an associated type definition. Arguably, we should prohibit all unconstrained lifetimes -- but it would break various macros. It'd be good to evaluate how large a break change it would be. But this seems like the minimal change we need to do to establish soundness, so we should land it regardless. Another variant would be to prohibit all lifetimes that appear in any impl item, not just associated types. I don't think that's necessary for soundness -- associated types are different because they can be projected -- but it would feel a bit more consistent and "obviously" safe. I'll experiment with that in the meantime. r? @aturon Fixes #22077.
2015-04-17Auto merge of #24475 - arielb1:i24363-hacky-hack, r=pnkfelixbors-4/+7
Fix #24363
2015-04-17Use the newer snapshot_vec, which has a simplified delegateNiko Matsakis-186/+0
interface since in practice no delegates had any state.
2015-04-17Create a struct to represent early-bound regionsNiko Matsakis-9/+9
2015-04-15 make Repr of TraitRef more usefulAriel Ben-Yehuda-4/+7
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-04Encode more precise scoping rules for function params.Felix S. Klock II-0/+5
Function params which outlive everything in the body (incl temporaries). Thus if we assign them their own `CodeExtent`, the region inference can properly show that it is sound to have temporaries with destructors that reference the parameters (because such temporaries will be dropped before the parameters are). This allows us to address issue 23338 in a clean way. As a drive-by, fix a mistake in the tyencode for `CodeExtent::BlockRemainder`.
2015-04-02Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls, r=pnkfelixManish Goregaokar-0/+6
The primary purpose of this PR is to add blanket impls for the `Fn` traits of the following (simplified) form: impl<F:Fn> Fn for &F impl<F:FnMut> FnMut for &mut F However, this wound up requiring two changes: 1. A slight hack so that `x()` where `x: &mut F` is translated to `FnMut::call_mut(&mut *x, ())` vs `FnMut::call_mut(&mut x, ())`. This is achieved by just autoderef'ing one time when calling something whose type is `&F` or `&mut F`. 2. Making the infinite recursion test in trait matching a bit more tailored. This involves adding a notion of "matching" types that looks to see if types are potentially unifiable (it's an approximation). The PR also includes various small refactorings to the inference code that are aimed at moving the unification and other code into a library (I've got that particular change in a branch, these changes just lead the way there by removing unnecessary dependencies between the compiler and the more general unification code). Note that per rust-lang/rfcs#1023, adding impls like these would be a breaking change in the future. cc @japaric cc @alexcrichton cc @aturon Fixes #23015.
2015-04-01Implement the changes to coherence such that we consider a type to beNiko Matsakis-7/+1
local only if matches `FUNDAMENTAL(LocalType)`, where `FUNDAMENTAL` includes `&T` and types marked as fundamental (which includes `Box`). Also apply these tests to negative reasoning.
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-2/+3
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31Port over type inference to using the new type relation stuffNiko Matsakis-0/+6
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-2/+2
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-2/+2
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-11/+11
Now that support has been removed, all lingering use cases are renamed.
2015-03-18Auto merge of #23438 - ↵bors-1/+2
nikomatsakis:issue-23435-default-methods-with-where-clauses, r=nrc Fixes #23435
2015-03-17Remove subtyping for object types and replace with an *upcast* coercion.Niko Matsakis-3/+3
This upcast coercion currently preserves the vtable for the object, but eventually it can be used to create a derived vtable. The upcast coercion is not introduced into method dispatch; see comment on #18737 for information about why. Fixes #18737.