Open Coder-256 opened 3 weeks ago
it can't really be a regression if there's no prior release that compiles it, but perhaps there i... ah, rust 1.38.0! good to know???
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
QuineDot's example:
with this diff, compiles on 1.26.0 (not sure if there are any equally semantically arbitrary diffs available...)
impl Bar {
fn baz<'a>(&'a self, _foo: Foo<'a, '_, '_>) {}
fn call_baz<'b>(&'b self) {
I can't immediately conjure an argument why it shouldn't typecheck either other than "seems hard :(" so I'll leave that to those officially designated for judging "hm, that type feature seems hard :("
The following fails to build:
However, it works if the bounds on
'c
argument on the declaration ofFoo
are changed to either'c: 'b
, or simply an unbounded lifetime'c
. This seems unexpected because'c: 'b
is a stricter bound than'c: 'a
(and'c
is a weaker bound than'c: 'a
). It's even stranger because the'c
lifetime is unused in this example.This seems to be either a bug, unexpected limitation, or as another user suggested, an NLL regression. I created a post on URLO that has some further discussion.
Meta
rustc --version --verbose
: