forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#92434 - matthiaskrgr:rollup-m8wuq0v, r=matthi…
…askrgr Rollup of 4 pull requests Successful merges: - rust-lang#91519 (ast: Avoid aborts on fatal errors thrown from mutable AST visitor) - rust-lang#92414 (Fix spacing of pretty printed const item without body) - rust-lang#92423 (Add UI test for rust-lang#92292) - rust-lang#92427 (Use `UnsafeCell::get_mut()` in `core::lazy::OnceCell::get_mut()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
7 changed files
with
176 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// check-pass | ||
|
||
use std::marker::PhantomData; | ||
|
||
pub struct MyGenericType<T> { | ||
_marker: PhantomData<*const T>, | ||
} | ||
|
||
pub struct MyNonGenericType; | ||
|
||
impl<T> From<MyGenericType<T>> for MyNonGenericType { | ||
fn from(_: MyGenericType<T>) -> Self { | ||
todo!() | ||
} | ||
} | ||
|
||
pub trait MyTrait { | ||
const MY_CONSTANT: i32; | ||
} | ||
|
||
impl<T> MyTrait for MyGenericType<T> | ||
where | ||
Self: Into<MyNonGenericType>, | ||
{ | ||
const MY_CONSTANT: i32 = 1; | ||
} | ||
|
||
impl<T> MyGenericType<T> { | ||
const MY_OTHER_CONSTANT: i32 = <MyGenericType<T> as MyTrait>::MY_CONSTANT; | ||
} | ||
|
||
fn main() {} |