-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #114358 - matthiaskrgr:rollup-d810m9e, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #114178 (Account for macros when suggesting a new let binding) - #114199 (Don't unsize coerce infer vars in select in new solver) - #114301 (Don't check unnecessarily that impl trait is RPIT) - #114314 (Tweaks to `adt_sized_constraint`) - #114322 (Fix invalid slice coercion suggestion reported in turbofish) - #114340 ([rustc_attr][nit] Replace `filter` + `is_some` with `map_or`.) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
25 changed files
with
168 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/ui/dst/issue-90528-unsizing-not-suggestion-110063.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
trait Test {} | ||
impl Test for &[u8] {} | ||
|
||
fn needs_test<T: Test>() -> T { | ||
panic!() | ||
} | ||
|
||
fn main() { | ||
needs_test::<[u8; 1]>(); | ||
//~^ ERROR the trait bound | ||
let x: [u8; 1] = needs_test(); | ||
//~^ ERROR the trait bound | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/ui/dst/issue-90528-unsizing-not-suggestion-110063.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error[E0277]: the trait bound `[u8; 1]: Test` is not satisfied | ||
--> $DIR/issue-90528-unsizing-not-suggestion-110063.rs:9:18 | ||
| | ||
LL | needs_test::<[u8; 1]>(); | ||
| ^^^^^^^ the trait `Test` is not implemented for `[u8; 1]` | ||
| | ||
= help: the trait `Test` is implemented for `&[u8]` | ||
note: required by a bound in `needs_test` | ||
--> $DIR/issue-90528-unsizing-not-suggestion-110063.rs:4:18 | ||
| | ||
LL | fn needs_test<T: Test>() -> T { | ||
| ^^^^ required by this bound in `needs_test` | ||
|
||
error[E0277]: the trait bound `[u8; 1]: Test` is not satisfied | ||
--> $DIR/issue-90528-unsizing-not-suggestion-110063.rs:11:22 | ||
| | ||
LL | let x: [u8; 1] = needs_test(); | ||
| ^^^^^^^^^^ the trait `Test` is not implemented for `[u8; 1]` | ||
| | ||
= help: the trait `Test` is implemented for `&[u8]` | ||
note: required by a bound in `needs_test` | ||
--> $DIR/issue-90528-unsizing-not-suggestion-110063.rs:4:18 | ||
| | ||
LL | fn needs_test<T: Test>() -> T { | ||
| ^^^^ required by this bound in `needs_test` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
12 changes: 12 additions & 0 deletions
12
tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
trait Iterable { | ||
type Item<'a> | ||
where | ||
Self: 'a; | ||
|
||
fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
//~^ ERROR use of undeclared lifetime name `'missing` | ||
} | ||
|
||
fn main() {} |
23 changes: 23 additions & 0 deletions
23
tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/missing-lt-outlives-in-rpitit-114274.rs:8:55 | ||
| | ||
LL | fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
| ^^^^^^^^ undeclared lifetime | ||
| | ||
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html | ||
help: consider making the bound lifetime-generic with a new `'missing` lifetime | ||
| | ||
LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>>; | ||
| +++++++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | fn iter<'missing>(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
| ++++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | trait Iterable<'missing> { | ||
| ++++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0261`. |
Oops, something went wrong.