| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Point at method call on missing annotation error
Make it clearer where the type name that couldn't be inferred comes from.
Before:
```
error[E0282]: type annotations needed
--> src/test/ui/span/type-annotations-needed-expr.rs:2:13
|
2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
|
= note: type must be known at this point
```
after
```
error[E0282]: type annotations needed
--> src/test/ui/span/type-annotations-needed-expr.rs:2:39
|
2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
| ^^^ cannot infer type for `S`
|
= note: type must be known at this point
```
CC #63852.
|
|
Move promoted MIR out of `mir::Body`
r? @oli-obk
|
|
Make it clearer where the type name that couldn't be infered comes from.
|
|
See #58794 for context.
|
|
Places drive by cleanups
Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @centril reviews.
|
|
|
|
|
|
Don't unwrap the result of `span_to_snippet`
Closes #63800
|
|
It can return `Err` due to macros being expanded across crates or
files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustc_mir: fix miri substitution/"universe" discipline.
Alternative to #61041, based on @RalfJung's own attempt at it.
I haven't done a full audit, but I believe everything is fixed now.
Fixes #61432.
Closes #61336, as a drive-by fix (for a subset of #43408, that is already special-cased).
r? @oli-obk / @RalfJung cc @varkor @yodaldevoid
|
|
Fix suggestion from incorrect `move async` to `async move`.
PR for #61920. Happy with the test. There must be a better implementation though - possibly a MIR visitor to estabilsh a span that doesn't include the `async` keyword?
|
|
Object-lifetime-default elision is distinct from other forms of
elision; it always refers to some enclosing lifetime *present in the
surrounding type* (e.g., `&dyn Bar` expands to `&'a (dyn Bar + 'a)`.
If there is no enclosing lifetime, then it expands to `'static`.
Therefore, in an `impl Trait<Item = dyn Bar>` setting, we don't expand
to create a lifetime parameter for the `dyn Bar + 'X` bound. It will
just be resolved to `'static`.
Annoyingly, the responsibility for this resolution is spread across
multiple bits of code right now (`middle::resolve_lifetimes`,
`lowering`). The lowering code knows that the default is for an object
lifetime, but it doesn't know what the correct result would be.
Probably this should be fixed, but what we do now is a surgical fix:
we have it generate a different result for elided lifetimes in a
object context, and then we can ignore those results when figuring out
the lifetimes that are captured in the opaque type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fix an ICE
fix method name
|
|
Don't special case the `Self` parameter by name
This results in a couple of small diagnostic regressions. They could be avoided by keeping the special case just for diagnostics, but that seems worse.
closes #50125
cc #60869
|
|
Use this to simplify the object safety code a bit.
|
|
Initial implementation of or-patterns
An incomplete implementation of or-patterns (e.g. `Some(0 | 1)` as a pattern). This patch set aims to implement initial parsing of `or-patterns`.
Related to: #54883
CC @alexreg @varkor
r? @Centril
|
|
Rollup of 5 pull requests
Successful merges:
- #62451 (Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked))
- #63487 (Remove meaningless comments in src/test)
- #63657 (Crank up invalid value lint)
- #63667 (resolve: Properly integrate derives and `macro_rules` scopes)
- #63669 (fix typos in mir/interpret)
Failed merges:
r? @ghost
|
|
|
|
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`.
This is a partial implementation of RFC 2535.
|
|
|
|
|
|
|
|
|
|
Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}.
These confused @Gankra, and then, also me, especially since `overflowing_*` *methods* also exist, but they map to `*_with_overflow` intrinsics!
r? @oli-obk / @nikomatsakis cc @Mark-Simulacrum (on the rustbuild workaround)
|
|
|
|
|
|
|
|
`hair::pattern::PatternRange`.
|
|
cleanup: Remove `Spanned` where possible
It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.
|
|
|
|
|
|
Miri: Check that a ptr is aligned and inbounds already when evaluating `*`
This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447.
Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;)
r? @oli-obk
|
|
Deduplicate error messages in `librsctc_mir`
Deduplicated the error messages in `librustc_mir`. #62022
|