| Age | Commit message (Collapse) | Author | Lines |
|
Followups for method call error change
Each commit is self-contained. Fixes most of the followup reviews from that PR.
r? `@estebank`
|
|
r=Mark-Simulacrum
Make the test `check-pass` not to produce a JSON file
`run-pass` produces a JSON file when enabling save analysis.
The original ICE happened on `cargo check`, moreover **without** the `generic_const_exprs` feature, so `check-pass` should be enough.
|
|
Add regression and bug tests
this tracks the behaviour from https://github.com/rust-lang/rust/issues/96572 in our test suite
|
|
Add regression test
fixes #69785
This issue seems to have been fixed in the meantime.
|
|
diagnostics: port more diagnostics to derive + add support for `Vec` fields
- Port "unconstrained opaque type" diagnostic to using the derive.
- Allow `Vec` fields in diagnostic derive - enables support for diagnostics that have multiple primary spans, or have subdiagnostics repeated at multiple locations. `Vec<..>` fields in the diagnostic derive become loops in the generated code.
- Add `create_{err,warning}` - there wasn't a way to create a diagnostic from a struct and not emit it straight away.
- Port "explicit generic args w/ impl trait" diagnostic to using the derive.
r? `````@oli-obk`````
cc `````@pvdrz`````
|
|
Fix jump to def regression
https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it.
Nice side-effect: it adds a new regression test. :)
I also used this opportunity to add documentation about this unstable feature in the rustdoc book.
cc ``@cjgillot``
r? ``@notriddle``
|
|
make Size and Align debug-printing a bit more compact
In particular in `{:#?}`-mode, these take up a lot of space, so I think this is the better alternative (even though it is a bit longer in `{:?}` mode, I think it is still more readable).
We could make it even smaller by deviating further from what the actual code looks like, e.g. via something like `Size(4 bytes)`. Not sure what people would think about that?
Cc `````@oli-obk`````
|
|
Rollup of 8 pull requests
Successful merges:
- #96660 ([bootstrap] Give a better error when trying to run a path with no registered step)
- #96701 (update `jemallocator` example to use 2018 edition import syntax)
- #96746 (Fix an ICE on #96738)
- #96758 (bootstrap: bsd platform flags for split debuginfo)
- #96778 (Remove closures on `expect_local` to apply `#[track_caller]`)
- #96781 (Fix an incorrect link in The Unstable Book)
- #96783 (Link to correct issue in issue-95034 known-bug)
- #96801 (Add regression test for #96319)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add regression test for #96319
|
|
Link to correct issue in issue-95034 known-bug
fix a typo is issue number: 94034 -> 95034
|
|
Fix an ICE on #96738
In the block we don't know if the method actually exists thus `expect_local` panics.
Fixes #96738
Fixes #96583
|
|
|
|
|
|
|
|
r=cjgillot
Remove ItemLikeVisitor impls from rustc_typeck
Issue #95004
cc `@cjgillot`
|
|
|
|
|
|
|
|
TaKO8Ki:suggest-fully-qualified-path-with-appropriate-params, r=compiler-errors
Suggest fully qualified path with appropriate params
closes #96291
|
|
rustdoc: ensure HTML/JS side implementors don't have dups
Fixes #94641
Rendered:
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/std/iter/trait.Iterator.html
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/core/iter/trait.Iterator.html
|
|
Put the incompatible_closure_captures lint messages in alphabetical order
Looks like they were in hash order before, which was causing me trouble in #94598, so this PR sorts the errors by trait name.
|
|
Fixes reexports in search
Fixes #96681.
At some point we stopped reexporting items in search so this PR fixes it.
It also adds a regression test.
r? ```@notriddle```
|
|
Collect function instance used in `global_asm!` sym operand
The constants used in SymFn operands have FnDef type,
so the type of the constant identifies the function.
Fixes #96623.
|
|
r=GuillaumeGomez,jsha
rustdoc: when running a function-signature search, tweak the tab bar
# Before

