Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a7434da
Remove restrictions on compare-exchange memory ordering.
m-ou-se Jun 22, 2022
a898f41
Only enable new cmpxchg memory orderings in cfg(not(bootstrap)).
m-ou-se Jun 22, 2022
b631983
Use LocalDefId in OpaqueTypeKey
compiler-errors Jul 16, 2022
04c590b
Be more precise when suggesting removal of parens on unit adt ctor
compiler-errors Jul 16, 2022
23cb89e
Do not constraint TAITs when checking impl/trait item compatibility
compiler-errors Jul 17, 2022
26ecd44
Do not ICE when we have -Zunpretty=expand with invalid ABI
compiler-errors Jul 17, 2022
7a45a60
use rustc_hir_pretty::qpath_to_string to avoid span_to_snippet when r…
compiler-errors Jul 17, 2022
3024d39
Fix auto-expand of trees in source code page sidebar
GuillaumeGomez Jul 17, 2022
8c58de5
Fix for `rchunks_exact` doc
TethysSvensson Jul 17, 2022
98bceb0
Add GUI test for source code sidebar auto-expand
GuillaumeGomez Jul 17, 2022
4a3d780
Rollup merge of #98383 - m-ou-se:remove-memory-order-restrictions, r=…
JohnTitor Jul 17, 2022
b186284
Rollup merge of #99347 - compiler-errors:opaque-type-key-local-def-id…
JohnTitor Jul 17, 2022
8f6b494
Rollup merge of #99350 - compiler-errors:issue-99240, r=fee1-dead
JohnTitor Jul 17, 2022
c731b40
Rollup merge of #99356 - compiler-errors:tait-in-assoc-ty-supertraits…
JohnTitor Jul 17, 2022
af53fea
Rollup merge of #99360 - compiler-errors:issue-99331, r=fee1-dead
JohnTitor Jul 17, 2022
c3226d0
Rollup merge of #99373 - GuillaumeGomez:source-code-sidebar-tree-auto…
JohnTitor Jul 17, 2022
5e4b6fa
Rollup merge of #99374 - TethysSvensson:patch-1, r=Dylan-DPC
JohnTitor Jul 17, 2022
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
Prev Previous commit
Next Next commit
Do not constraint TAITs when checking impl/trait item compatibility
  • Loading branch information
compiler-errors committed Jul 17, 2022
commit 23cb89ea3810bf63a70b9e7b473c046457982179
15 changes: 15 additions & 0 deletions compiler/rustc_typeck/src/check/compare_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,21 @@ pub fn check_type_bounds<'tcx>(
&outlives_environment,
);

let constraints = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
for (key, value) in constraints {
infcx
.report_mismatched_types(
&ObligationCause::misc(
value.hidden_type.span,
tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local()),
),
tcx.mk_opaque(key.def_id, key.substs),
value.hidden_type.ty,
TypeError::Mismatch,
)
.emit();
}

Ok(())
})
}
Expand Down
26 changes: 26 additions & 0 deletions src/test/ui/impl-trait/issues/issue-99348-impl-compatibility.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#![feature(type_alias_impl_trait)]

struct Concrete;

type Tait = impl Sized;

impl Foo for Concrete {
type Item = Concrete;
//~^ mismatched types
}

impl Bar for Concrete {
type Other = Tait;
}

trait Foo {
type Item: Bar<Other = Self>;
}

trait Bar {
type Other;
}

fn tait() -> Tait {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0308]: mismatched types
--> $DIR/issue-99348-impl-compatibility.rs:8:17
|
LL | type Tait = impl Sized;
| ---------- the expected opaque type
...
LL | type Item = Concrete;
| ^^^^^^^^ types differ
|
= note: expected opaque type `Tait`
found struct `Concrete`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.