| Age | Commit message (Collapse) | Author | Lines |
|
Miri: basic dyn* support
As usual I am very unsure about the dynamic dispatch stuff, but it passes even the `Pin<&mut dyn* Trait>` test so that is something.
TBH I think it was a mistake to make `dyn Trait` and `dyn* Trait` part of the same `TyKind` variant. Almost everywhere in Miri this lead to the wrong default behavior, resulting in strange ICEs instead of nice "unimplemented" messages. The two types describe pretty different runtime data layout after all.
Strangely I did not need to do the equivalent of [this diff](https://github.com/rust-lang/rust/pull/106532#discussion_r1087095963) in Miri. Maybe that is because the unsizing logic matches on `ty::Dynamic(.., ty::Dyn)` already? In `unsized_info` I don't think the `target_dyn_kind` can be `DynStar`, since then it wouldn't be unsized!
r? `@oli-obk` Cc `@eholk` (dyn-star) https://github.com/rust-lang/rust/issues/102425
|
|
give the resolver access to TyCtxt
The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.
Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.
### PRs split out of this one and leading up to it:
* https://github.com/rust-lang/rust/pull/105423
* https://github.com/rust-lang/rust/pull/105357
* https://github.com/rust-lang/rust/pull/105603
* https://github.com/rust-lang/rust/pull/106776
* https://github.com/rust-lang/rust/pull/106810
* https://github.com/rust-lang/rust/pull/106812
* https://github.com/rust-lang/rust/pull/108032
|
|
Rollup of 6 pull requests
Successful merges:
- #108241 (Fix handling of reexported macro in doc hidden items)
- #108254 (Refine error span for trait error into borrowed expression)
- #108255 (Remove old FIXMEs referring to #19596)
- #108257 (Remove old FIXME that no longer applies)
- #108276 (small `opaque_type_origin` cleanup)
- #108279 (Use named arguments for `{,u}int_impls` macro)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use named arguments for `{,u}int_impls` macro
This makes it way easier to understand.
r? `@scottmcm`
|
|
small `opaque_type_origin` cleanup
r? `@oli-obk`
|
|
Remove old FIXME that no longer applies
it looks like Encodable was fallible at some point, but that was changed which means that this FIXME is no longer applicable
|
|
Remove old FIXMEs referring to #19596
Having an inner function that accepts a mutable reference seems to be the only way this can be expressed. Taking a mutable reference would call the same function with a new type &mut F which then causes the infinite recursion error in #19596.
|
|
r=WaffleLapkin
Refine error span for trait error into borrowed expression
Extends the error span refinement in #106477 to drill into borrowed expressions just like tuples/struct/enum literals. For example,
```rs
trait Fancy {}
trait Good {}
impl <'a, T> Fancy for &'a T where T: Good {}
impl <S> Good for Option<S> where S: Iterator {}
fn want_fancy<F>(f: F) where F: Fancy {}
fn example() {
want_fancy(&Some(5));
// (BEFORE) ^^^^^^^^ `{integer}` is not an iterator
// (AFTER) ^ `{integer}` is not an iterator
}
```
Existing heuristics try to find the right part of the expression to "point at"; current heuristics look at e.g. struct constructors and tuples. This PR adds a new check for borrowed expressions when looking into a borrowed type.
|
|
r=notriddle
Fix handling of reexported macro in doc hidden items
Fixes https://github.com/rust-lang/rust/issues/108231.
Fixes #59368.
r? `@notriddle`
|
|
|
|
|
|
|
|
:arrow_up: rust-analyzer
r? `@ghost`
|
|
This makes it easier to understand.
|
|
This makes it easier to understand.
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #108124 (Document that CStr::as_ptr returns a type alias)
- #108171 (Improve building compiler artifacts output)
- #108200 (Use restricted Damerau-Levenshtein distance for diagnostics)
- #108259 (remove FIXME that doesn't require fixing)
- #108265 ("`const` generic" -> "const parameter")
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
|
|
|
|
if it fails instead of bubbling out an error
|
|
|
|
|
|
|
|
|
|
|
|
when using TyCtxt
|
|
using TyCtxt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"`const` generic" -> "const parameter"
|
|
remove FIXME that doesn't require fixing
|
|
r=tmiasko
Use restricted Damerau-Levenshtein distance for diagnostics
This replaces the existing Levenshtein algorithm with the Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change (a transposition) instead of two (a deletion and insertion). More specifically, this is a _restricted_ implementation, in that "ca" to "abc" cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the middle of a transposition. I believe that errors like that are sufficiently rare that it's not worth taking into account.
This was first brought up [on IRLO](https://internals.rust-lang.org/t/18227) when it was noticed that the diagnostic for `prinltn!` (transposed L and T) was `print!` and not `println!`. Only a single existing UI test was effected, with the result being an objective improvement.
~~I have left the method name and various other references to the Levenshtein algorithm untouched, as the exact manner in which the edit distance is calculated should not be relevant to the caller.~~
r? ``@estebank``
``@rustbot`` label +A-diagnostics +C-enhancement
|
|
Improve building compiler artifacts output
Fixes #108051
``@Manishearth,`` ``@jyn514`` mentioned you might be interested in these changes to the outputs.
|
|
Document that CStr::as_ptr returns a type alias
Rustdoc resolves type aliases too eagerly #15823 which makes the [std re-export](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.as_ptr) of `CStr::as_ptr` show `i8` instead of `c_char`. To work around this I've added info about `c_char` in the method's description.
BTW, I've also added a comment to what-not-to-do example in case someone copypasted it without reading the surrounding text.
|
|
create dummy placeholder crate to prevent compiler from panicing
This PR is to address the panic found in https://github.com/rust-lang/rust/issues/105700.
There are 2 separate things going on with this panic.
First the code could not generate a dummy response for crate fragment types when it hits the recursion limit.
This PR adds the method to the trait implementation for `DymmyResult` to be able to create a dummy crate node.
This stops the panic from happening.
The second thing that is not addressed (and maybe does not need addressing? 🤷🏻)
is that when you have multiple attributes it ends up treating attributes that follow another as being the result of expanding the former (maybe there is a better way to say that). So you end up hitting the recursion limit. Even though you would think there is no expansion happening here.
If you did not hit the recursion limit the compiler would output that `invalid_attribute` does not exists. But it currently exits before the resolution step when the recursion limit is reached here.
|
|
|
|
|
|
|
|
Use covariance on type relations of field projection types if possible
It's fine to use covariance here unless we're in a mutating context.
Fixes https://github.com/rust-lang/rust/issues/96514
Supersedes https://github.com/rust-lang/rust/pull/105958
r? `@lcnr`
|
|
|
|
|
|
Only include stable lints in `rustdoc::all` group
Fixes #106289.
Including unstable lints in the lint group produces unintuitive behavior
on stable (see #106289). Meanwhile, if we only included unstable lints
on nightly and not on stable, we could end up with confusing bugs that
were hard to compare across versions of Rust that lacked code changes.
I think that only including stable lints in `rustdoc::all`, no matter
the release channel, is the most intuitive option. Users can then
control unstable lints individually, which is reasonable since they have
to enable the feature gates individually anyway.
r? `@GuillaumeGomez`
|
|
|