| Age | Commit message (Collapse) | Author | Lines |
|
Run full const-generics test for issue-72293
Closes #72293
r? ```@oli-obk```
|
|
Fix some diagnostic issues with const_generics_defaults feature gate
This PR makes a few changes:
- print out const param defaults in "lifetime ordering" errors rather than discarding them
- update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message
- fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
|
|
|
|
|
|
Update standard library for IntoIterator implementation of arrays
This PR partially resolves issue #84513 of updating the standard library part.
I haven't found any remaining doctest examples which are using iterators over e.g. &i32 instead of just i32 in the standard library. Can anyone point me to them if there's remaining any?
Thanks!
r? ```@m-ou-se```
|
|
|
|
|
|
|
|
|
|
involved
|
|
deal with `const_evaluatable_checked` in `ConstEquate`
Failing to evaluate two constants which do not contain inference variables should not result in ambiguity.
|
|
|
|
Make `const_generics_defaults` not an incomplete feature
r? `@lcnr`
|
|
|
|
|
|
Suggest adding a type parameter for impls
Add a new suggestion upon encountering an unknown type in a `impl` that suggests adding a new type parameter. This diagnostic suggests to add a new type parameter even though it may be a const parameter, however after adding the parameter and running rustc again a follow up error steers the user to change the type parameter to a const parameter.
```rust
struct X<const C: ()>();
impl X<C> {}
```
suggests
```
error[E0412]: cannot find type `C` in this scope
--> bar.rs:2:8
|
1 | struct X<const C: ()>();
| ------------------------ similarly named struct `X` defined here
2 | impl X<C> {}
| ^
|
help: a struct with a similar name exists
|
2 | impl X<X> {}
| ^
help: you might be missing a type parameter
|
2 | impl<C> X<C> {}
| ^^^
```
After adding a type parameter the code now becomes
```rust
struct X<const C: ()>();
impl<C> X<C> {}
```
and the error now fully steers the user towards the correct code
```
error[E0747]: type provided when a constant was expected
--> bar.rs:2:11
|
2 | impl<C> X<C> {}
| ^
|
help: consider changing this type parameter to be a `const` generic
|
2 | impl<const C: ()> X<C> {}
| ^^^^^^^^^^^
```
r? `@estebank`
Somewhat related #84946
|
|
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
|
|
|
|
|
|
|
|
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021
This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition.
r? `@estebank`
|
|
Add help message to suggest const for unused type param
r? `@lcnr`
|
|
|
|
Fix generic arg mismatch errors being ignored with explicit late bound lifetimes
Fixes #83466
r? `@varkor`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also tweaked the message a bit by
- removing the hyphen, because in my opinion the hyphen makes the
message a bit harder to read, especially combined with the backticks;
- adding the word "be", because I think it's a bit clearer that way.
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #83065 (Rework `std::sys::windows::alloc`)
- #83478 (rustdoc: Add unstable option to only emit shared/crate-specific files)
- #83629 (Fix double-drop in `Vec::from_iter(vec.into_iter())` specialization when items drop during panic)
- #83673 (give full path of constraint in suggest_constraining_type_param)
- #83755 (Simplify coverage tests)
- #83757 (2229: Support migration via rustfix)
- #83771 (Fix stack overflow detection on FreeBSD 11.1+)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
revert file
bless with nll mode
|
|
|
|
|
|
combine: stop eagerly evaluating consts
`super_relate_consts` eagerly evaluates constants which doesn't seem too great.
I now also finally understand why all of the unused substs test passed. The reason being
that we just evaluated the constants in `super_relate_consts` :laughing:
While this change isn't strictly necessary as evaluating consts here doesn't hurt, it still feels a lot cleaner to do it this way
r? `@oli-obk` `@nikomatsakis`
|
|
|
|
|
|
Closes #56445.
|
|
|
|
|
|
A bunch of nits fixed, and a new test for pretty printing the AST.
|
|
|
|
|