Earlier quoted context omitted.
1. It doesn't. 2. The Iterator implementation for RangeInclusive requires the underlying type to implement Step [1], which floats do not. So you can't iterate over a range of floats (although you can still construct one). [1] https://doc.rust-lang.org/nightly/std/iter/trait.Step.html
What do you mean by "it doesn't?" For example say I construct a range [INT_MIN, INT_MAX] which should have a length of 2^32. Am I prohibited from constructing this range?
Announcing Rust 1.35.0
81–90 of 111 posts
Re: Announcing Rust 1.35.0
#82Earlier quoted context omitted.
It is a reference, yes, and without optimization, is a pointer to a value. Your parent is suggesting to not think of it in such a low-level way, and instead think of it as a permission. In this case, the pointer being optimized away makes more sense, as it’s not really about it being a pointer. I’m of two minds about it, to be honest.
If you had a Range then it would make a lot of sense. I can’t remember if Range ’s constraints on T would support that, though.
Re: Announcing Rust 1.35.0
#83Earlier quoted context omitted.
Thank your for the detailed answer. > Attempting to do it completely manually has no benefit that I can see Package managers and build tools can do basically whatever they want - run commands, execute binaries, download data, upload data, send telemetry - whatever any one of the package maintainers wants. I prefer to develop in an offline VM. When a new library is required I just download it using the host machine, c…
I found a comment on /r/rust that details the setup that one guy is using for doing Rust development in an air gapped environment. https://www.reddit.com/r/rust/comments/793evq/using_cargo_on... I do think though, that going down that route might be challenging if you try to do it the first time you are trying to develop in Rust. Furthermore, even then you are starting out with a pre-compiled toolchain and trusting q…
I'm not even sure how many intermediate compilers you'll have to compile to do this, it will take a lot of trial-and-error due to the compiler's own sources relying on features or bugfixes from previous versions of the compiler.
Re: Announcing Rust 1.35.0
#84Are there examples of RefMut::map_split? It seems pretty useful if it does what I think it does.
Re: Announcing Rust 1.35.0
#85Earlier quoted context omitted.
What do you mean by "it doesn't?" For example say I construct a range [INT_MIN, INT_MAX] which should have a length of 2^32. Am I prohibited from constructing this range?
I misinterpreted your comment; I thought you meant ranges that were so large they couldn't fit in any integer type (presumably of floats). But actually, it's weirder than I thought. RangeInclusive doesn't have an inherent len() method, but one is provided by the ExactSizeIterator trait, which is implemented only when the underlying type is i8, u8, i16, or u16. len() always returns usize, regardless of the original ty…
By way of comparison, Swift overflows and returns a length of 0. Oh well.
Re: Announcing Rust 1.35.0
#86Earlier quoted context omitted.
What do you mean by "it doesn't?" For example say I construct a range [INT_MIN, INT_MAX] which should have a length of 2^32. Am I prohibited from constructing this range?
I misinterpreted your comment; I thought you meant ranges that were so large they couldn't fit in any integer type (presumably of floats). But actually, it's weirder than I thought. RangeInclusive doesn't have an inherent len() method, but one is provided by the ExactSizeIterator trait, which is implemented only when the underlying type is i8, u8, i16, or u16. len() always returns usize, regardless of the original ty…
Re: Announcing Rust 1.35.0
#87Earlier quoted context omitted.
> Part of the problem is conceptualizing this as a reference (which, admittedly, it is without optimization). Isn't that also the official name of the feature in Rust? Isn't &T in Rust pronounced "reference to T" and "&mut T" pronounced "mutable reference to T"? That is the impression I get from: https://doc.rust-lang.org/book/ch04-02-references-and-borrow...
It is a reference, yes, and without optimization, is a pointer to a value. Your parent is suggesting to not think of it in such a low-level way, and instead think of it as a permission. In this case, the pointer being optimized away makes more sense, as it’s not really about it being a pointer. I’m of two minds about it, to be honest.
https://www.amazon.com/Rust-Programming-Language-Steve-Klabn...
Re: Announcing Rust 1.35.0
#88Earlier quoted context omitted.
I found a comment on /r/rust that details the setup that one guy is using for doing Rust development in an air gapped environment. https://www.reddit.com/r/rust/comments/793evq/using_cargo_on... I do think though, that going down that route might be challenging if you try to do it the first time you are trying to develop in Rust. Furthermore, even then you are starting out with a pre-compiled toolchain and trusting q…
Don't forget, Rust is written in Rust, so if you want to compile Rust from source because you don't trust the precompiled toolchain, you're in for a very long and arduous journey all the way back to the last version of the compiler written in OCaml, and then compiling a bunch of intermediate compiler versions using the previously-compiled version to inch your way towards the current version. I'm not even sure how man…
Re: Announcing Rust 1.35.0
#89Earlier quoted context omitted.
Don't forget, Rust is written in Rust, so if you want to compile Rust from source because you don't trust the precompiled toolchain, you're in for a very long and arduous journey all the way back to the last version of the compiler written in OCaml, and then compiling a bunch of intermediate compiler versions using the previously-compiled version to inch your way towards the current version. I'm not even sure how man…
It’s around a thousand builds.
Re: Announcing Rust 1.35.0
#90Earlier quoted context omitted.
I found a comment on /r/rust that details the setup that one guy is using for doing Rust development in an air gapped environment. https://www.reddit.com/r/rust/comments/793evq/using_cargo_on... I do think though, that going down that route might be challenging if you try to do it the first time you are trying to develop in Rust. Furthermore, even then you are starting out with a pre-compiled toolchain and trusting q…
Don't forget, Rust is written in Rust, so if you want to compile Rust from source because you don't trust the precompiled toolchain, you're in for a very long and arduous journey all the way back to the last version of the compiler written in OCaml, and then compiling a bunch of intermediate compiler versions using the previously-compiled version to inch your way towards the current version. I'm not even sure how man…