Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLifetime in trait method declaration affects RFC 1214 checks #27987
Comments
eefriedman
referenced this issue
Aug 24, 2015
Closed
Allow where clauses involving types which don't include a type parameter. #27972
This comment has been minimized.
This comment has been minimized.
|
this is because
for this reason, predicates that contain lifetimes or type parameters can be used to satisfy themselves, while global predicates don't enter the where-clause list, and therefore correctly cause a warning. This is only an RFC1214 error because you did it in a trait method. Type-less predicates being allowed in trait/impl methods can indeed cause ICEs: pub struct S;
impl S {
pub fn f<'a>(&self, f: &'a f32) where u32: PartialEq<&'a f32> {
4==f;
}
}
fn main() {} |
eefriedman
referenced this issue
Aug 27, 2015
Open
Type inference problem with lifetimes and assoiated types #28046
This comment has been minimized.
This comment has been minimized.
|
/cc @rust-lang/lang |
steveklabnik
added
A-lang
A-lifetimes
A-traits
labels
Sep 3, 2015
This comment has been minimized.
This comment has been minimized.
|
This has to do w/ the early- vs late-bound lifetime distinction. I'd like to ease and remove that distinction, but it'll take more effort to get there. |
This comment has been minimized.
This comment has been minimized.
|
No it doesn't. Nothing changes if you force @eefriedman was surprised by the distinction in #28046 though. |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 ah I see, yes, I stand corrected. |
bltavares
added a commit
to bltavares/glacier
that referenced
this issue
May 30, 2016
bltavares
referenced this issue
May 30, 2016
Merged
Lifetime in trait method declaration affects RFC 1214 checks #150
brson
added
T-lang
P-low
labels
Mar 9, 2017
steveklabnik
removed
the
A-lang
label
Mar 24, 2017
Mark-Simulacrum
added
the
C-bug
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
I don't know what this means regarding the bug. |
This comment has been minimized.
This comment has been minimized.
|
The ICE was fixed by me in #42797, the "global predicate" thing is still present. |
eefriedman commentedAug 24, 2015
Currently, Test1 triggers an "error", but Test2 doesn't. I would expect them to be treated the same way.