| Age | Commit message (Collapse) | Author | Lines |
|
Forbid nested opaque types to reference HRTB from opaque types.
Avoids https://github.com/rust-lang/rust/issues/96194
Alternative to https://github.com/rust-lang/rust/pull/96970
r? `@oli-obk`
|
|
|
|
Initial work on Miri permissive-exposed-provenance
Rustc portion of the changes for portions of a permissive ptr-to-int model for Miri. The main changes here are changing `ptr_get_alloc` and `get_alloc_id` to return an Option, and also making ptr-to-int casts have an expose side effect.
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #95365 (Use default alloc_error_handler for hermit)
- #96986 ([save-analysis] Reference the variant not enum at struct-literal cons…)
- #96998 (rustdoc: remove weird, unused variable from source-files.js)
- #97005 (Two small improvements of rustc_expand)
- #97018 (Ensure that test fail if a JS error occurs)
- #97031 (Drop tracking: handle invalid assignments better)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Drop tracking: handle invalid assignments better
Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
|
|
Fix `array::IntoIter::fold` to use the optimized `Range::fold`
It was using `Iterator::by_ref` in the implementation, which ended up pessimizing it enough that, for example, it didn't vectorize when we tried it in the <https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/Reducing.20sum.20into.20wider.20types> conversation.
Demonstration that the codegen test doesn't pass on the current nightly: <https://rust.godbolt.org/z/Taxev5eMn>
|
|
Previously this test case was crashing with an index out of bounds error
deep in the call to `needs_drop`. We avoid this by detecting clearly
invalid assignees in the `mutate` callback and ignoring these.
|
|
|
|
Add regression test for #28935
Closes #28935, one of the ancient issues can be closed :)
r? `@compiler-errors`
|
|
Add a regression test for #54779
Closes #54779
r? `@jackh726`
|
|
|
|
bounds
|
|
|
|
rustdoc: fix GUI crash when searching for magic JS property values
|
|
Be more precise than DefPathData::Misc.
This variant was used for two unrelated things. Let's make this cleaner.
|
|
Add test of matches macro for trailing commas
Almost all macros are tested for trailing commas.
The macro matches! was however not tested.
This PR adds that test case.
Related to #46238
|
|
|
|
|
|
|
|
Add tests for #96806
I messed up the rebase in https://github.com/rust-lang/rust/pull/96806.
I took the opportunity to add an extra mir-opt test from https://github.com/rust-lang/rust/pull/91743.
r? `@oli-obk`
|
|
Fix settings page CSS
In https://github.com/rust-lang/rust/pull/96741, I moved the CSS loading outside of `settings.js`. The result was that on the settings page, there isn't the settings CSS anymore:

