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
The text was updated successfully, but these errors were encountered:
lidanyang
changed the title
13.2.2 491页 “step1函数第一个参数&val生命周期本来是'a,因为协变而变成'static”
13.2.2 491页 “step1函数第一个参数&val生命周期本来是'a,因为协变而变成'static,所以借用检查就正常通过了”
Jan 15, 2023
“step1函数第一个参数&val生命周期本来是'a,因为协变而变成'static,所以借用检查就正常通过了”这句话没看懂:
1、 “&val声明周期本来是'a”,这个'a是指step1函数生命周期参数的那个'a吗?如果是的话,是不是指函数内部的局部变量会默认继承函数自身的生命周期参数?
2. “协变而变成'static”。这里的“协变成”的意义是啥?
3. step1的生命周期参数'a不是会单态化成'static吗,为啥会有协变呢,从传参那一刻‘a不就单态化了么?
已经看了这一节一天了,卡在这里,查了各种资料、文档,虽然明白了协变、逆变、不变这些概念什么意思,但是还是没搞懂这里说的啥意思,没搞懂为啥能骗过借用检查,希望能得到一点解答。
The text was updated successfully, but these errors were encountered: