We now have a really simple function signature:
pub fn from_str_radix_float<T: Float>(src: &str, radix: uint) -> Option<T>
By removing some of the arguments, we remove the possibility of some invalid states.
- The `BytesContainer::container_into_owned_bytes` method has been removed
- Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path:
``` rust
Path::new("foo") // Still works
path.join(another_path) -> path.join(&another_path)
```
[breaking-change]
---
Re: `container_into_owned_bytes`, I've removed it because
- Nothing in the whole repository uses it
- Takes `self` by value, which is incompatible with unsized types (`str`)
The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method.
Re: Breakage of `Path` methods
We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code.
r? @aturon
cc #16918
Add lint for checking exceeding bitshifts #17713
It also const-evaluates the shift width (RHS) to check more complex shifts like `1u8 << (4+5)`.
The lint-level is set to `Warn` but perhaps it must be `Deny` as in llvm exceeding bitshifts are undefined as @ben0x539 stated in #17713
This PR:
* Adds the error interoperation traits (`Error` and `FromError`) to a new module, `std::error`, as per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md). Note that this module must live in `std` in order to refer to `String`.
Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.
* Incorporates `std::error::FromError` into the `try!` macro.
* Implements `Error` for most existing error enumerations.
Closes#17747
If the overloaded method does not have a tuple or unit type as its
first non-self parameter, produce a list of error types with the
correct length to prevent a later index bound panic. This typically
occurs due to propagation of an earlier type error or unconstrained
type variable. Closes#18532
* Moves multi-collection files into their own directory, and splits them into seperate files
* Changes exports so that each collection has its own module
* Adds underscores to public modules and filenames to match standard naming conventions
(that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet)
* Renames PriorityQueue to BinaryHeap
* Renames SmallIntMap to VecMap
* Miscellanious fallout fixes
[breaking-change]
Json's find, find_path, and search methods now use &str rather
than &String.
Json can now be indexed with &str (for Objects) and uint
(for Lists).
Tests updated to reflect this change.
[breaking-change]