-
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
Generalized article_and_description #67742
Changes from all commits
7f7709e
4d22e75
245062c
66500ef
c678103
7436057
9207a13
7a6361f
9434d6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error[E0521]: borrowed data escapes outside of function | ||
error[E0521]: borrowed data escapes outside of method | ||
--> $DIR/issue-16683.rs:4:9 | ||
| | ||
LL | fn b(&self) { | ||
| ----- `self` is a reference that is only valid in the function body | ||
| ----- `self` is a reference that is only valid in the method body | ||
LL | self.a(); | ||
| ^^^^^^^^ `self` escapes the function body here | ||
| ^^^^^^^^ `self` escapes the method body here | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error[E0521]: borrowed data escapes outside of function | ||
error[E0521]: borrowed data escapes outside of method | ||
--> $DIR/issue-17758.rs:7:9 | ||
| | ||
LL | fn bar(&self) { | ||
| ----- `self` is a reference that is only valid in the function body | ||
| ----- `self` is a reference that is only valid in the method body | ||
LL | self.foo(); | ||
| ^^^^^^^^^^ `self` escapes the function body here | ||
| ^^^^^^^^^^ `self` escapes the method body here | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 { | |
| lifetime `'a` defined here | ||
LL | | ||
LL | if x > y { x } else { y } | ||
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | ||
| ^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... actually, this is not a method... all the others appear correct. And I also just realized, that I don't know why this change in UI happened? Any ideas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change causing this is here: https://github.com/rust-lang/rust/pull/67742/files#diff-5f616dd3631e07b51dd7c59f32ccfb76R433 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... do you mean this one instead? Also, this seems to imply that we are getting a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should rename There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure we have an issue open about this, yeah. |
||
|
||
error: aborting due to previous error | ||
|
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.
I wish I saw this earlier - I think you should always call
def_kind
and only look at thedef_key
or other things ifdef_kind
returnedNone
.The reason is that
DefKind
should eventually encompass every possibleDefId
, and the current situation is a transitional one (sinceDefKind
was split out of name resolution, which only needs the current set of possibleDefKind
s).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.
I don't know if there is an issue for finishing
DefKind
, but feel free to work on that, or open one if there isn't one already.Ideally
def_key
would be used in as few places as possible, as it's really the "name" of a definition more than anything else.