-
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.
Use ObligationCtxt::new_in_snapshot in satisfied_from_param_env
- Loading branch information
1 parent
f55b002
commit 343a359
Showing
3 changed files
with
57 additions
and
1 deletion.
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
17 changes: 17 additions & 0 deletions
17
tests/rustdoc/document-item-with-associated-const-in-where-clause.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,17 @@ | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
pub trait Enumerable { | ||
const N: usize; | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct SymmetricGroup<S> | ||
where | ||
S: Enumerable, | ||
[(); S::N]: Sized, | ||
{ | ||
_phantom: std::marker::PhantomData<S>, | ||
} | ||
|
||
fn main() {} |
39 changes: 39 additions & 0 deletions
39
tests/ui/const-generics/generic_const_exprs/single-satisfied-ConstEvaluatable-in-probe.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,39 @@ | ||
// check-pass | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
use std::marker::PhantomData; | ||
|
||
pub trait Bytes { | ||
const BYTES: usize; | ||
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Conster<OT> | ||
where | ||
OT: Bytes, | ||
[(); OT::BYTES]: Sized, | ||
{ | ||
_offset_type: PhantomData<fn(OT) -> OT>, | ||
} | ||
|
||
impl<OT> Conster<OT> | ||
where | ||
OT: Bytes, | ||
[(); OT::BYTES]: Sized, | ||
{ | ||
pub fn new() -> Self { | ||
Conster { _offset_type: PhantomData } | ||
} | ||
} | ||
|
||
pub fn make_conster<COT>() -> Conster<COT> | ||
where | ||
COT: Bytes, | ||
[(); COT::BYTES]: Sized, | ||
{ | ||
Conster::new() | ||
} | ||
|
||
fn main() {} |