Skip to content

Rollup of 7 pull requests #109285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
75563cd
Error code E0794 for late-bound lifetime parameter error.
czzrr Jan 27, 2023
82297a5
expand: Pass `ast::Crate` by reference to AST transforming passes
petrochenkov Feb 18, 2023
0261d25
Add some tests for the current `#![cfg(FALSE)]` crate behavior
petrochenkov Mar 14, 2023
bf00e7d
rustc_interface: Add a new query `pre_configure`
petrochenkov Mar 14, 2023
3720753
Implementing "<test_binary> --list --format json" #107307 #49359
parthopdas Feb 8, 2023
5e0fc04
rustdoc: Correctly merge import's and its target's docs in one more case
petrochenkov Mar 17, 2023
c7cc1c7
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-tra…
spastorino Mar 16, 2023
ae7fa1d
Add generic parameters mismatch test for async in traits
spastorino Mar 16, 2023
e0302bb
Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests
spastorino Mar 16, 2023
9139ed0
Fix impl_trait_ty_to_ty substs
spastorino Mar 17, 2023
640c202
Fix generics_of for impl's RPITIT synthesized associated type
spastorino Mar 17, 2023
5559c64
Rollup merge of #107416 - czzrr:issue-80618, r=GuillaumeGomez
matthiaskrgr Mar 17, 2023
4769837
Rollup merge of #108148 - parthopdas:master, r=oli-obk
matthiaskrgr Mar 17, 2023
64ee284
Rollup merge of #108221 - petrochenkov:cratecfg, r=michaelwoerister
matthiaskrgr Mar 17, 2023
ee58ce5
Rollup merge of #109193 - spastorino:new-rpitit-11, r=compiler-errors
matthiaskrgr Mar 17, 2023
ba18bcc
Rollup merge of #109238 - spastorino:new-rpitit-12, r=compiler-errors
matthiaskrgr Mar 17, 2023
a35c927
Rollup merge of #109266 - petrochenkov:docice4, r=petrochenkov
matthiaskrgr Mar 17, 2023
ca7454d
Rollup merge of #109277 - spastorino:new-rpitit-14, r=compiler-errors
matthiaskrgr Mar 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,17 @@ fn compare_number_of_generics<'tcx>(
return Ok(());
}

// We never need to emit a separate error for RPITITs, since if an RPITIT
// has mismatched type or const generic arguments, then the method that it's
// inheriting the generics from will also have mismatched arguments, and
// we'll report an error for that instead. Delay a bug for safety, though.
if tcx.opt_rpitit_info(trait_.def_id).is_some() {
return Err(tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
"errors comparing numbers of generics of trait/impl functions were not emitted",
));
}

let matchings = [
("type", trait_own_counts.types, impl_own_counts.types),
("const", trait_own_counts.consts, impl_own_counts.consts),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
--> $DIR/generics-mismatch.rs:11:12
--> $DIR/generics-mismatch.rs:14:12
|
LL | fn bar(&self) -> impl Sized;
| - expected 0 type parameters
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
--> $DIR/generics-mismatch.rs:14:12
|
LL | fn bar(&self) -> impl Sized;
| - expected 0 type parameters
...
LL | fn bar<T>(&self) {}
| ^ found 1 type parameter

error: aborting due to previous error

For more information about this error, try `rustc --explain E0049`.
3 changes: 3 additions & 0 deletions tests/ui/impl-trait/in-trait/generics-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next

#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

Expand Down