# After

|
|
Allow inline consts to reference generic params
Tracking issue: #76001
The RFC says that inline consts cannot reference to generic parameters (for now), same as array length expressions. And expresses that it's desirable for it to reference in-scope generics, when array length expressions gain that feature as well.
However it is possible to implement this for inline consts before doing this for all anon consts, because inline consts are only used as values and they won't be used in the type system. So we can have:
```rust
fn foo<T>() {
let x = [4i32; std::mem::size_of::<T>()]; // NOT ALLOWED (for now)
let x = const { std::mem::size_of::<T>() }; // ALLOWED with this PR!
let x = [4i32; const { std::mem::size_of::<T>() }]; // NOT ALLOWED (for now)
}
```
This would make inline consts super useful for compile-time checks and assertions:
```rust
fn assert_zst<T>() {
const { assert!(std::mem::size_of::<T>() == 0) };
}
```
This would create an error during monomorphization when `assert_zst` is instantiated with non-ZST `T`s. A error during mono might sound scary, but this is exactly what a "desugared" inline const would do:
```rust
fn assert_zst<T>() {
struct F<T>(T);
impl<T> F<T> {
const V: () = assert!(std::mem::size_of::<T>() == 0);
}
let _ = F::<T>::V;
}
```
It should also be noted that the current inline const implementation can already reference the type params via type inference, so this resolver-level restriction is not any useful either:
```rust
fn foo<T>() -> usize {
let (_, size): (PhantomData<T>, usize) = const {
const fn my_size_of<T>() -> (PhantomData<T>, usize) {
(PhantomData, std::mem::size_of::<T>())
}
my_size_of()
};
size
}
```
```@rustbot``` label: F-inline_const
|
|
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
`run-pass` produces a JSON file when enabling save analysis.
|
|
|
|
|
|
jackh726:remove-mutable_borrow_reservation_conflict-lint, r=nikomatsakis
Remove mutable_borrow_reservation_conflict lint and allow the code pattern
This was the only breaking issue with the NLL stabilization PR. Lang team decided to go ahead and allow this.
r? `@nikomatsakis`
Closes #59159
Closes #56254
|
|
|
|
|
|
|
|
|
|
Diagnostics can have multiple primary spans, or have subdiagnostics
repeated at multiple locations, so support `Vec<..>` fields in the
diagnostic derive which become loops in the generated code.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Add a regression test for #64173 and #66152
Closes #64173
Closes #66152
Mixed the code as the root cause seems the same.
|
|
|
|
|
|
Looks like they were in FxHash order before, so it might just be luck that this used to be consistent across different word lengths.
|
|
generalize "incoherent impls" impl for user defined types
To allow the move of `trait Error` into core.
continues the work from #94963, finishes https://github.com/rust-lang/compiler-team/issues/487
r? `@petrochenkov` cc `@yaahc`
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #95359 (Update `int_roundings` methods from feedback)
- #95843 (Improve Rc::new_cyclic and Arc::new_cyclic documentation)
- #96507 (Suggest calling `Self::associated_function()`)
- #96635 (Use "strict" mode in JS scripts)
- #96673 (Report that opaque types are not allowed in impls even in the presence of other errors)
- #96682 (Show invisible delimeters (within comments) when pretty printing.)
- #96714 (interpret/validity: debug-check ScalarPair layout information)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
* If it's just `-> a`, use "In Function Return Types"
* If it's just `a b`, use "In Function Parameters"
* Otherwise, still use "In Function Signatures"
|
|
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
|
|
|
|
Show invisible delimeters (within comments) when pretty printing.
Because invisible syntax is really hard to work with!
r? `@petrochenkov`
|
|
Report that opaque types are not allowed in impls even in the presence of other errors
fixes #96569
before this PR those useful errors were hidden because either `unused parameter` or `only traits defined in the current crate can be implemented for arbitrary types` got emitted first.
|