| Age | Commit message (Collapse) | Author | Lines |
|
The name of NativeLib will be presented
Fixes #109144
I was working on a quick fix, but found change the name from `Option<Symbol>` to `Symbol` make life a little bit easier.
|
|
fix: don't suggest similar method when unstable
Fixes #109177
Don't display typo suggestions for unstable things, unless the feature flag is enabled.
AFAIK, there are two places this occurs:
- `rustc_resolve`: before type checking, effectively just `FnCtxt::Free`.
- `rustc_hir_typck`: during type checking, for `FnCtxt::Assoc(..)`s.
The linked issue is about the latter, obviously the issue is applicable to both.
r? `@estebank`
|
|
r=cjgillot
Add `useless_anonymous_reexport` lint
This is a follow-up of https://github.com/rust-lang/rust/pull/108936. We once again show all anonymous re-exports in rustdoc, however we also wanted to add a lint to let users know that it very likely doesn't have the effect they think it has.
|
|
Add note for mismatched types because of circular dependencies
If you have crate A with a dependency on crate B, and crate B with a dev-dependency on A, then you might see "mismatched types" errors on types that seem to be equal. This PR adds a note that explains that the types are different, because crate B is compiled twice, one time with `cfg(test)` and one time without.
I haven't found a good way to create circular dependencies in UI tests, so I abused the incremental tests instead. As a bonus, incremental tests support "cpass" now.
related to https://github.com/rust-lang/rust/issues/22750
|
|
Allow using `Range` as an `Iterator` in const contexts.
~~based on #102225 by `@fee1-dead~~`
|
|
|
|
This reverts commit 4a04d086cac54a41517d5657b59d5fe2caca2d71, reversing
changes made to 2d0a7def330ed90f416a3429dbb44c5ee2a914e5.
|
|
Upgrade to LLVM 16
This updates Rust to LLVM 16. It also updates our host compiler for dist-x86_64-linux to LLVM 16. The reason for that is that Bolt from LLVM 15 is not capable of compiling LLVM 16 (https://github.com/llvm/llvm-project/issues/61114).
LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1.
Tested images: `dist-x86_64-linux`, `dist-riscv64-linux` (alt), `dist-x86_64-illumos`, `dist-various-1`, `dist-various-2`, `dist-powerpc-linux`, `wasm32`, `armhf-gnu`
Tested images until the usual IPv6 failures: `test-various`
|
|
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty
This PR stops reporting errors due to different count of generics on the new synthesized associated types for RPITITs. Those were already reported when we compare the function on the triat with the function on the impl.
r? ``@compiler-errors``
|
|
Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests
Needs to go on top of #109198
r? ``@compiler-errors``
|
|
Error code E0794 for late-bound lifetime parameter error.
This PR addresses [#80618](https://github.com/rust-lang/rust/issues/80618).
|
|
implement const Iterator and DoubleEndedIterator for Range.
|
|
|
|
Suggest surrounding the macro with `{}` to interpret as a statement
Fixes #109237
|
|
Pass the right HIR back from `get_fn_decl`
Fixes #109232
Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...
This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
|
|
Do not ICE for unexpected lifetime with ConstGeneric rib
Fixes #109143
r? ````@petrochenkov````
Combining this test with the previous test will affect the previous diagnostics, so I added a separate test case.
|
|
Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer`
Fixes #109191
|
|
r=jackh726
Erase escaping late-bound regions when probing for ambiguous associated types
Fixes #109090
|
|
|
|
|
|
-Zlower-impl-trait-in-trait-to-assoc-ty
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #108958 (Remove box expressions from HIR)
- #109044 (Prevent stable `libtest` from supporting `-Zunstable-options`)
- #109155 (Fix riscv64 fuchsia LLVM target name)
- #109156 (Fix linker detection for clang with prefix)
- #109181 (inherit_overflow: adapt pattern to also work with v0 mangling)
- #109198 (Install projection from RPITIT to default trait method opaque correctly)
- #109215 (Use sort_by_key instead of sort_by)
- #109229 (Fix invalid markdown link references)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Make sure that the loop is not fully unrolled (which allows
eliminating the allocas) in LLVM 16 either.
|
|
Use index based drop loop for slices and arrays
Instead of building two kinds of drop pair loops, of which only one will be eventually used at runtime in a given monomorphization, always use index based loop.
|
|
Install projection from RPITIT to default trait method opaque correctly
1. For new lowering strategy `-Zlower-impl-trait-in-trait-to-assoc-ty`, install the correct default trait method projection predicates (RPITIT -> opaque). This makes default trait body tests pass!
2. Fix two WF-checking bugs -- first, we want to make sure that we're always looking for an opaque type in `check_return_position_impl_trait_in_trait_bounds`. That's because the RPITIT projections are normalized to opaques during wfcheck. Second, fix RPITIT's param-envs by not adding the projection predicates that we install on trait methods to make default RPITITs work -- I left a comment why.
3. Also, just a small drive-by for `rustc_on_unimplemented`. Not sure if it affects any tests, but can't hurt.
r? ````@spastorino,```` based off of #109140
|
|
inherit_overflow: adapt pattern to also work with v0 mangling
This test was failing under new-symbol-mangling = true. Adapt pattern to work in both cases.
Related to #106002 from December.
|
|
|
|
|
|
Wrap the whole LocalInfo in ClearCrossCrate.
MIR contains a lot of information about locals. The primary purpose of this information is the quality of borrowck diagnostics.
This PR aims to drop this information after MIR analyses are finished, ie. starting from post-cleanup runtime MIR.
|
|
Replace ZST operands and debuginfo by constants.
This is work that ConstProp will not have to do.
Split from https://github.com/rust-lang/rust/pull/107267
|
|
Flatten/inline format_args!() and (string and int) literal arguments into format_args!()
Implements https://github.com/rust-lang/rust/issues/78356
Gated behind `-Zflatten-format-args=yes`.
Part of #99012
This change inlines string literals, integer literals and nested format_args!() into format_args!() during ast lowering, making all of the following pairs result in equivalent hir:
```rust
println!("Hello, {}!", "World");
println!("Hello, World!");
```
```rust
println!("[info] {}", format_args!("error"));
println!("[info] error");
```
```rust
println!("[{}] {}", status, format_args!("error: {}", msg));
println!("[{}] error: {}", status, msg);
```
```rust
println!("{} + {} = {}", 1, 2, 1 + 2);
println!("1 + 2 = {}", 1 + 2);
```
And so on.
This is useful for macros. E.g. a `log::info!()` macro could just pass the tokens from the user directly into a `format_args!()` that gets efficiently flattened/inlined into a `format_args!("info: {}")`.
It also means that `dbg!(x)` will have its file, line, and expression name inlined:
```rust
eprintln!("[{}:{}] {} = {:#?}", file!(), line!(), stringify!(x), x); // before
eprintln!("[example.rs:1] x = {:#?}", x); // after
```
Which can be nice in some cases, but also means a lot more unique static strings than before if dbg!() is used a lot.
|
|
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #108875 (rustdoc: fix type search for `Option` combinators)
- #108971 (error-msg: impl better suggestion for `E0532`)
- #109139 (rustdoc: DocFS: Replace rayon with threadpool and enable it for all targets)
- #109151 (Assert def-kind is correct for alias types)
- #109158 (error-msg: expand suggestion for `unused_def` lint)
- #109166 (make `define_opaque_types` fully explicit)
- #109171 (Some cleanups in our normalization logic)
- #109180 (Unequal → Not equal)
- #109185 (rustdoc: remove `std::` from primitive intra-doc link tooltips)
- #109192 (Mention UEFI target promotion in release notes for 1.67.0)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
panic!("a {}", "b") is still not allowed in const,
even if the hir flattens to panic!("a b").
|
|
rustdoc: remove `std::` from primitive intra-doc link tooltips
Take the intra-doc link to the method `iter` from https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html
Before: `method std::slice::iter`
After: `method slice::iter`
|
|
error-msg: expand suggestion for `unused_def` lint
Fixes #108885
Expands `let _ = ..` suggestion into more positions.
|
|
error-msg: impl better suggestion for `E0532`
Fixes #106862
No test as there is already a test which is nearly identical to the example in the linked issue.
|
|
rustdoc: fix type search for `Option` combinators
|
|
fix ignore header in MSVC test
From `@pietroalbini's` [zulip message](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/better.20compiletest.20ignore.20messages/near/339845864)
> there are tests like `tests/ui/panic-runtime/unwind-tables-target-required.rs` which have `only-x86_64-windows-msvc` which I'm pretty sure is invalid
This test is currently ignored on x64 MSVC CI because of this incorrect target. We'll see if it still passes.
r? `@pietroalbini`
|
|
|
|
Revert #107376 to fix potential `bincode` breakage and `rustc-perf` benchmark.
#107376 caused `rustc-perf`'s `webrender` benchmark to break, by regressing on the `bincode-1.3.3` crate.
~~This PR is a draft revert in case we can't land a fix soon enough, and we'd like to land the revert instead~~
(Though I myself think it'd be safer to do the revert, and run crater when relanding #107376.)
cc `@aliemjay`
|
|
type's param-env
|
|
|
|
Implement checked Shl/Shr at MIR building.
This does not require any special handling by codegen backends,
as the overflow behaviour is entirely determined by the rhs (shift amount).
This allows MIR ConstProp to remove the overflow check for constant shifts.
~There is an existing different behaviour between cg_llvm and cg_clif (cc `@bjorn3).`
I took cg_llvm's one as reference: overflow if `rhs < 0 || rhs > number_of_bits_in_lhs_ty`.~
EDIT: `cg_llvm` and `cg_clif` implement the overflow check differently. This PR uses `cg_llvm`'s implementation based on a `BitAnd` instead of `cg_clif`'s one based on an unsigned comparison.
|
|
|
|
|