about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-12-24 09:52:37 +0000
committerGitHub <noreply@github.com>2024-12-24 09:52:37 +0000
commita63d166eeb9c95e6fd71db64ee7f64aca6eb3409 (patch)
tree230f2cd6c50839c5e4350e1293c4d936cf0dfcf3 /src
parent417dcc41437bf9a4d093316791740df8ad61496a (diff)
parent9251d422b8c7bfad59d1efd7c4f9fa613c577cd2 (diff)
downloadrust-a63d166eeb9c95e6fd71db64ee7f64aca6eb3409.tar.gz
rust-a63d166eeb9c95e6fd71db64ee7f64aca6eb3409.zip
Merge pull request #18750 from Veykril/push-tyvtqpwrwvsr
Back out "internal: Disable rustc test metrics"
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/.github/workflows/metrics.yaml9
-rw-r--r--src/tools/rust-analyzer/crates/mbe/src/syntax_bridge/tests.rs101
2 files changed, 7 insertions, 103 deletions
diff --git a/src/tools/rust-analyzer/.github/workflows/metrics.yaml b/src/tools/rust-analyzer/.github/workflows/metrics.yaml
index a4146d60218..9313ca237d9 100644
--- a/src/tools/rust-analyzer/.github/workflows/metrics.yaml
+++ b/src/tools/rust-analyzer/.github/workflows/metrics.yaml
@@ -54,7 +54,7 @@ jobs:
   other_metrics:
     strategy:
       matrix:
-        names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
+        names: [self, rustc_tests, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
     runs-on: ubuntu-latest
     needs: build_metrics
 
@@ -101,6 +101,11 @@ jobs:
         with:
           name: self-${{ github.sha }}
 
+      - name: Download rustc_tests metrics
+        uses: actions/download-artifact@v3
+        with:
+          name: rustc_tests-${{ github.sha }}
+
       - name: Download ripgrep-13.0.0 metrics
         uses: actions/download-artifact@v4
         with:
@@ -129,7 +134,7 @@ jobs:
           chmod 700 ~/.ssh
 
           git clone --depth 1 git@github.com:rust-analyzer/metrics.git
-          jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
+          jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5] * .[6]" build.json self.json rustc_tests.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
           cd metrics
           git add .
           git -c user.name=Bot -c user.email=dummy@example.com commit --message 📈
diff --git a/src/tools/rust-analyzer/crates/mbe/src/syntax_bridge/tests.rs b/src/tools/rust-analyzer/crates/mbe/src/syntax_bridge/tests.rs
deleted file mode 100644
index 2988fb3cf15..00000000000
--- a/src/tools/rust-analyzer/crates/mbe/src/syntax_bridge/tests.rs
+++ /dev/null
@@ -1,101 +0,0 @@
-use rustc_hash::FxHashMap;
-use span::Span;
-use syntax::{ast, AstNode};
-use test_utils::extract_annotations;
-use tt::{
-    buffer::{TokenBuffer, TokenTreeRef},
-    Leaf, Punct, Spacing,
-};
-
-use crate::{syntax_node_to_token_tree, DocCommentDesugarMode, DummyTestSpanMap, DUMMY};
-
-fn check_punct_spacing(fixture: &str) {
-    let source_file = ast::SourceFile::parse(fixture, span::Edition::CURRENT).ok().unwrap();
-    let subtree = syntax_node_to_token_tree(
-        source_file.syntax(),
-        DummyTestSpanMap,
-        DUMMY,
-        DocCommentDesugarMode::Mbe,
-    );
-    let mut annotations: FxHashMap<_, _> = extract_annotations(fixture)
-        .into_iter()
-        .map(|(range, annotation)| {
-            let spacing = match annotation.as_str() {
-                "Alone" => Spacing::Alone,
-                "Joint" => Spacing::Joint,
-                a => panic!("unknown annotation: {a}"),
-            };
-            (range, spacing)
-        })
-        .collect();
-
-    let buf = TokenBuffer::from_subtree(&subtree);
-    let mut cursor = buf.begin();
-    while !cursor.eof() {
-        while let Some(token_tree) = cursor.token_tree() {
-            if let TokenTreeRef::Leaf(
-                Leaf::Punct(Punct { spacing, span: Span { range, .. }, .. }),
-                _,
-            ) = token_tree
-            {
-                if let Some(expected) = annotations.remove(range) {
-                    assert_eq!(expected, *spacing);
-                }
-            }
-            cursor = cursor.bump_subtree();
-        }
-        cursor = cursor.bump();
-    }
-
-    assert!(annotations.is_empty(), "unchecked annotations: {annotations:?}");
-}
-
-#[test]
-fn punct_spacing() {
-    check_punct_spacing(
-        r#"
-fn main() {
-    0+0;
-   //^ Alone
-    0+(0);
-   //^ Alone
-    0<=0;
-   //^ Joint
-   // ^ Alone
-    0<=(0);
-   // ^ Alone
-    a=0;
-   //^ Alone
-    a=(0);
-   //^ Alone
-    a+=0;
-   //^ Joint
-   // ^ Alone
-    a+=(0);
-   // ^ Alone
-    a&&b;
-   //^ Joint
-   // ^ Alone
-    a&&(b);
-   // ^ Alone
-    foo::bar;
-   //  ^ Joint
-   //   ^ Alone
-    use foo::{bar,baz,};
-   //       ^ Alone
-   //            ^ Alone
-   //                ^ Alone
-    struct Struct<'a> {};
-   //            ^ Joint
-   //             ^ Joint
-    Struct::<0>;
-   //       ^ Alone
-    Struct::<{0}>;
-   //       ^ Alone
-    ;;
-  //^ Joint
-  // ^ Alone
-}
-        "#,
-    );
-}