diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-09-02 19:10:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-02 19:10:24 +0200 |
| commit | c082e157cae3307ea991e259758b26e855362b8e (patch) | |
| tree | e5cb85b9959986a5cd3242c34738ecdd45abea46 /src | |
| parent | 8f88d44b0dbeefb7e5683cfcee38763427e9cb03 (diff) | |
| parent | f825d6c6ccb5bc1eab9dfda96d3189f7092eb867 (diff) | |
| download | rust-c082e157cae3307ea991e259758b26e855362b8e.tar.gz rust-c082e157cae3307ea991e259758b26e855362b8e.zip | |
Rollup merge of #88592 - b-naber:region_substs, r=oli-obk
Fix ICE in const check Fixes https://github.com/rust-lang/rust/issues/88433
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/const-generics/const_trait_fn-issue-88433.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs new file mode 100644 index 00000000000..8724fa69825 --- /dev/null +++ b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs @@ -0,0 +1,26 @@ +// build-pass + +#![feature(const_trait_impl)] + +trait Func<T> { + type Output; + + fn call_once(self, arg: T) -> Self::Output; +} + + +struct Closure; + +impl const Func<&usize> for Closure { + type Output = usize; + + fn call_once(self, arg: &usize) -> Self::Output { + *arg + } +} + +enum Bug<T = [(); Closure.call_once(&0) ]> { + V(T), +} + +fn main() {} |
