From 033dd5a7f35e90e7187b6614715d8d0bf809d18b Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Thu, 30 Sep 2021 09:29:49 -0700 Subject: [PATCH 1/7] [ci] Bump toolchain version. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57c48cc2..1c6e8b8d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ env: RUSTFLAGS: -D warnings # coverage collection depends on unstable features. # we want the CI results to all be from the same toolchain, so we set it up here. - RUSTUP_TOOLCHAIN: nightly-2021-03-24 + RUSTUP_TOOLCHAIN: nightly-2021-10-30 on: push: branches: From 33543d3aa5a8a0b37ffcd67f46d256a705c636af Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 20:59:37 +0000 Subject: [PATCH 2/7] [ofl] satisfy updated clippy --- ofl/src/server/inject.rs | 2 +- ofl/src/versions.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ofl/src/server/inject.rs b/ofl/src/server/inject.rs index 374ca472..77cbaf93 100644 --- a/ofl/src/server/inject.rs +++ b/ofl/src/server/inject.rs @@ -40,7 +40,7 @@ where fn inject_script_tag(body: &str) -> Option { lol_html::rewrite_str( - &body, + body, RewriteStrSettings { element_content_handlers: vec![element!("head", |head| { info!("inserting script tag"); diff --git a/ofl/src/versions.rs b/ofl/src/versions.rs index 4ff7486c..eae198ce 100644 --- a/ofl/src/versions.rs +++ b/ofl/src/versions.rs @@ -135,14 +135,14 @@ fn update_dependency_version<'doc>( } let dep_version: &mut toml_edit::Value = - if let Some(dep) = dependencies[&package_name].as_table_mut() { + if let Some(dep) = dependencies[package_name].as_table_mut() { if dep.contains_key("version") { dep["version"].as_value_mut().unwrap() } else { // it's a table but it only specifies path or something else weird return false; } - } else if let Some(dep) = dependencies[&package_name].as_value_mut() { + } else if let Some(dep) = dependencies[package_name].as_value_mut() { if let Some(inline) = dep.as_inline_table_mut() { if let Some(version) = inline.get_mut("version") { version From 9f6914576c8cf5adbc01591baff75a676e54e789 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 21:10:15 +0000 Subject: [PATCH 3/7] [core] satisfy updated clippy --- mox/src/lib.rs | 2 +- src/runtime/var.rs | 2 +- topo/src/lib.rs | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mox/src/lib.rs b/mox/src/lib.rs index 528ac525..8b6614e8 100644 --- a/mox/src/lib.rs +++ b/mox/src/lib.rs @@ -375,7 +375,7 @@ impl ToTokens for MoxExpr { trait NodeConvertError { fn node_convert_error(node: &syn_rsx::Node) -> syn::Error { syn::Error::new( - node_span(&node), + node_span(node), format_args!("Cannot convert {} to {}", node.node_type, std::any::type_name::(),), ) } diff --git a/src/runtime/var.rs b/src/runtime/var.rs index e9334464..864d71f3 100644 --- a/src/runtime/var.rs +++ b/src/runtime/var.rs @@ -33,7 +33,7 @@ impl Var { /// Returns a reference to the latest value, pending or committed. pub fn latest(&self) -> &State { - &self.pending.as_ref().unwrap_or(&self.current) + self.pending.as_ref().unwrap_or(&self.current) } /// Initiate a commit to the state variable. The commit will actually diff --git a/topo/src/lib.rs b/topo/src/lib.rs index a86f3832..9db2729f 100644 --- a/topo/src/lib.rs +++ b/topo/src/lib.rs @@ -474,8 +474,6 @@ impl From<&'static Location<'static>> for Callsite { struct Scope { /// current id id: CallId, - /// source location for this scope's root - callsite: Callsite, /// # times each callsite's type has been observed during this scope. callsite_counts: RefCell>, } @@ -491,7 +489,6 @@ impl Scope { { self.increment_count(callsite); let child_point = Self { - callsite, callsite_counts: RefCell::new(Default::default()), id: self.id.child(callsite, slot), }; @@ -523,7 +520,7 @@ impl Scope { impl Default for Scope { fn default() -> Self { - Self { id: CallId::root(), callsite: Callsite::here(), callsite_counts: Default::default() } + Self { id: CallId::root(), callsite_counts: Default::default() } } } From 8f46770ae1628efdccab8bfc007235202fcc4704 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 21:21:19 +0000 Subject: [PATCH 4/7] [ci] don't regenerate lockfiles for ofl, we want to pin the deps for the binary the root lockfile is gitignored so shouldn't matter --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c6e8b8d..67cd1e70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,8 +19,6 @@ jobs: steps: - uses: actions/checkout@master - run: rustup install ${{ env.RUSTUP_TOOLCHAIN }} - - name: ensure lockfile up to date - run: cargo generate-lockfile --manifest-path ofl/Cargo.toml - name: install gnu tar to work around https://github.com/actions/cache/issues/403 if: matrix.os == 'macos-latest' run: | From 0520a1016c96677c9c3d286457ac0b7a3901db52 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 21:30:58 +0000 Subject: [PATCH 5/7] [dom] satisfy updated clippy --- dom/augdom/src/rsdom.rs | 2 +- dom/prettiest/src/lib.rs | 2 +- dom/src/embed.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dom/augdom/src/rsdom.rs b/dom/augdom/src/rsdom.rs index bc97f2a6..c8997d00 100644 --- a/dom/augdom/src/rsdom.rs +++ b/dom/augdom/src/rsdom.rs @@ -64,7 +64,7 @@ impl crate::Dom for Rc { } VirtData::Text(t) => { writer - .write_event(Event::Text(BytesText::from_plain_str(&t))) + .write_event(Event::Text(BytesText::from_plain_str(t))) .expect("writing text node"); } } diff --git a/dom/prettiest/src/lib.rs b/dom/prettiest/src/lib.rs index abf1cc82..7177357d 100644 --- a/dom/prettiest/src/lib.rs +++ b/dom/prettiest/src/lib.rs @@ -161,7 +161,7 @@ impl Debug for Prettified { continue; } - if let Ok(value) = Reflect::get(&obj, &raw_key) { + if let Ok(value) = Reflect::get(obj, &raw_key) { props_seen.insert(key.clone()); if value.is_function() { functions.insert(key); diff --git a/dom/src/embed.rs b/dom/src/embed.rs index c0bc194c..4474e6a4 100644 --- a/dom/src/embed.rs +++ b/dom/src/embed.rs @@ -30,6 +30,7 @@ impl DomLoop { let mut inner = RunLoop::new(Box::new(move || { let parent = CachedNode::new(parent.clone()); + #[allow(clippy::redundant_closure)] // removing the closure syntax makes this FnOnce let new_root = topo::call(|| root()); parent.ensure_child_attached(new_root.to_bind()); From 264c97b889693f0b3d2214878ea143755446d1d4 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 22:24:30 +0000 Subject: [PATCH 6/7] [ci] stop installing gtar the new version of the cache action defaults to it apparently --- .github/workflows/main.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67cd1e70..5e784a34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,11 +19,6 @@ jobs: steps: - uses: actions/checkout@master - run: rustup install ${{ env.RUSTUP_TOOLCHAIN }} - - name: install gnu tar to work around https://github.com/actions/cache/issues/403 - if: matrix.os == 'macos-latest' - run: | - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - uses: actions/cache@v2 with: key: ${{ runner.os }}-ofl-${{ hashFiles('ofl/Cargo.lock') }}-${{ env.RUSTUP_TOOLCHAIN }}-2 @@ -60,11 +55,6 @@ jobs: - name: ensure lockfile up to date run: cargo generate-lockfile - - name: install gnu tar to work around https://github.com/actions/cache/issues/403 - if: matrix.os == 'macos-latest' - run: | - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - uses: actions/cache@v2 with: key: ${{ runner.os }}-coverage-${{ hashFiles('Cargo.lock') }}-${{ env.RUSTUP_TOOLCHAIN }}-2 @@ -103,11 +93,6 @@ jobs: - name: ensure lockfile up to date run: cargo generate-lockfile - - name: install gnu tar to work around https://github.com/actions/cache/issues/403 - if: matrix.os == 'macos-latest' - run: | - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - uses: actions/cache@v2 with: key: ${{ runner.os }}-dom-${{ hashFiles('Cargo.lock') }}-${{ env.RUSTUP_TOOLCHAIN }}-2 @@ -150,11 +135,6 @@ jobs: - name: ensure lockfile up to date run: cargo generate-lockfile - - name: install gnu tar to work around https://github.com/actions/cache/issues/403 - if: matrix.os == 'macos-latest' - run: | - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - uses: actions/cache@v2 with: key: ${{ runner.os }}-website-${{ hashFiles('Cargo.lock') }}-${{ env.RUSTUP_TOOLCHAIN }}-2 From 7f291f61f2aa79d6fd8dc97f1cd29edcef264165 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Sat, 30 Oct 2021 22:30:46 +0000 Subject: [PATCH 7/7] [ofl] limit to 1 cgu when collecting coverage workaround suggested in https://github.com/microsoft/windows-rs/issues/1006#issuecomment-887789950 --- ofl/src/coverage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofl/src/coverage.rs b/ofl/src/coverage.rs index 12f99618..86e9d1c8 100644 --- a/ofl/src/coverage.rs +++ b/ofl/src/coverage.rs @@ -74,7 +74,7 @@ impl Collect { pub fn run(&self, project_root: impl AsRef) -> Result<(), Error> { let mut command = Command::new("cargo"); command - .env("RUSTFLAGS", "-Zinstrument-coverage") + .env("RUSTFLAGS", "-Zinstrument-coverage -Ccodegen-units=1") .env( "LLVM_PROFILE_FILE", project_root