You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only 'static is permitted within type bounds (causes ICE: Cannot relate bound region) #5121
Once we can declare lifetime parameters, there is no reason not to permit them in type bounds. Also, I am not entirely sure if the way we are handling them is correct/sound. I've tagged places where such bounds appear with FIXMEs so that I can look into them later.
5121.rs:6:5: 6:6 error: internal compiler error: Cannot relate bound region: ReLateBound(12, BrNamed(syntax::ast::DefId{crate: 0u32, node: 21u32}, a)) <= ReInfer(1)
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
5121.rs:6 c.my_iter();
^
task 'rustc' failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:41
task '<main>' failed at 'explicit failure', /home/huon/rust/src/librustc/lib.rs:440
pnkfelix: I am adding a checklist to the bottom of this bug, where the unchecked issues represent problems that still remain unfixed (and the entire list of issues were closed as duplicates of this ticket).
I ran into this when trying to devise a too-clever interface for select2 that would let me avoid code duplication, but it would not let me use non-static borrowed pointers. https://gist.github.com/bblum/6042762
This will be the final part of #4846. Turns out that this is not so simple as I originally thought (but also not horribly scary or complex). I'll put up a blog post soon (and link it here) describing my proposal.
After reviewing the bugs that have been marked as duplicates of this bug, I've collected all of the cases that were not fixed by the original Early/Late patch and put them into their own modules. (Sometimes I tried to reduce them into smaller test cases, but usually when I did that I made a variant module with the reduced case while also keeping the original.)
(It wasn't originally a single file, but that is the easiest way to distribute the collection. It is easy enough to go back and forth between separate files and a single file for the modules, thanks to the beauty of Rust's module system.)
The main exceptions are the ICE's that are exposed by passing --cfg defer_for_5121_fix2 and --cfg defer_for_5121_fix3.
The other important things that are not fixed by PR #13157 (a fix to issue #13140) are the non-ICE unsoundness issues that are represented by the print out from the gisted code when you run it, namely the output:
Warning, non-3 value from m3: 140658622872720
bar.get(0) = 9
bar = [9, 9, 9, 9, 9], should be [1, 2, 3, 4, 5]
So, as mentioned above, there still remain issues #11971 and #12856 that remain unfixed. (They are already open, since they were not marked as dupes, just related.)
Also, we probably need to make some other changes, such as allowing one to put a lifetime bound on a trait (which means that all impls need to have that bound on themSelfs (sic)).
But, most of the work has been done here, and I claim that new bugs related to this one should not be closed as dupes of this one (but rather should be classified as unique on their own or classified as dupes of some other, more specific bug). So I am going to close this bug.
Activity
nikomatsakis commentedon Apr 5, 2013
see also #5715
emberian commentedon Jun 25, 2013
@nikomatsakis this going to land in time for 0.7? I really hope so, it's really obnoxious.
emberian commentedon Jun 25, 2013
(Also,
'selfis allowed too, I think)brson commentedon Jul 3, 2013
Bumping from 0.7
bblum commentedon Jul 19, 2013
I ran into this when trying to devise a too-clever interface for select2 that would let me avoid code duplication, but it would not let me use non-static borrowed pointers. https://gist.github.com/bblum/6042762
nikomatsakis commentedon Oct 29, 2013
This will be the final part of #4846. Turns out that this is not so simple as I originally thought (but also not horribly scary or complex). I'll put up a blog post soon (and link it here) describing my proposal.
nikomatsakis commentedon Oct 29, 2013
See http://smallcultfollowing.com/babysteps/blog/2013/10/29/intermingled-parameter-lists/ for a detailed write-up of the changes I propose to fix this.
Make trait lifetime parameters early bound in static fn type. This is…
17 remaining items
auto merge of #12807 : pnkfelix/rust/fsk-issue5121-fns-with-early-lif…
flaper87 commentedon Mar 13, 2014
Taken from #12851
pnkfelix commentedon Mar 13, 2014
well, I guess it is a good thing I didn't have bors automatically close this ticket with PR #12807.
Will investigate these ICE's. (i had noted others above, may be related.)
Fix rust-lang#5121: Early/Late Bound related ICEs.
pnkfelix commentedon Mar 25, 2014
I have a patch that fixes most of the ICE's above, though not all of them.
I will try to put it up for review either tonight or tomorrow.
pnkfelix commentedon Mar 26, 2014
After reviewing the bugs that have been marked as duplicates of this bug, I've collected all of the cases that were not fixed by the original Early/Late patch and put them into their own modules. (Sometimes I tried to reduce them into smaller test cases, but usually when I did that I made a variant module with the reduced case while also keeping the original.)
The result of this collection process is posted in a file at the following gist:
https://gist.github.com/pnkfelix/9788730
(It wasn't originally a single file, but that is the easiest way to distribute the collection. It is easy enough to go back and forth between separate files and a single file for the modules, thanks to the beauty of Rust's module system.)
pnkfelix commentedon Mar 26, 2014
PR #13157 fixes most of the ICE's exposed by https://gist.github.com/pnkfelix/9788730
The main exceptions are the ICE's that are exposed by passing
--cfg defer_for_5121_fix2and--cfg defer_for_5121_fix3.The other important things that are not fixed by PR #13157 (a fix to issue #13140) are the non-ICE unsoundness issues that are represented by the print out from the gisted code when you run it, namely the output:
corresponding to #11971 and #12856.
auto merge of #13157 : pnkfelix/rust/fsk-iss13140, r=nikomatsakis
pnkfelix commentedon Mar 31, 2014
So, as mentioned above, there still remain issues #11971 and #12856 that remain unfixed. (They are already open, since they were not marked as dupes, just related.)
Also, we probably need to make some other changes, such as allowing one to put a lifetime bound on a trait (which means that all impls need to have that bound on them
Selfs (sic)).But, most of the work has been done here, and I claim that new bugs related to this one should not be closed as dupes of this one (but rather should be classified as unique on their own or classified as dupes of some other, more specific bug). So I am going to close this bug.
Auto merge of rust-lang#5121 - lzutao:comptest, r=flip1995
Auto merge of rust-lang#5145 - lzutao:rmeta, r=flip1995
Merge pull request rust-lang#5121 from calebcartwright/subtree-sync-2…
Merge pull request rust-lang#5121 from rust-lang/rustup-2026-06-21