-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not assemble supertraits for trait aliases
- Loading branch information
Showing
2 changed files
with
52 additions
and
17 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
21 changes: 21 additions & 0 deletions
21
tests/ui/traits/alias/issue-107747-do-not-assemble-supertraits.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,21 @@ | ||
// Regression test for #107747: methods from trait alias supertraits were brought into scope | ||
// | ||
// check-pass | ||
|
||
#![feature(trait_alias)] | ||
|
||
use std::fmt; | ||
|
||
trait Foo: fmt::Debug {} | ||
trait Bar = Foo; | ||
|
||
#[derive(Debug)] | ||
struct Qux(bool); | ||
|
||
impl fmt::Display for Qux { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
self.0.fmt(f) | ||
} | ||
} | ||
|
||
fn main() {} |