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.
Turn implied_outlives_bounds into a query
Right now all this does is remove the error reporting in `implied_outlives_bounds`, which seems to work. Farming out full tests to Travis.
For #51649. That issue is deferred so not sure what's next.
r? @nikomatsakis
[NLL] Mutability errors
cc #51028
cc #51170
cc #46559Closes#46629
* Better explain why the place is immutable ("immutable item" is gone)
* Distinguish &T and *const T
* Use better spans when a mutable borrow is for a closure capture
r? @pnkfelix
resolve: Some renaming, refactoring and comments
Commits are self-descriptive.
The only functional change is 34bf2f572e that tightens shadowing rules for macro paths (makes the second and third cases in `test/ui/imports/glob-shadowing.rs` an error).
Prepare proc_macro for decoupling it from the rest of the compiler.
This is #49219 up to the point where the bridge is introduced. Aside from moving some code around, the largest change is the rewrite of `proc_macro::quote` to be simpler and do less introspection.
I'd like to also extend `quote!` with `${stmt;...;expr}` instead of just `$variable` (and maybe even `$(... $iter ...)*`), which seems pretty straight-forward now, but I don't know if/when I should.
r? @alexcrichton or @dtolnay cc @jseyfried @petrochenkov
proc_macro: Preserve spans of attributes on functions
This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.
Closes#47941
Calculate Vec capacities in librustc
Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.
Fix docker/run.sh script when run locally
Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.
rustc: Fix two custom attributes with custom derive
This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.
The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.
Closes#52525
rustc: Remove a workaround in ThinLTO fixed upstream
This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!
[1]: https://bugs.llvm.org/show_bug.cgi?id=35736
fix unsafety: don't call ptr_rotate for ZST
`rotate::ptr_rotate` has a comment saying
```
/// # Safety
///
/// The specified range must be valid for reading and writing.
/// The type `T` must have non-zero size.
```
So we better make sure we don't call it on ZST...
Cc @scottmcm (author of https://github.com/rust-lang/rust/pull/41670)