| Age | Commit message (Collapse) | Author | Lines |
|
Move some tests to more reasonable directories
r? `@petrochenkov`
|
|
lub: don't bail out due to empty binders
allows for the following to compile. The equivalent code using `struct Wrapper<'upper>(fn(&'upper ());` already compiles on stable.
```rust
let _: fn(&'upper ()) = match v {
true => lt_in_fn::<'a>(),
false => lt_in_fn::<'b>(),
};
```
see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7034a677190110941223cafac6632f70 for a complete example
r? ```@rust-lang/types```
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #94033 (Improve docs for `is_running` to explain use case)
- #97269 (adjust transmute const stabilization version)
- #97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting)
- #98022 (Fix erroneous span for borrowck error)
- #98124 (Improve loading of crates.js and sidebar-items.js)
- #98278 (Some token stream cleanups)
- #98306 (`try_fold_unevaluated` for infallible folders)
- #98313 (Remove lies in comments.)
- #98323 (:arrow_up: rust-analyzer)
- #98329 (Avoid an ICE and instead let the compiler report a useful error)
- #98330 (update ioslice docs to use shared slices)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Avoid an ICE and instead let the compiler report a useful error
Fixes #98299
|
|
Fix erroneous span for borrowck error
I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead.
Fixes #97997
The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant.
There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
|
|
Remove dereferencing of Box from codegen
Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains.
Hopefully, this is the end of the Box<T, A> ICEs.
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
|
|
|
|
|
|
[RFC 2011] Expand expressions where possible
Tracking issue: https://github.com/rust-lang/rust/issues/44838
Fourth step of https://github.com/rust-lang/rust/pull/96496
Extends https://github.com/rust-lang/rust/pull/97665 considering expressions that are good candidates for expansion.
r? `@oli-obk`
|
|
Mention formatting macros when encountering `ArgumentV1` method in const
Also open to just closing this if it's overkill. There are a lot of other distracting error messages around, so maybe it's not worth fixing just this one.
Fixes #93665
|
|
Don't omit comma when suggesting wildcard arm after macro expr
* Also adds `Span::eq_ctxt` to consolidate the various usages of `span.ctxt() == other.ctxt()`
* Also fixes an unhygenic usage of spans which caused the suggestion to render weirdly when we had one arm match in a macro
* Also always suggests a comma (i.e. even after a block) if we're rendering a wildcard arm in a single-line match (looks prettier :rose:)
Fixes #94866
|
|
Include ForeignItem when visiting types for WF check
Addresses Issue 95665 by including `hir::Node::ForeignItem` as a valid
type to visit in `diagnostic_hir_wf_check`.
Fixes #95665
|
|
Rollup of 5 pull requests
Successful merges:
- #98183 (Fix pretty printing of empty bound lists in where-clause)
- #98268 (Improve `lifetime arguments are not allowed on` error message)
- #98273 (Fix minor documentation typo)
- #98274 (Minor improvements on error for `Self` type in items that don't allow it)
- #98281 (Fix typo in `HashMap::drain` docs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Minor improvements on error for `Self` type in items that don't allow it
Fixes #93796
|
|
|
|
Addresses Issue 95665 by including `hir::Node::ForeignItem` as a valid
type to visit in `diagnostic_hir_wf_check`.
Fixes #95665
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`note_obligation_cause_code`
Most futures don't go through this code path, because they're caught by
`maybe_note_obligation_cause_for_async_await`. But all generators do,
and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses.
At some point, we may want to consider unifying this with the code for `maybe_note_async_await`,
so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points.
But both functions are quite complicated, and it's not clear to me how to combine them;
this seems like a good incremental improvement.
|
|
add comments in `store_dead_field_or_variant`
support multiple log level
add a item ident label
fix ui tests
fix a ui test
fix a rustdoc ui test
use let chain
refactor: remove `store_dead_field_or_variant`
fix a tiny bug
|
|
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #97803 (Impl Termination for Infallible and then make the Result impls of Termination more generic)
- #97828 (Allow configuring where artifacts are downloaded from)
- #98150 (Emscripten target: replace -g4 with -g, and -g3 with --profiling-funcs)
- #98195 (Fix rustdoc json primitive handling)
- #98205 (Remove a possible unnecessary assignment)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Impl Termination for Infallible and then make the Result impls of Termination more generic
This allows things like `Result<ExitCode, E>` to 'just work'
|
|
make cenum_impl_drop_cast deny-by-default
Also make it show up as future breakage diagnostic.
In https://github.com/rust-lang/rust/pull/96862 we are proposing to change behavior of those drops *again*, so this looks like a good opportunity to increase our pressure on getting them out of the ecosystem. Looking at the [tracking issue](https://github.com/rust-lang/rust/issues/73333), so far nobody spoke up in favor of this (accidental) feature.
Cc https://github.com/rust-lang/rust/issues/73333 `@oli-obk`
|
|
|
|
|
|
diagnostics: remove trailing spaces
Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
|
|
Subtype FRU fields first in `type_changing_struct_update`
So this fixes a subtle bug that `type_changing_struct_update` introduced, where it'll no longer coerce the base expr correctly. I actually think this code is easier to understand now, too.
r? `@lcnr` since you reviewed the last one
|
|
WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank
Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown
This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230.
I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result.
Here is an example of how this changes the output:
Before:
```text
help: consider enclosing expression in a block
|
3 ~ 'l: { match () { () => break 'l,
4 |
5 |
6 |
7 |
8 |
...
```
After:
```text
help: consider enclosing expression in a block
|
3 ~ 'l: { match () { () => break 'l,
4 |
...
31|
32~ } };
|
```
r? `@estebank`
`@rustbot` label +A-diagnostics +A-suggestion-diagnostics
|
|
|
|
Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros
Fixes #91800.
|
|
|