| Age | Commit message (Collapse) | Author | Lines |
|
factor out pluralisation remains after #64280
there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) as the provided param is already a bool or the check condition is not `x != 1`, so I change the macro accept a boolean expr instead of number to fit all the cases.
@Centril please review
Fixes #64238.
|
|
|
|
|
|
Fix backticks in documentation
Fix a few typos in comments/documentation where backticks were doubled-up on one side.
|
|
fix Miri discriminant handling
This can be reviewed commit-by-commit fairly well.
The Miri side is at https://github.com/rust-lang/miri/pull/903.
Fixes https://github.com/rust-lang/rust/issues/62138
r? @eddyb @oli-obk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 3 pull requests
Successful merges:
- #63872 (Document platform-specific behavior of the iterator returned by std::fs::read_dir)
- #64250 (save-analysis: Nest typeck tables when processing functions/methods)
- #64472 (Don't mark expression with attributes as not needing parentheses)
Failed merges:
r? @ghost
|
|
save-analysis: Nest typeck tables when processing functions/methods
Fixes an issue where we did not nest tables correctly when resolving
associated types in formal argument/return type positions.
This was the minimized reproduction case that I tested the fix on:
```rust
pub trait Trait {
type Assoc;
}
pub struct A;
pub fn func() {
fn _inner1<U: Trait>(_: U::Assoc) {}
fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() }
impl A {
fn _inner1<U: Trait>(self, _: U::Assoc) {}
fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() }
}
}
```
using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`.
Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this.
Closes #63663
Closes #50328
Closes #43982
|
|
|
|
|
|
Performance shouldn't be impacted (see [1] for a perf run) and this
should allow us to catch more bugs, e.g. [2] and [3].
[1]: https://github.com/rust-lang/rust/pull/64262
[2]: https://github.com/rust-lang/rust/pull/64250
[3]: https://github.com/rust-lang/rust/issues/57298
|
|
|
|
Modify files performing pluralisation checks to incorporate the
dedicated macro located in `syntax::errors`.
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
|
|
r=petrochenkov
Minimize uses of `LocalInternedString`
`LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values."
This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
|
|
r=varkor
Check impl trait substs when checking for recursive types
closes #64004
|
|
This is not a compelling change in isolation, but it is a necessary
step.
|
|
Emit error on intrinsic to fn ptr casts
I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway.
Fixes #15694
|
|
Account for arbitrary self types in E0599
Fix https://github.com/rust-lang/rust/issues/62373
|
|
Make Allocation::bytes private
Fixes #62931.
Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic.
cc: @RalfJung
|
|
|
|
|
|
|
|
This prevents mutual `async fn` recursion
|
|
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
|
|
ty: use Align for ReprOptions pack and align.
|
|
Add Option<Span> to `require_lang_item`
Fixes #63954
I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank
|
|
|
|
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
|
|
|
|
Move promoted MIR out of `mir::Body`
r? @oli-obk
|
|
Suggest calling closure with resolved return type when appropriate
Follow up to #63337. CC #63100.
```
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:46:20
|
LL | let closure = || 42;
| -- closure defined here
LL | let _: usize = closure;
| ^^^^^^^
| |
| expected usize, found closure
| help: use parentheses to call this closure: `closure()`
|
= note: expected type `usize`
found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
```
|
|
|
|
|
|
Using `ExpnId`s default transparency here instead of the mark's real transparency was actually incorrect.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Direct access to the bytes was previously a problem (#62931) where
components would read their contents without properly checking
relocations and/or definedness.
Making bytes private instead of purely renaming them also helps in
allowing amendments to their allocation scheme (such as eliding
allocation for undef of constant regions).
|