into variance inference; fix various bugs in variance inference
so that it considers the correct set of constraints; modify infer to
consider the results of variance inference for type arguments.
The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.
Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.
Benchmarks from #18193
````
running 5 tests
test _range ... bench: 33329 ns/iter (+/- 417)
test assembly ... bench: 33299 ns/iter (+/- 58)
test enumerate ... bench: 33318 ns/iter (+/- 83)
test iter ... bench: 33311 ns/iter (+/- 130)
test position ... bench: 33300 ns/iter (+/- 47)
test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````
Fixes#18193
Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.
The `connect_error` test check if connecting to "0.0.0.0:1" works (it
shouldn't). And in case of error, the test expects a `ConnectionRefused`
error.
Under OpenBSD, trying to connect to "0.0.0.0" isn't a `ConnectionRefused`:
it is an `InvalidInput` error.
The patch allow the error to be `ConnectionRefused` or `InvalidInput`.
Another possibility is to check connecting to "127.0.0.1:1" and expects only `ConnectionRefused` error.
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 makes several changes to `std::thread` in preparation for
final stabilization:
* It removes the ability to handle panics from `scoped` children; see
#20807 for discussion
* It adds a `JoinHandle` structure, now returned from `spawn`, which
makes it possible to join on children that do not share data from
their parent's stack. The child is automatically detached when the
handle is dropped, and the handle cannot be copied due to Posix
semantics.
* It moves all static methods from `std:🧵:Thread` to free
functions in `std::thread`. This was done in part because, due to the
above changes, there are effectively no direct `Thread` constructors,
and the static methods have tended to feel a bit awkward.
* Adds an `io::Result` around the `Builder` methods `scoped` and
`spawn`, making it possible to handle OS errors when creating
threads. The convenience free functions entail an unwrap.
* Stabilizes the entire module. Despite the fact that the API is
changing somewhat here, this is part of a long period of baking and
the changes are addressing all known issues prior to alpha2. If
absolutely necessary, further breaking changes can be made prior to beta.
Closes#20807
[breaking-change]