-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Clarify and document region nesting rules #10151
Comments
Today btw we are pretty liberal: if you have &'a T, then |
cc @pnkfelix Any update on this? |
I'll need some help to document this... |
@steveklabnik let's talk ;) |
Okay, so after some discussions, this ticket feels like something we'd want well-defined for a formalism, but rarely comes up when you're writing Rust code. as such, i'm going to close it, because once we start formalizing, we'll want a systematic attack, but for now, random issues about it aren't helpful. |
Stop bytes_nth from suggesting code that does not compile Fixes rust-lang#10151 As discussed in the issue, this PR changes the lint in 2 ways 1. Replace `bytes().nth(n).unwrap()` with `as_bytes()[n]` 2. Replace other `bytes().nth(n)` with `as_bytes().get(n).copied()` --- changelog: Stop bytes_nth from suggesting code that does not compile in some cases
We currently infer some special relationships between regions based on region nesting. i.e., if you have
fn foo<'a,'b>(x: &'a &'b int)
, we infer that'a <= 'b
. This is important for type checking impls, though it will become less so (and possibly irrelevant even) after DST (#6308) lands. In any case, in the meantime, as part of formalizing the type system, we should clarify precisely which kinds of nesting relationships yield subtyping relations. I have a FIXME in the code for the spot where this ought to be done.The text was updated successfully, but these errors were encountered: