From 91dbbbcfbd4af3ea57baab3009c02577151fc163 Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Fri, 26 May 2017 21:11:02 -0400 Subject: [PATCH] subtyping: clarify the concreteness of 'a in example This matters because if 'a were free to choose, then the argument would be trivial. But in reality the argument also holds if 'a was already chosen, which is what makes lifetimes special. --- src/subtyping.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/subtyping.md b/src/subtyping.md index d771712..17a5656 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -11,10 +11,11 @@ confusion, because it seems intuitively backwards to many: the bigger scope is a *subtype* of the smaller scope. This does in fact make sense, though. The intuitive reason for this is that if -you expect an `&'a u8`, then it's totally fine for me to hand you an `&'static -u8`, in the same way that if you expect an Animal in Java, it's totally fine for -me to hand you a Cat. Cats are just Animals *and more*, just as `'static` is -just `'a` *and more*. +you expect an `&'a u8` (for some concrete `'a` that you have already chosen), +then it's totally fine for me to hand you an `&'static u8` even if `'static != +'a`, in the same way that if you expect an Animal in Java, it's totally fine +for me to hand you a Cat. Cats are just Animals *and more*, just as `'static` +is just `'a` *and more*. (Note, the subtyping relationship and typed-ness of lifetimes is a fairly arbitrary construct that some disagree with. However it simplifies our analysis