-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
WIP: stability annotations on generic parameters #65083
Changes from all commits
04243e3
109d416
1519c0a
20cfb59
4f27d22
f5edbe9
6233993
3c8f740
72e4a24
6452165
57cdd33
8bcf35d
5551143
074ef54
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
//! Conversion from AST representation of types to the `ty.rs` representation. | ||
//! The main routine here is `ast_ty_to_ty()`; each use is parameterized by an | ||
//! instance of `AstConv`. | ||
// ignore-tidy-filelength | ||
varkor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// ignore-tidy-filelength | ||
|
||
|
@@ -697,7 +698,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |
(GenericParamDefKind::Lifetime, GenericArg::Lifetime(lt)) => { | ||
self.ast_region_to_region(<, Some(param)).into() | ||
} | ||
(GenericParamDefKind::Type { .. }, GenericArg::Type(ty)) => { | ||
(GenericParamDefKind::Type { has_default, .. }, GenericArg::Type(ty)) => { | ||
if *has_default { | ||
tcx.check_stability_internal( | ||
param.def_id, | ||
Some(arg.id()), | ||
arg.span(), | ||
false, | ||
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. Why do we have to override deprecation checking for generic arguments? 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. If the parent is deprecated, the user will already have a warning, If we were to produce another warning we would see:
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. Can you add a comment to this effect? 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. Will do |
||
|_, _| (), | ||
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. Is there a good reason that generic arguments have to be special cased in this way? 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 100% sure. It avoids a parameter being unmarked, I suspect the reason it's unmarked is #65083 (comment). I'm not aware of a work around for it. 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. I'm not quite sure I understood what you meant by that comment. 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. My thinking is along those lines, it's referring to On the previous broken version of this pr I tested this extensively, I should still have the build logs somewhere, I try to review them and possible modernize them. |
||
); | ||
} | ||
|
||
self.ast_ty_to_ty(&ty).into() | ||
} | ||
(GenericParamDefKind::Const, GenericArg::Const(ct)) => { | ||
|
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.
The
!inherit_dep
condition can be lifted out of this entire block (and probably renamed tocheck_deprecation
).