about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-02-20fix a few 'variable does not need to be mutable' warningsTshepang Lekhonkhobe-8/+8
2015-02-19Round 8 tex fixesManish Goregaokar-1/+1
2015-02-19Round 5 test fixes and rebase conflictsAlex Crichton-10/+52
2015-02-18Fix from niko for cfail testsAlex Crichton-12/+21
2015-02-18Round 4 test fixes and rebase conflictsAlex Crichton-19/+180
2015-02-18Exempt phantom fns from the object safety checkNiko Matsakis-4/+33
2015-02-18Round 3 test fixes and conflictsAlex Crichton-135/+127
2015-02-18rollup merge of #22286: nikomatsakis/variance-4bAlex Crichton-1347/+3307
Conflicts: src/librustc/middle/infer/combine.rs src/librustc_typeck/check/wf.rs
2015-02-18Round 2 test fixes and conflictsAlex Crichton-27/+131
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-882/+895
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18rollup merge of #22210: aturon/stab-final-borrowAlex Crichton-514/+766
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
2015-02-18Round 1 fixes and rebase conflictsAlex Crichton-44/+44
2015-02-18Stabilize std::borrowAaron Turon-407/+753
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-864/+865
2015-02-18Declare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism toNiko Matsakis-15/+28
support warnings.
2015-02-18rollup merge of #22498: nagisa/style-fixesAlex Crichton-4/+3
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-1030/+1027
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-938/+990
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18rollup merge of #22485: pnkfelix/fsk-int-uint-auditAlex Crichton-27/+27
cc #22240
2015-02-18rollup merge of #22484: riginding/masterAlex Crichton-1/+1
2015-02-18rollup merge of #22482: alexcrichton/cstr-changesAlex Crichton-290/+555
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18rollup merge of #22480: alexcrichton/hashv3Alex Crichton-356/+4988
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18rollup merge of #22452: nikomatsakis/issue-22040-18956-SelfAlex Crichton-13/+251
The big change here is that we update the object-safety rules to prohibit references to `Self` in the supertrait listing. See #22040 for the motivation. The other change is to handle the interaction of defaults that reference `Self` and object types (where `Self` is erased). We force users to give an explicit type in that scenario. r? @aturon
2015-02-18rollup merge of #22438: dotdash/iter_vec_loopAlex Crichton-37/+14
No need to create a bunch of blocks and a stack allocated temporary just to build a simple loop.
2015-02-18rollup merge of #22437: dotdash/fix_array_typeAlex Crichton-30/+11
In trans_slice_vec we currently use arrayalloca, which gives us a pointer to the element type with enough memory allocated for the requested number of elements. This works, but everywhere else we use the [n x T] type for fixed size arrays and so we have to bitcast the pointer here. Let's directly use the proper type for the allocation and remove some code duplication along the way.
2015-02-18rollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-typesAlex Crichton-296/+684
Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.) r? @pnkfelix (for now, anyway) cc @aturon [implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/
2015-02-18rollup merge of #22395: brson/readme-cleanupAlex Crichton-0/+0
Just a few things to make the README ever more perfect. r? @steveklabnik
2015-02-18rollup merge of #22287: Ryman/purge_carthographersAlex Crichton-127/+130
This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary. This also implements `RandomAccessIterator` for `iter::Cloned` cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment
2015-02-18Update tests to use #[feature(rustc_attrs)]Niko Matsakis-0/+10
2015-02-18Minor unused imports etc.Niko Matsakis-3/+1
2015-02-18rollup merge of #22118: fhahn/separate-parse-fail-2Alex Crichton-3/+7
After making `rustc` fail on errors at a stop point, like `-Z parse-only`, in #22117, the files in this PR also fail during the parse stage and should be moved as well. Sorry for spliting this move up in two PRs.
2015-02-18Stabilize Send/Sync.Niko Matsakis-4/+2
2015-02-18Try to write some basic docs.Niko Matsakis-3/+20
2015-02-18std: Implement CString-related RFCsAlex Crichton-290/+555
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18Add deprecated versions of the old markers and integrate them back into the ↵Niko Matsakis-1/+91
variance analysis.
2015-02-18Simplify README by not talking about the source tarball optionBrian Anderson-0/+0
I believe that few enough people build from source tarballs that we don't have to talk about it explicitly.
2015-02-18WIP -- improve documentation on the phantom traitsNiko Matsakis-5/+71
2015-02-18Add rustc_attrs feature to test.Niko Matsakis-0/+1
2015-02-18Always prefer where-clauses over impls in trait selection. Fixes #22110.Niko Matsakis-57/+48
2015-02-18Extend the implicator so it produces general obligations and also soNiko Matsakis-132/+527
that it produces "outlives" relations for associated types. Add several tests relating to #22246.
2015-02-18traits: break apart the "full normalization" code used for normalizingNiko Matsakis-14/+33
parameter environments so that it can be used elsewhere.
2015-02-18Move `tcx` from `Typer` into `ClosureTyper`Niko Matsakis-14/+4
2015-02-18Misc. cleanup in regionck: Remove a one-variant enum for some reason.Niko Matsakis-12/+10
2015-02-18Replace `assert_no_late_bound_regions` withNiko Matsakis-26/+30
`no_late_bound_regions().unwrap()`, which allows us to write code that doesn't necessarily *fail* when there are higher-ranked trait bounds.
2015-02-18Rename various things to "implications"Niko Matsakis-46/+36
2015-02-18Rename regionmanip to implicator.Niko Matsakis-12/+12
2015-02-18For now, accept the `i`, `u`, `is`, and `us` suffixes, but warn whenNiko Matsakis-21/+16
they are used without a feature-gate. This is both kinder to existing code and should make it easier to land this PR, since we don't have to catch EVERY SINGLE SUFFIX.
2015-02-18Fix inconsistent spacing of collapse all buttonSimonas Kazlauskas-2/+1
2015-02-18Style all docblock links properlySimonas Kazlauskas-2/+2
Fixes #22493
2015-02-18make FromIterator use IntoIteratorAlexis-43/+48
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]