| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
Addresses Issue 98466 by emitting a warning if a named argument
is used like a position argument (i.e. the name is not used in
the string to be formatted).
Fixes rust-lang#98466
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.
Fixes #99071
|
|
diagnostics: error messages when struct literals fail to parse
If an expression is supplied where a field is expected, the parser can become convinced that it's a shorthand field syntax when it's not.
This PR addresses it by explicitly recording the permitted `:` token immediately after the identifier, and also adds a suggestion to insert the name of the field if it looks like a complex expression.
Fixes #98917
|
|
`UnsafeCell` blocks niches inside its nested type from being available outside
fixes #87341
This implements the plan by `@eddyb` in https://github.com/rust-lang/rust/issues/87341#issuecomment-886083646
Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): #94527
|
|
Lower let-else in MIR
This MR will switch to lower let-else statements in MIR building instead.
To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements.
cc https://github.com/rust-lang/rust/issues/87335
Fix #98672
|
|
|
|
|
|
|
|
Add regression test for #74713
closes #74713
|
|
r=oli-obk
check non_exhaustive attr and private fields for transparent types
Fixes #78586.
|
|
Because it's more concise than the `let` form.
|
|
|
|
|
|
|
|
This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
- Error in lowering
- Add `closure_lifetime_binder` feature
|
|
TaKO8Ki:suggest-adding-missing-zero-to-floating-point-number, r=compiler-errors
Suggest adding a missing zero to a floating point number
fixes #98836
|
|
Fix last `let_chains` blocker
In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`.
This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce.
To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍
In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework.
cc https://github.com/rust-lang/rust/pull/94927
cc https://github.com/rust-lang/rust/issues/53667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
compiletest: trim edition before passing as flag
This makes `edition: 2021` work instead of the ugly
`edition:2021` one has to write.
|
|
Do not error during method probe on `Sized` predicates for types that aren't the method receiver
Fixes #61525
This is safe even though we're skipping an error because we end up confirming the method, which means we're still checking the `Sized` predicate in the end. It just means that we don't emit an erroneous message as below:
```
error: the `query` method cannot be invoked on a trait object
--> src/lib.rs:14:11
|
14 | 1.query::<dyn ToString>("")
| ^^^^^
|
= note: another candidate was found in the following trait, perhaps add a `use` for it:
`use crate::Example;`
```
Also fixes erroneously suggesting the same trait over again, as seen in the `issue-35976.rs` UI test.
|
|
Fix sized check ICE in asm check
Fixes (beta nominated, so doesn't close) #99122
1. Moves a check for unresolved inference variables to _before_ other checks that could possibly ICE. We're not changing behavior here, just doing the same thing earlier in the function.
2. Erases region variables in sized check (which are not resolved at this point) because rustc will also ICE when region vars are passed to a query which does not canonicalize them.
|
|
Fix duplicated type annotation suggestion
Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.
This fixes #93506 .
|
|
|
|
Create fresh lifetime parameters for bare fn trait too
The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently.
This PR introduces a special case for `Fn` traits, which are always fully resolved.
Fixes #98616
Fixes #98726
This will require a beta-backport, as beta contains that bug.
r? `@petrochenkov`
|
|
This makes `edition: 2021` work instead of the ugly
`edition:2021` one has to write.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mention similarly named associated type even if it's not clearly in supertrait
Due to query cycle avoidance, we sometimes restrict the candidates in `complain_about_assoc_type_not_found` too much so that we can't detect typo replacements from just supertraits.
This creates a more general note of the existence of a similarly named associated type from _all_ visible traits when possible.
Fixes #55673
|