-
Notifications
You must be signed in to change notification settings - Fork 13.3k
#37653 support default impl
for specialization
#37860
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
Changes from all commits
116e983
6427fdc
b0fca5f
715811d
b48eb5e
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 |
---|---|---|
|
@@ -706,14 +706,15 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> { | |
hir::ItemDefaultImpl(..) => { | ||
let data = ImplData { | ||
polarity: hir::ImplPolarity::Positive, | ||
defaultness: hir::Defaultness::Final, | ||
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. Are you sure about this being Final? Does this mean that 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. @nagisa I've read the discussion about
It doesn't address default trait implementations.
and add it to the task list. EDIT: I've placed an error during parsing to avoid 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. I’m not sure this PR is a right place to discuss 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. I agree. After this PR I'll have a better look at |
||
parent_impl: None, | ||
coerce_unsized_info: None, | ||
trait_ref: tcx.impl_trait_ref(def_id).map(|trait_ref| self.lazy(&trait_ref)), | ||
}; | ||
|
||
EntryKind::DefaultImpl(self.lazy(&data)) | ||
} | ||
hir::ItemImpl(_, polarity, ..) => { | ||
hir::ItemImpl(_, polarity, defaultness, ..) => { | ||
let trait_ref = tcx.impl_trait_ref(def_id); | ||
let parent = if let Some(trait_ref) = trait_ref { | ||
let trait_def = tcx.lookup_trait_def(trait_ref.def_id); | ||
|
@@ -740,6 +741,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> { | |
|
||
let data = ImplData { | ||
polarity: polarity, | ||
defaultness: defaultness, | ||
parent_impl: parent, | ||
coerce_unsized_info: coerce_unsized_info, | ||
trait_ref: trait_ref.map(|trait_ref| self.lazy(&trait_ref)), | ||
|
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 has a different order compared to the yacc grammar.
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've changed the parser-lalr.y accordingly to the
[default] [unsafe] impl
order so this file should be ok now