Repository navigation
ctest: add support for modules #5459
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
Draft
dybucc
wants to merge
100
commits into
rust-lang:main
Choose a base branch
from
dybucc:feature/ctest-specific-modules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,696
−717
Draft
Changes from all commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
218d76a
ctest: parse rust modules in crates
dybucc 54e6897
ctest: add support for filtering modules
dybucc 60b0cdd
ctest(remove): showcase skipping items with mods
dybucc 30cf354
ctest: fmt comments
dybucc c75758b
ctest: differentiate between `ident` and `path`
dybucc 3c74044
ctest: adjust `ident` call sites with new fns
dybucc b6de492
ctest(maybe_remove): tweak a little something
dybucc da30907
ctest: tweak tests and test template to pass them
dybucc a15dd2f
ctest: update test templates
dybucc 5cc36f1
ctest: fmt a string to 80 characters wide
dybucc 56204ba
chore: wip
dybucc 372aa56
chore: wip
dybucc 7e16883
chore: wip
dybucc eec5bcf
chore: wip
dybucc 3969d83
chore: wip
dybucc 4fb056d
chore: wip
dybucc ac79172
chore: wip
dybucc c2573e7
chore: wip
dybucc c7b1d2a
chore: wip
dybucc c89b68e
chore: wip
dybucc e9c28d4
chore: wip
dybucc 5cbef5a
chore: wip
dybucc add0dcb
chore: wip
dybucc cf666c4
chore: wip
dybucc 1e2e440
chore: wip
dybucc ab44844
chore: wip
dybucc 2463ee8
chore: wip
dybucc 87890d9
chore: wip
dybucc 0c419dd
chore: wip
dybucc 4b05ed4
chore: wip
dybucc 8ae9aaa
chore: wip
dybucc 1bce5b4
chore: wip
dybucc c9507dd
chore: wip
dybucc 3c4553d
chore: wip
dybucc a9b1dd6
chore: wip
dybucc 9a86503
chore: wip
dybucc 1b1e58e
chore: wip
dybucc dbccfb9
chore: wip
dybucc 366231b
chore: wip
dybucc 4135ca6
chore: wip
dybucc 0114011
chore: wip
dybucc 6c58b3c
chore: wip
dybucc b376b8d
chore: wip
dybucc 68f45b5
chore: wip
dybucc a37e9be
chore: wip
dybucc 4b7454b
chore: wip
dybucc bb13837
chore: wip
dybucc f3032eb
chore: wip
dybucc 68cb6e1
chore: wip
dybucc 35051cc
chore: wip
dybucc cf06ec2
chore: wip
dybucc eeb55b1
chore: wip
dybucc 7fa5dbd
chore: wip
dybucc 328fde6
chore: wip
dybucc e2b41f9
chore: wip
dybucc 75de193
chore: wip
dybucc 64021b8
chore: wip
dybucc a9ec090
chore: wip
dybucc 1802430
chore: wip
dybucc 3234a5e
chore: wip
dybucc f200494
chore: wip
dybucc 7045a17
chore: wip
dybucc 03755ad
chore: wip
dybucc 8d2e81d
chore: wip
dybucc b2935cc
chore: wip
dybucc 4cf8c4f
chore: wip
dybucc 434af88
chore: wip
dybucc 612934c
chore: wip
dybucc f8b0a01
chore: wip
dybucc fbb78a0
chore: wip
dybucc d6d6632
chore: wip
dybucc 8ecebe6
chore: wip
dybucc 5236670
chore: wip
dybucc cd67391
chore: wip
dybucc 6b1e4a5
chore: wip
dybucc bbb379b
chore: wip
dybucc 2f0d41f
chore: wip
dybucc 979518f
chore: wip
dybucc cd78d96
chore: wip
dybucc b8b9d7d
chore: wip
dybucc f0fd893
chore: wip
dybucc 80ad720
chore: wip
dybucc c849cee
chore: wip
dybucc 88895c9
chore: wip
dybucc 72f52fd
chore: wip
dybucc 05a734d
chore: wip
dybucc abc63f4
chore: wip
dybucc 4077968
chore: wip
dybucc 9df2270
chore: wip
dybucc 75eb6ff
chore: wip
dybucc 6786cd3
chore: wip
dybucc acd903b
chore: wip
dybucc 77f2eeb
chore: wip
dybucc 52ec4b1
chore: wip
dybucc 4d6ee90
chore: wip
dybucc 2db4255
chore: wip
dybucc 845db16
chore: wip
dybucc 44c7819
chore: wip
dybucc ac54788
chore: wip
dybucc 986475a
chore: wip
dybucc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,64 @@ | ||
| use syn::{ | ||
| Path, | ||
| Type, | ||
| }; | ||
|
|
||
| use crate::BoxStr; | ||
| use crate::ast::{ | ||
| PathAggregateStore, | ||
| PathUtils, | ||
| }; | ||
|
|
||
| /// Represents a constant variable defined in Rust. | ||
| #[derive(Debug, Clone)] | ||
| #[derive(Debug, Clone, PartialEq)] | ||
| pub struct Const { | ||
| pub(crate) public: bool, | ||
| pub(crate) ident: BoxStr, | ||
| pub(crate) ty: syn::Type, | ||
| pub(crate) cached_path: BoxStr, | ||
| pub(crate) cached_ident: BoxStr, | ||
| pub(crate) path: Path, | ||
| pub(crate) path_aggregate: PathAggregateStore, | ||
| pub(crate) ty: Type, | ||
| } | ||
|
|
||
| impl Const { | ||
| /// Return the identifier of the constant as a string. | ||
| /// Return the full path to the constant variable as a string. | ||
| /// | ||
| /// If inside a nested module, this will return a top-level-relative path, | ||
| /// but not a crate-relative path. For some item `foo` in module | ||
| /// `crate::bar`, the returned string will be `bar::foo`, and not | ||
| /// `crate::bar::foo`. | ||
| pub fn path(&self) -> &str { | ||
| &self.cached_path | ||
| } | ||
|
|
||
| /// Returns the last segment of the constant's path; Namely, its identifier. | ||
| pub fn ident(&self) -> &str { | ||
| &self.ident | ||
| &self.cached_ident | ||
| } | ||
| } | ||
|
|
||
| impl PathUtils for Const { | ||
| fn path_aggregate(&self) -> &PathAggregateStore { | ||
| &self.path_aggregate | ||
| } | ||
|
|
||
| fn path(&self) -> &Path { | ||
| &self.path | ||
| } | ||
|
|
||
| fn mk( | ||
| self, | ||
| cached_path: BoxStr, | ||
| cached_ident: BoxStr, | ||
| path: Path, | ||
| path_aggregate: PathAggregateStore, | ||
| ) -> Self { | ||
| Self { | ||
| cached_path, | ||
| cached_ident, | ||
| path, | ||
| path_aggregate, | ||
| ..self | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
If the
syn::Pathisn't needed for anything else, instead store anident_start: usizeand makeidentreturn&self.path[self.ident_start..]View changes since the review
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.
Thanks, but I don't think this is nearly ready for review just yet.
There's too much of a mess in the patchset to expect anyone to review
it.