summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-1/+1
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-51/+54
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-2/+12
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-1/+1
Conflicts: src/libcore/num/mod.rs
2015-04-01fix typo.Felix S. Klock II-1/+1
2015-04-01fallout when bootstrapping `rustc`.Felix S. Klock II-1/+11
2015-04-01rollup merge of #23951: alexcrichton/splitnAlex Crichton-3/+3
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-01std: Changing the meaning of the count to splitnAlex Crichton-3/+3
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-02Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichtonManish Goregaokar-5/+16
Basically stuff I did for unqualified assoc types which is worth landing by itself.
2015-04-02Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls, r=pnkfelixManish Goregaokar-1216/+1442
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-02Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelixManish Goregaokar-169/+334
This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixes #23918.
2015-04-01Fallout out rustcNiko Matsakis-55/+58
2015-04-01Fallout in libsyntax/librustc: use newtype'd options for linked lists,Niko Matsakis-4/+3
since `Option` is not fundamental and hence the old impls run afoul of the orphan rules.
2015-04-01Implement the changes to coherence such that we consider a type to beNiko Matsakis-165/+331
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-04-01Auto merge of #23109 - nikomatsakis:closure-region-hierarchy, r=pnkfelixbors-197/+217
Adjust internal treatment of the region hierarchy around closures. Work towards #3696. r? @pnkfelix
2015-04-01Update commentsNiko Matsakis-30/+30
2015-04-01Remove the `Option<>` since when computing LUB since I believe that theNiko Matsakis-25/+27
case where `None` was returned should never happen in practice; it amounts to comparing regions from two unrelated hierarchies. (I was also not able to make it happen.)
2015-04-01Implement the new region hierarchy rules, in which regions from distinctNiko Matsakis-140/+109
hierarchies are judged based on the lexical relationship of their respective fn bodies.
2015-04-01Add a meta-hierarchy of trees -- in future, each fn body will inhabitNiko Matsakis-44/+93
its own disjoint region tree, and the new table encodes the lexical relationships between those trees.
2015-04-01Test fixes and rebase conflictsAlex Crichton-1/+0
2015-04-01Tidying up and reformattingNick Cameron-4/+15
2015-03-31rollup merge of #23863: pnkfelix/arith-oflo-const-evalAlex Crichton-169/+615
const_eval : add overflow-checking for {`+`, `-`, `*`, `/`, `<<`, `>>`}. One tricky detail here: There is some duplication of labor between `rustc::middle::const_eval` and `rustc_trans::trans::consts`. It might be good to explore ways to try to factor out the common structure to the two passes (by abstracting over the particular value-representation used in the compile-time interpreter). ---- Update: Rebased atop #23841 Fix #22531 Fix #23030 Fix #23221 Fix #23235
2015-04-01rustc::middle::const_eval : add overflow-checking for {+, -, *}.Felix S. Klock II-81/+297
The overflow-checking attempts to accommodate early evaluation where we do not have type information yet. Also, add fixme note about something that has been bothering me.
2015-04-01ty.rs improve error feedback when const-eval errs during repeat count eval.Felix S. Klock II-4/+5
2015-04-01Refactored ty::ctxt so node_types mutations must go through ty methods.Felix S. Klock II-4/+11
2015-04-01Fix #23890: const-eval `_ as usize`, `_ as isize` must dispatch to target type.Felix S. Klock II-32/+42
2015-04-01fix post rebase.Felix S. Klock II-2/+2
2015-04-01Added type-specific overflow checks when computing enum discriminant values.Felix S. Klock II-49/+261
Moved such overflow checking into one place (in `rustc::middle::ty`, since it needs to be run on-demand during `const_eval` in some scenarios), and revised `rustc_typeck` accordingly. (Note that we only check for overflow if program did not provide a discriminant value explicitly.) Fix #23030 Fix #23221 Fix #23235
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-1/+0
2015-04-01Pretty print ids for assoc itemsNick Cameron-1/+1
2015-03-31Test fixes and rebase conflicts, round 2Alex Crichton-1/+0
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-2/+3
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31rollup merge of #23875: aturon/revise-convert-2Alex Crichton-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change] r? @alexcrichton
2015-03-31Test fixes and rebase conflicts, round 1Alex Crichton-0/+1
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-31Stabilize `std::convert` and related codeAaron Turon-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]
2015-03-31rollup merge of #23549: aturon/stab-numAlex Crichton-2/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Auto merge of #23549 - aturon:stab-num, r=alexcrichtonbors-2/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Stabilize std::numAaron Turon-2/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-31Add a "match" relation that can be used to make recursion check duringNiko Matsakis-1/+109
trait matching more tailored. We now detect recursion where the obligations "match" -- meaning basically that they are the same for some substitution of any unbound type variables.
2015-03-31Port over type inference to using the new type relation stuffNiko Matsakis-937/+1127
2015-03-31Remove unused importNiko Matsakis-1/+1
2015-03-31Switch to FnvHashMapNiko Matsakis-4/+4
2015-03-31Extract more `ty` and `infer` dependencies from the unification engineNiko Matsakis-61/+65
so that it is closer to standalone.
2015-03-31Make union-find helper fns private, change to u32.Niko Matsakis-18/+26
2015-03-31Refactor unification interface by moving the methods off of inferctxt and ↵Niko Matsakis-140/+99
onto the `UnificationTable`, and renaming/collapsing some methods.
2015-03-31Combine `try` and `commit_if_ok` and make some details of inferenceNiko Matsakis-67/+51
context private.
2015-03-31Rename the cryptic cres and ures types.Niko Matsakis-161/+134
2015-03-31Rollup merge of #23866 - alexcrichton:switch-some-orders, r=aturonManish Goregaokar-1/+1
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-31Rollup merge of #23859 - pnkfelix:fsk-lesser-box, r=nikomatsakisManish Goregaokar-51/+123
Disallow writing through mutable pointers stored in non-mut Box. Fix #14270 The fix works by making `cmt::freely_aliasable` result more fine-grained. Instead of encoding the aliasability (i.e. whether the cmt is uniquely writable or not) as an option, now pass back an enum indicating either: 1. freely-aliasable (thus not uniquely-writable), 2. non-aliasable (thus uniquely writable), or 3. unique but immutable (and thus not uniquely writable, according to proposal from issue #14270.) This is all of course a giant hack that will hopefully go away with an eventually removal of special treatment of `Box<T>` (aka `ty_unique`) from the compiler.