-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rustup to rustc 1.16.0-nightly (24055d0f2 2017-01-31) #1505
Conversation
59548dc
to
aceb290
Compare
clippy_lints/src/lifetimes.rs
Outdated
@@ -275,9 +278,6 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> { | |||
|
|||
fn visit_ty(&mut self, ty: &'tcx Ty) { | |||
match ty.node { | |||
TyRptr(None, _) => { | |||
self.record(&None); | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be TyRptr(ref lt, _) if lt.is_elided() =>
clippy_lints/src/lifetimes.rs
Outdated
@@ -230,6 +230,9 @@ impl<'v, 't> RefVisitor<'v, 't> { | |||
if let Some(ref lt) = *lifetime { | |||
if &*lt.name.as_str() == "'static" { | |||
self.lts.push(RefLt::Static); | |||
} else if lt.name.as_u32() == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's lt.is_elided()
@@ -142,7 +142,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass { | |||
|
|||
|
|||
fn is_lint_ref_type(ty: &Ty) -> bool { | |||
if let TyRptr(Some(_), MutTy { ty: ref inner, mutbl: MutImmutable }) = ty.node { | |||
if let TyRptr(_, MutTy { ty: ref inner, mutbl: MutImmutable }) = ty.node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a !is_elided
check on the lifetime.
b3387b5
to
c59abc3
Compare
c59abc3
to
d68f079
Compare
@eddyb: do you have any hints as to how lifetime elision changed in the following snippet? fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() } |
Whar are you talking about, there's no elision there. |
right. That was badly formulated. The lifetimes represented by rustc have changed, but I can't figure out how your code changes would even affect this code snippet. |
Did something user-observed change, or just the compiler-internal representation? If the latter, all lifetimes (in types) are explicit now. |
@eddyb: just compiler-internal representation changes. if the |
Yeah, almost everything looking at a lifetime needs to ask |
I'm not sure if its possible to distinguish between these two cases without more context: fn trait_obj_elided<'a>(_arg: &'a WithLifetime) -> &'a str;
fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str; Both args are essentially the same:
|
we don't need to, we just need to ignore the TyTraitObject lifetime in case it is elided. I took the liberty of pushing the patch directly to this PR. |
@oli-obk Could you publish a git tag when you publish a new version? |
I tried to, it didn't accept leaving the message empty, so I wanted to check what you usually wrote into it, then I forgot about it... Do you think it would make sense to stop filling in the CHANGELOG, and instead use the tagging feature to fill in the same information but in a structured manner? |
Only signed tags need a message. I usually just write the version number. |
Relevant rustc changes:
tcx.map
totcx.hir
Tables
toTypeckTables
fixes #1475 and #1485