-
Notifications
You must be signed in to change notification settings - Fork 14.1k
add a couple more ice tests #122943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bors
merged 9 commits into
rust-lang:master
from
matthiaskrgr:ice-tests-9xxxx-to-12xxxx
Mar 24, 2024
Merged
add a couple more ice tests #122943
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
12e3629
add test for #99945
matthiaskrgr 2f9a240
add test for opaque type with non-universal region substs #101852
matthiaskrgr e54bff7
add test for #104779 opaque types, patterns and subtyping ICE: Index…
matthiaskrgr f1f287f
add test for ICE "raw ptr comparison should already be caught in the…
matthiaskrgr f8aeac8
add test for #106423
matthiaskrgr cc422ce
add test for ICE #106444
matthiaskrgr f2bc9c5
add test for #106874 ICE BoundUniversalRegionError
matthiaskrgr 368bfb2
add test for #107228
matthiaskrgr 9aea37d
address review feedback
matthiaskrgr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add test for #106874 ICE BoundUniversalRegionError
Fixes #106874
- Loading branch information
commit f2bc9c5997a3647a61cfb5045866314088c6befa
There are no files selected for viewing
This file contains hidden or 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,48 @@ | ||
| // issue: rust-lang/rust#106874 | ||
| // ICE BoundUniversalRegionError | ||
|
|
||
| use std::marker::PhantomData; | ||
| use std::rc::Rc; | ||
|
|
||
| pub fn func<V, F: Fn(&mut V)>(f: F) -> A<impl X> { | ||
| A(B(C::new(D::new(move |st| f(st))))) | ||
| //~^ ERROR implementation of `FnOnce` is not general enough | ||
| //~^^ ERROR implementation of `Fn` is not general enough | ||
| //~^^^ ERROR implementation of `FnOnce` is not general enough | ||
| //~^^^^ ERROR implementation of `FnOnce` is not general enough | ||
| //~^^^^^ ERROR implementation of `Fn` is not general enough | ||
| //~^^^^^^ ERROR implementation of `FnOnce` is not general enough | ||
| //~^^^^^^^ ERROR implementation of `Fn` is not general enough | ||
| //~^^^^^^^^ ERROR implementation of `FnOnce` is not general enough | ||
| //~^^^^^^^^^ ERROR higher-ranked subtype error | ||
| //~^^^^^^^^^^ ERROR higher-ranked subtype error | ||
| } | ||
|
|
||
| trait X {} | ||
| trait Y { | ||
| type V; | ||
| } | ||
|
|
||
| struct A<T>(T); | ||
|
|
||
| struct B<T>(Rc<T>); | ||
| impl<T> X for B<T> {} | ||
|
|
||
| struct C<T: Y>(T::V); | ||
| impl<T: Y> C<T> { | ||
| fn new(_: T) -> Rc<Self> { | ||
| todo!() | ||
| } | ||
| } | ||
| struct D<V, F>(F, PhantomData<fn(&mut V)>); | ||
|
|
||
| impl<V, F> D<V, F> { | ||
| fn new(_: F) -> Self { | ||
| todo!() | ||
| } | ||
| } | ||
| impl<V, F: Fn(&mut V)> Y for D<V, F> { | ||
| type V = V; | ||
| } | ||
|
|
||
| pub fn main() {} | ||
This file contains hidden or 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,90 @@ | ||
| error: implementation of `FnOnce` is not general enough | ||
| --> $DIR/ice-106874.rs:8:5 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'0 mut V)` must implement `FnOnce<(&mut V,)>`, for some specific lifetime `'0`... | ||
| = note: ...but it actually implements `FnOnce<(&'1 mut V,)>`, for some specific lifetime `'1` | ||
|
|
||
| error: implementation of `FnOnce` is not general enough | ||
| --> $DIR/ice-106874.rs:8:5 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'0 mut V)` must implement `FnOnce<(&mut V,)>`, for some specific lifetime `'0`... | ||
| = note: ...but it actually implements `FnOnce<(&'1 mut V,)>`, for some specific lifetime `'1` | ||
| = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
|
||
| error: implementation of `Fn` is not general enough | ||
| --> $DIR/ice-106874.rs:8:7 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
|
|
||
| error: implementation of `FnOnce` is not general enough | ||
| --> $DIR/ice-106874.rs:8:7 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
|
|
||
| error: implementation of `Fn` is not general enough | ||
| --> $DIR/ice-106874.rs:8:7 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
| = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
|
||
| error: implementation of `FnOnce` is not general enough | ||
| --> $DIR/ice-106874.rs:8:9 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^ implementation of `FnOnce` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
|
|
||
| error: implementation of `Fn` is not general enough | ||
| --> $DIR/ice-106874.rs:8:9 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `Fn<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `Fn<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
|
|
||
| error: implementation of `FnOnce` is not general enough | ||
| --> $DIR/ice-106874.rs:8:9 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough | ||
| | | ||
| = note: closure with signature `fn(&'2 mut V)` must implement `FnOnce<(&'1 mut V,)>`, for any lifetime `'1`... | ||
| = note: ...but it actually implements `FnOnce<(&'2 mut V,)>`, for some specific lifetime `'2` | ||
|
|
||
| error: higher-ranked subtype error | ||
| --> $DIR/ice-106874.rs:8:41 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^ | ||
|
|
||
| error: higher-ranked subtype error | ||
| --> $DIR/ice-106874.rs:8:41 | ||
| | | ||
| LL | A(B(C::new(D::new(move |st| f(st))))) | ||
| | ^ | ||
| | | ||
| = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
|
||
| error: aborting due to 10 previous errors | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.