-
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
Rust: rename TypeRef
and *Type
to *TypeRepr
, ty
to type_repr
, and expand some abbreviations in generated docs
#18174
base: main
Are you sure you want to change the base?
Conversation
Why do we want to rename |
These are all instances of types written in the code (they are |
(a thing we don't have, yet) |
Thanks for the explanation @redsun82 👍 🙏 . I guess the name "Ref" wasn't immediately intuitive to me, but aside from that it makes sense. It's the distinction between syntax or notation representing a type and the actual type itself. |
we could also opt for using |
Yes, subjectively I think that would be better! That also avoids clashes/confusion with the Rust concept of a reference. For instance the current class name |
*Type
to *TypeRef
and expand some abbreviations in generated docsTypeRef
and *Type
to *TypeRepr
and expand some abbreviations in generated docs
import codeql.rust.elements.Pat | ||
import codeql.rust.elements.Path | ||
import codeql.rust.elements.PathExpr | ||
import codeql.rust.elements.PathExprBase | ||
import codeql.rust.elements.PathPat | ||
import codeql.rust.elements.PathSegment | ||
import codeql.rust.elements.PathType | ||
import codeql.rust.elements.PathTypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.PathSegment
import codeql.rust.elements.Rename | ||
import codeql.rust.elements.Resolvable | ||
import codeql.rust.elements.RestPat | ||
import codeql.rust.elements.RetType | ||
import codeql.rust.elements.RetTypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.AssocTypeArg
Redundant import, the module is already imported inside
codeql.rust.elements.ClosureExpr
Redundant import, the module is already imported inside
codeql.rust.elements.FnPtrTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.Function
Redundant import, the module is already imported inside
codeql.rust.elements.PathSegment
import codeql.rust.elements.TypeAlias | ||
import codeql.rust.elements.TypeArg | ||
import codeql.rust.elements.TypeBound | ||
import codeql.rust.elements.TypeBoundList | ||
import codeql.rust.elements.TypeParam | ||
import codeql.rust.elements.TypeRef | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.ArrayTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.AssocTypeArg
Redundant import, the module is already imported inside
codeql.rust.elements.CastExpr
Redundant import, the module is already imported inside
codeql.rust.elements.Const
Redundant import, the module is already imported inside
codeql.rust.elements.ConstParam
Redundant import, the module is already imported inside
codeql.rust.elements.DynTraitTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.FnPtrTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.ForTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.Impl
Redundant import, the module is already imported inside
codeql.rust.elements.ImplTraitTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.InferTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.LetStmt
Redundant import, the module is already imported inside
codeql.rust.elements.MacroTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.NeverTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.OffsetOfExpr
Redundant import, the module is already imported inside
codeql.rust.elements.ParamBase
Redundant import, the module is already imported inside
codeql.rust.elements.ParenTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.PathSegment
Redundant import, the module is already imported inside
codeql.rust.elements.PathTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.PtrTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.RecordField
Redundant import, the module is already imported inside
codeql.rust.elements.RefTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.RetTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.SliceTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.Static
Redundant import, the module is already imported inside
codeql.rust.elements.TupleField
Redundant import, the module is already imported inside
codeql.rust.elements.TupleTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.TypeAlias
Redundant import, the module is already imported inside
codeql.rust.elements.TypeArg
Redundant import, the module is already imported inside
codeql.rust.elements.TypeBound
Redundant import, the module is already imported inside
codeql.rust.elements.TypeParam
Redundant import, the module is already imported inside
codeql.rust.elements.WherePred
import codeql.rust.elements.ReturnTypeSyntax | ||
import codeql.rust.elements.TypeBoundList | ||
import codeql.rust.elements.TypeRef | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.RetTypeRepr
import codeql.rust.elements.Abi | ||
import codeql.rust.elements.ParamList | ||
import codeql.rust.elements.RetTypeRepr | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.RetTypeRepr
import codeql.rust.elements.ReturnTypeSyntax | ||
import codeql.rust.elements.TypeRef | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.PathTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.RetTypeRepr
*/ | ||
|
||
private import internal.RetTypeReprImpl | ||
import codeql.rust.elements.AstNode |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.TypeRepr
import codeql.rust.elements.ReturnTypeSyntax | ||
import codeql.rust.elements.TypeBoundList | ||
import codeql.rust.elements.TypeRef | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning generated
codeql.rust.elements.RetTypeRepr
import codeql.rust.elements.ReturnTypeSyntax | ||
import codeql.rust.elements.TypeRef | ||
import codeql.rust.elements.TypeRepr |
Check warning
Code scanning / CodeQL
Redundant import Warning generated
codeql.rust.elements.PathTypeRepr
Redundant import, the module is already imported inside
codeql.rust.elements.RetTypeRepr
TypeRef
and *Type
to *TypeRepr
and expand some abbreviations in generated docsTypeRef
and *Type
to *TypeRepr
, ty
to type_repr
, and expand some abbreviations in generated docs
@paldepind I went with the rename to |
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.
Really great changes 🤩
We were already renaming the tip of the type reference hierarchy from
Type
toTypeRef
but weren't doing so with all its descendants.Additionally, the
pat
andty
abbreviations are now expanded in generated documentation.