I also used this opportunity to remove unused CSS rules (we don't have `<select>` elements anymore in the settings).
cc `@jsha`
r? `@notriddle`
|
|
|
|
davidtwco:diagnostic-translation-unit-and-more-porting, r=oli-obk
diagnostics: port more diagnostics to derive + support for `()` fields
- Extend diagnostic derive so that spanless subdiagnostics (e.g. some uses of `help`/`note`) can be applied via attributes to fields of type `()` (currently spanless subdiagnostics are applied via attributes on the diagnostic struct itself). A consequence of this is that `Option<()>` fields can be used to represent optional spanless subdiagnostics, which are sometimes useful (e.g. for a `help` that should only show on nightly builds).
- Simplify the "explicit generic args with impl trait" diagnostic struct (from #96760) using support for `Option<()>` spanless subdiagnostics.
- Change `DiagnosticBuilder::set_arg`, used to provide context for Fluent messages, so that it takes anything that implements `IntoDiagnosticArg`, rather than `DiagnosticArgValue` - this improves the ergonomics of manual implementations of `SessionDiagnostic` which are translatable.
- Port "the type parameter `T` must be explicitly specified", "manual implementations of `X` are experimental", "could not resolve substs on overridden impl" diagnostics to diagnostic structs.
- When testing macros from `rustc_macros` in `ui-fulldeps` tests, sometimes paths from the compiler source tree can be shown in error messages - these need to be normalized in `compiletest`.
r? `@oli-obk`
cc `@pvdrz`
|
|
|
|
r=estebank
Stop suggesting non-existing fully qualified paths
This patch fixes a part of #96295.
r? `@estebank`
|
|
Manual implementors of translatable diagnostics will need to call
`set_arg`, not just the derive, so make this function a bit more
ergonomic by taking `IntoDiagnosticArg` rather than
`DiagnosticArgValue`.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Type attributes could previously be used to support spanless
subdiagnostics but these couldn't easily be made optional in the same
way that spanned subdiagnostics could by using a field attribute on a
field with an `Option<Span>` type. Spanless subdiagnostics can now be
specified on fields with `()` type or `Option<()>` type.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Add `sub_ptr` on pointers (the `usize` version of `offset_from`)
We have `add`/`sub` which are the `usize` versions of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`.
As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change.
This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
|
|
|
|
|
|
Like we have `add`/`sub` which are the `usize` version of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`.
As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change.
This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
|
|
Implement a lint to warn about unused macro rules
This implements a new lint to warn about unused macro rules (arms/matchers), similar to the `unused_macros` lint added by #41907 that warns about entire macros.
```rust
macro_rules! unused_empty {
(hello) => { println!("Hello, world!") };
() => { println!("empty") }; //~ ERROR: 1st rule of macro `unused_empty` is never used
}
fn main() {
unused_empty!(hello);
}
```
Builds upon #96149 and #96156.
Fixes #73576
|
|
Gracefully fail to resolve associated items instead of `delay_span_bug`.
`codegen_fulfill_obligation` is used during instance resolution for trait items.
In case of insufficient normalization issues during MIR inlining, it caused ICEs.
It's better to gracefully refuse to resolve the associated item, and let the caller decide what to do with this.
Split from https://github.com/rust-lang/rust/pull/91743
Closes #69121
Closes #73021
Closes #88599
Closes #93008
Closes #93248
Closes #94680
Closes #96170
r? `@oli-obk`
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #96543 (Remove hacks in `make_token_stream`.)
- #96887 (rustdoc: correct path to type alias methods)
- #96896 (Add regression test for #68408)
- #96900 (Fix js error)
- #96903 (Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes)
- #96916 (simplify length count)
- #96925 (Fix issue #95151)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Fix issue #95151
Fixes #95151
Nothing special here, just a test for a thing that used to ICE.
|
|
r=compiler-errors
Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes
fixes https://github.com/rust-lang/rust/issues/96564
TLDR:
```rust
fn execute(ty: Ty<'_>) -> &str { todo!() }
```
(`Ty` being a type alias impl trait) used to produce the following error before this PR
```
error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
--> src/lib.rs:4:27
|
4 | fn execute(ty: Ty<'_>) -> &str { todo!() }
| ^^^^
|
= note: lifetimes appearing in an associated type are not considered constrained
```
|
|
Fix js error
On the source code pages, we get a JS error:

It's fixed in the first commit. The second one is removing an unused CSS rule and the third one is a little cleanup of a GUI test.
cc ``@jsha``
r? ``@notriddle``
|
|
Add regression test for #68408
Closes https://github.com/rust-lang/rust/issues/68408
|
|
rustdoc: correct path to type alias methods
Fixes #83991
|
|
Use `FxIndexSet` to avoid sorting fake borrows
This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test
The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)
|
|
This isn't an ordering test really, anyway...
|
|
|
|
This removes a special case that doesn't seem to do anything
any more.
|
|
Rollup of 6 pull requests
Successful merges:
- #96717 (Handle mismatched generic param kinds in trait impls betterly)
- #96725 (Expose process windows_process_extensions_main_thread_handle on Windows)
- #96849 (Move some tests to more reasonable places)
- #96861 (Use Rust 2021 prelude in std itself.)
- #96879 (rustdoc: search result ranking fix)
- #96882 (Don't subst an AdtDef with its own substs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustdoc: search result ranking fix
# Before

# After

|