This commit exposes the `is_sep` function and `MAIN_SEP` constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.
Exposing the prefix enum as part of prefix components involved changing
the type from `OsStr` to the `Prefix` enum, which is a:
[breaking-change]
This aligns json target specification to match terminology used elsewhere in the code base.
[breaking-change] for custom target json users. Change all appearances of target-word-size
to target-pointer-width.
* Move the type parameter on the `AsciiExt` trait to an associated type named
`Owned`.
* Move `ascii::escape_default` to using an iterator.
This is a breaking change due to the removal of the type parameter on the
`AsciiExt` trait as well as the modifications to the `escape_default` function
to returning an iterator. Manual implementations of `AsciiExt` (or `AsciiExt`
bounds) should be adjusted to remove the type parameter and using the new
`escape_default` should be relatively straightforward.
[breaking-change]
This commit performs a stabilization pass over the `std::ascii` module taking
the following actions:
* the module name is now stable
* `AsciiExt` is now stable after moving its type parameter to an `Owned`
associated type
* `AsciiExt::is_ascii` is now stable
* `AsciiExt::to_ascii_uppercase` is now stable
* `AsciiExt::to_ascii_lowercase` is now stable
* `AsciiExt::eq_ignore_ascii_case` is now stable
* `AsciiExt::make_ascii_uppercase` is added to possibly replace
`OwnedAsciiExt::into_ascii_uppercase` (similarly for lowercase variants).
* `escape_default` now returns an iterator and is stable
* `EscapeDefault` is now stable
Trait implementations are now also marked stable.
Primarily it is still unstable to *implement* the `AsciiExt` trait due to it
containing some unstable methods.
[breaking-change]
Previously an implementation of a stable trait allows implementations of
unstable methods. This updates the stability pass to ensure that all items of an
impl block of a trait are indeed stable on the trait itself.
This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III.
Conflicts:
src/doc/trpl/macros.md
Pass features along during expansion
Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled.
Fix#22234.
----
Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-`box` and placement-`in` (#22181).
----
This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a:
[breaking-change]
Some examples for `std::num::Float`
~~This is WIP for making examples for `f32`. This probably won't pass `make tidy` and I'm not sure which `f32` needs documentation. https://github.com/rust-lang/rust/issues/22025 shows 2 sets of `f32` which seems split between `core` and `std`. I'm not sure which should be documented but I started doing a couple from `std`. Easy to move if that's where they go...~~
~~Gotta build it eventually to actually see if the docs actually appear where I think they will or if I'm just disillusioned.~~
cc @steveklabnik
The test \"signal_reported_right\" send a signal `1` to `/bin/sh`, and check
the status code to check if the signal is reported right.
Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`,
resulting the test failed.
Use the uncatchable signal `9` (`SIGKILL`) for test.
This commit mostly replaces some of the uses of os::args with env::args.
This, for obvious reasons is based on top of #22400. Do not r+ before that lands.
When matching against strings/slices, we call the comparison function
for strings, which takes two string slices by value. The slices are
passed in memory, and currently we just pass in a pointer to the
original slice. That can cause misoptimizations because we emit a call
to llvm.lifetime.end for all by-value arguments at the end of a
function, which in this case marks the original slice as dead.
So we need to properly create copies of the slices to pass them to the
comparison function.
Fixes#22008
This redux of CONTRIBUTING.md adds in more information, including
subsuming both compliment-bugreport.md and Note-development-policy
in the wiki.
I only glanced at the broad TOC of Note-development-policy, and did
not use the text as the basis for the re-write. This will then address
the last outstanding part of #5831.
The first commit adds a short note which I believe will reduce worries in people who work with closures very often and read the Rust book for their first time.
The second commit consists solely of tiny typo fixes. In some cases, I changed "logical" quotations like
She said, "I like programming".
to
She said, "I like programming."
because the latter seems to be the prevalent style in the book.
Changes std::os::errno to return i32, the return type used by the function being delegated to.
This is my first contribution, so feel free to give me advice. I'll be happy to correct things.
Since `tr` converts lowercase to uppercase according to system locale using `LC_CTYPE` environment variable; on some locales, rustup.sh fails to use correct variables names, thus deletes temporarily downloaded files and gives a meaningless error as shown below. This a simple fix which explictly sets `LC_CTYPE` as `C`.
Here is what happens without the fix:
```
➜ projects curl -s https://static.rust-lang.org/rustup.sh | sudo sh
rustup: CFG_CURL := /usr/bin/curl (7.22.0)
rustup: CFG_TAR := /bin/tar (1.26)
rustup: CFG_FILE := /usr/bin/file (5.09)
rustup: CFG_SHA256SUM := /usr/bin/sha256sum (256sum)
rustup: CFG_SHASUM := /usr/bin/shasum (5.61)
rustup:
rustup: processing sh args
rustup:
rustup: CFG_PREFiX :=
rustup: CFG_DATE :=
rustup:
rustup: validating sh args
rustup:
rustup: host triple: i686-unknown-linux-gnu
rustup: Downloading https://static.rust-lang.org/dist/rust-nightly-i686-unknown-linux-gnu.tar.gz to /tmp/tmp.Wz6F1ToG5z/rust-nightly-i686-unknown-linux-gnu.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 132M 100 132M 0 0 59947 0 0:38:31 0:38:31 --:--:-- 71204
rustup: Downloading https://static.rust-lang.org/dist/rust-nightly-i686-unknown-linux-gnu.tar.gz.sha256
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 109 100 109 0 0 107 0 0:00:01 0:00:01 --:--:-- 169
rustup: Verifying hash
rustup: Extracting /tmp/tmp.Wz6F1ToG5z/rust-nightly-i686-unknown-linux-gnu.tar.gz
install: looking for install programs
install:
install: found mkdir
install: found printf
install: found cut
install: found grep
install: found uname
install: found tr
install: found sed
install: found chmod
install:
install: processing /tmp/tmp.Wz6F1ToG5z/rust-nightly-i686-unknown-linux-gnu/install.sh args
install:
install: CFG_DESTDiR :=
install: CFG_PREFiX := /usr/local
install: CFG_LiBDiR := /lib
install: CFG_MANDiR := /share/man
install:
install: validating /tmp/tmp.Wz6F1ToG5z/rust-nightly-i686-unknown-linux-gnu/install.sh args
install:
install: verifying platform can run binaries
install: verifying destination is writable
mkdir: cannot create directory `': No such file or directory
install: error: can't write to destination. consider `sudo`.
rustup: error: failed to install Rust
```
Notice how `i` wasn't replaced with `I`.
Rust is installed as usual after the fix. Tested on Ubuntu x86 12.04 LTS.
I'm not exactly sure if setting LC_CTYPE is the best solution, but there's that.
Since we don’t have Deprecated stability level anymore, the only other source of information is
deprecated-since version, which conveniently to us, only exists if the symbol is deprecated.
Fixes#21789
`IntoIterator` now has an extra associated item:
``` rust
trait IntoIterator {
type Item;
type IntoIter: Iterator<Self=Self::Item>;
}
```
This lets you bind the iterator \"`Item`\" directly when writing generic functions:
``` rust
// hypothetical change, not included in this PR
impl Extend<T> for Vec<T> {
// you can now write
fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. }
// instead of
fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. }
}
```
The downside is that now you have to write an extra associated type in your `IntoIterator` implementations:
``` diff
impl<T> IntoIterator for Vec<T> {
+ type Item = T;
type IntoIter = IntoIter<T>;
fn into_iter(self) -> IntoIter<T> { .. }
}
```
Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change]
---
r? @aturon
`cp -a` is a GNU extension. Use an alternate combinaison of POSIX options
(`-PRp`) that do nearly the same.
The difference is `-a` will preserve context, links and xattr attributes,
whereas `-p` not. But as we use it only for copy a file, there is no
difference in the current context.