Rollup of 11 pull requests
Successful merges:
- #51807 (Deprecation of str::slice_unchecked(_mut))
- #52051 (mem::swap the obvious way for types smaller than the SIMD optimization's block size)
- #52465 (Add CI test harness for `thumb*` targets. [IRR-2018-embedded])
- #52507 (Reword when `_` couldn't be inferred)
- #52508 (Document that Unique::empty() and NonNull::dangling() aren't sentinel values)
- #52521 (Fix links in rustdoc book.)
- #52581 (Avoid using `#[macro_export]` for documenting builtin macros)
- #52582 (Typo)
- #52587 (Add missing backtick in UniversalRegions doc comment)
- #52594 (Run the error index tool against the sysroot libdir)
- #52615 (Added new lines to .gitignore.)
Added new lines to .gitignore.
There are a handful of files that I often find in my local working directories that I never want to commit that aren't covered in the `.gitignore` file:
`/mir_dump`:
Default output location from `-Z mir-dump=all` for a specific test, I can't think of a reason why this should ever be commited.
`tags*`/`TAGS*`:
I use `vim-gutentags` which outputs `tags` and `tags.temp` which I don't want commited. I also collapsed the `TAGS`, `TAGS.vi`, `TAGS.emacs` into `TAGS*`.
`Session.vim`:
I use `vim-obsession` to save my current session in Vim, it outputs a `Session.vim` file, this also shouldn't be commited.
Run the error index tool against the sysroot libdir
Previously when building the error index tool in stage 0 we would
attempt to use stage 0 libraries, but because it depends on rustdoc,
those don't exist: rustdoc is built against stage 1 libraries.
This patch aligns those two and passes the stage 1 libdir to the error
index.
@GuillaumeGomez discovered that this hasn't worked (presumably for a long time now, but not sure).
r? @alexcrichton
Ever plagued by #43081 the compiler can return surprising spans in situations
related to procedural macros. This is exhibited by #47983 where whenever a
procedural macro is invoked in a nested item context it would fail to have
correct span information.
While #43230 provided a "hack" to cache the token stream used for each item in
the compiler it's not a full-blown solution. This commit continues to extend
this "hack" a bit more to work for nested items.
Previously in the parser the `parse_item` method would collect the tokens for an
item into a cache on the item itself. It turned out, however, that nested items
were parsed through the `parse_item_` method, so they didn't receive similar
treatment. To remedy this situation the hook for collecting tokens was moved
into `parse_item_` instead of `parse_item`.
Afterwards the token collection scheme was updated to support nested collection
of tokens. This is implemented by tracking `TokenStream` tokens instead of
`TokenTree` to allow for collecting items into streams at intermediate layers
and having them interleaved in the upper layers.
All in all, this...
Closes#47983
The existing elided-lifetimes-in-paths lint (introduced in Nov. 2017's
accd997b5 / #46254) lacked stuctured suggestions and—much more
alarmingly—produced false positives on associated functions (like
`Ref::clone`) and on anonymous '_ lifetimes (!!—yes, the very
anonymous lifetimes that we meant to suggest "instead"). That this
went apparently unnoticed for so long maybe tells you something about
how many people actually bother to flip on allow-by-default lints.
After many hours of good old-fashioned American elbow grease—and a
little help from expert reviewers—it turns out that getting the right
answer is a lot easier if we fire the lint while lowering the Higher
Intermediate Representation.
The lint is promoted to the idioms-2018 group.
Also, in the matter of test filenames, "elided" only has one 'l' (see,
e.g., https://en.wiktionary.org/wiki/elide).
Resolves#52041.
Document that Unique::empty() and NonNull::dangling() aren't sentinel values
The documentation of Unique::empty() and NonNull::dangling() could
potentially suggest that they work as sentinel values indicating a
not-yet-initialized pointer. However, they both declare a non-null
pointer equal to the alignment of the type, which could potentially
reference a valid value of that type (specifically, the first such valid
value in memory). Explicitly document that the return value of these
functions does not work as a sentinel value.
Add CI test harness for `thumb*` targets. [IRR-2018-embedded]
This pull request will do the following (rather trivial) changes:
- Fix#52163. In other words, we enabled `./x.py test src/test/run-make` for `no_std` targets.
- Modify `dist-various-1` Dockerfile.
- CI now performs `run-make` test run on the targets below:
- `thumbv6m-none-eabi`
- `thumbv7m-none-eabi`
- `thumbv7em-none-eabi`
- `thumbv7em-none-eabihf`.
- ~~Add `thumb-none` Dockerfile.~~
- ~~Initially, `thumbv7m-none-eabi`, `thumbv7em-none-eabi` and `thumbv7em-none-eabihf` are included as the tested target. `thumbv6m-none-eabi` is disabled for now because LLVM support is not certain.~~
- ~~Add `thumb-none` to .travis.yml~~
Note:
- `run-make` tests are not implemented yet. This PR is test harness only.
The amount of change is very small, but I'd like to open the pull request while the change is trivial.
Because I'm not very used to pull request process, I want to make a small progress first. This PR will be a foundation for later additions.
CC @kennytm @jamesmunns @nerdyvaishali
Deprecation of str::slice_unchecked(_mut)
Closes#51715
I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0.
Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.
[NLL] Small move error reporting improvements
* Use a MirBorrowckContext when reporting errors to be more uniform with other error reporting
* Add a special message for the case of trying to move from capture variables in `Fn` and `FnMut` closures.
part of #51028
Improve suggestion for missing fmt str in println
Avoid using `concat!(fmt, "\n")` to improve the diagnostics being
emitted when the first `println!()` argument isn't a formatting string
literal.
Fix#52347.
LLVM isn't able to remove the alloca for the unaligned block in the SIMD tail in some cases, so doing this helps SRoA work in cases where it currently doesn't. Found in the `replace_with` RFC discussion.
Speed up `SparseBitMatrix` use in `RegionValues`.
In practice, these matrices range from 10% to 90%+ full once they are
filled in, so the dense representation is better.
This reduces the runtime of Check Nll builds of `inflate` by 32%, and
several other benchmarks by 1--5%.
It also increases max-rss of `clap-rs` by 30% and a couple of others by
up to 5%, while decreasing max-rss of `coercions` by 14%. I think the
speed-ups justify the max-rss increases.
r? @nikomatsakis
This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than once—at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never
"constructed" specifically for enum variants. More recently, the same
issue was raised for structs (#52325). It seems consistent to say
"constructed" here, too, for the same reasons.
We considered using more specific word "called" for unused functions
and methods (while we declined to do this in #46103, the rationale
given in the commit message doesn't actually make sense), but it turns
out that Cargo's test suite expects the "never used" message, and
maybe we don't care enough even to make a Cargo PR over such a petty
and subjective wording change.
This resolves#52325.