Document that associated constants prevent a trait from being made into an object
Fixes https://github.com/rust-lang/rust/issues/47952
Add a short mention of associated constants to E0038
Use time crate in bootstrap dist instead of date
`bootstrap dist` command is trying to run *NIX specific `date` command to get current month and year. This command keep failing when it's called on a Windows command prompt. This patch is making it use time crate.
Closes: #47908
libtest: Replace panics with error messages
This replaces explicit panics on failures in libtest with prints to stderr.
Where "failures" == CLI argument parsing and such
Before:
```
$ ./foo-stable --not-an-option
thread 'main' panicked at '"Unrecognized option: \'not-an-option\'"', libtest/lib.rs:251:27
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
After:
```
$ ./foo-nightly --not-an-option
error: Unrecognized option: 'not-an-option'
```
Document std::os::raw.
This adds a brief explanation to each type and its definition according to C. This also helps clarify that the definitions of the types, as described by rustdoc, are not necessarily the same from platform to platform.
Warn when rustc output conflicts with existing directories
When the compiled executable would conflict with a directory, display a
rustc error instead of a verbose and potentially-confusing linker
error. This is a usability improvement, and doesn’t actually change
behaviour with regards to compilation success. This addresses the
concern in #35887. Fixes#13098.
Previously, when the type of a method receiver could not be determined,
the error message would, potentially confusingly, highlight the span of
the entire method call.
Resolves#36598, resolves#42234.
Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the
case of infinite loops such as those introduced by a loop statement without any
other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator
kind is used when we want borrowck to consider an unwind path, but real control
flow should never actually take it.
This commit adds a new unstable attribute to the compiler which requires that
arguments to a function are always provided as constants. The primary use case
for this is SIMD intrinsics where arguments are defined by vendors to be
constant and in LLVM they indeed must be constant as well.
For now this is mostly just a semantic guarantee in rustc that an argument is a
constant when invoked, phases like trans don't actually take advantage of it
yet. This means that we'll be able to use this in stdsimd but we won't be able
to remove the `constify_*` macros just yet. Hopefully soon though!
save-analysis: avoid implicit unwrap
When looking up a field defintion, since the name might be incorrect in the field init shorthand case.
cc https://github.com/rust-lang-nursery/rls/issues/699
r? @eddyb
Fix info about generic impls in AsMut docs
This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed some additional adjustments for correctness.
add documentation from doc(include) to analysis data
cc #44732
Currently save-analysis only loads docs from plain doc comments and doc attributes. Since `#[doc(include="filename.md")]` doesn't create a plain doc attribute when it loads the file, we need to be sure to pick up this info for the analysis data.
Update clippy and miri submodule
r? @Manishearth
cc @kennytm I needed to touch the miri submodule's Cargo.toml to make sure that clippy gets the newest compiletest_rs. This will not fix miri, but since I touched the miri submodule, will this PR fail?
miri is unfixable until #46882 is merged
Fix overflow when performing drop check calculations in NLL
Clearing out the infcx's region constraints after processing each type
ends up interacting badly with normalizing associated types. This commit
keeps all region constraints intact until the end of
TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized
types are able to re-use existing inference variables.
Fixes#47589
Because the last item needs special handling, it seems that LLVM has trouble canonicalizing the loops in external iteration. With the override, it becomes obvious that the start==end case exits the loop (as opposed to the one *after* that exiting the loop in external iteration).
Fix ref-to-ptr coercions not working with NLL in certain cases
Implicit coercions from references to pointers were lowered to slightly
different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
in certain uses of self-referential structs compiling correctly when an
explicit cast was used, but not when the implicit coercion was used.
To fix this, this commit adds an outer 'Use' expr when applying a
raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
identical to that of explicit coercions, allowing the original code to
compile regardless of how the raw ptr cast occurs.
Fixes#47722
Cleanup the shim code
- We now write directly to `RETURN_PLACE` instead of creating intermediates
- `tuple_like_shim` takes an iterator (used by #47867)
- `tuple_like_shim` no longer relies on it being the first thing to create blocks, and uses relative block indexing in a cleaner way (necessary for #47867)
- All the shim builders take `dest, src` arguments instead of hardcoding RETURN_PLACE
r? @eddyb