Skip to content
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

chore: Update rust-toolchain to nightly-2023-10-04 #1095

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

simonbuchan
Copy link
Contributor

Description:

Just updating the toolchain to the latest to get my toes wet. Everything I could try still seems to act the same as far as I can tell, just needed to bump proc-macro2 for a removed feature, and I set workspace.resolver explicitly due to what seems like a new warning - since there aren't any top-level dependencies it seems like this didn't change any dependencies?

BREAKING CHANGE:

Shouldn't be anything other than possibly affecting MSRV if there is any policy there.

Related issue (if exists):

Last update was #1034

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

⚠️ No Changeset found

Latest commit: bdd2e2f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Oct 4, 2023

CLA assistant check
All committers have signed the CLA.

@simonbuchan
Copy link
Contributor Author

Ah, of course I should have expected fmt / clippy changes :| They seem harmless enough?

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Thank you for the PR!
Commit: bdd2e2f

Files to check

These are files which is affected by the current PR, but not reflected. If there's no file below this message, please ignore this message.

You can run ./scripts/auto-unignore.sh from crates/stc_ts_file_analyzer for typescript files, and ./scripts/check.sh from crates/stc_ts_type_checker for *.stats.rust-debug files.

@simonbuchan
Copy link
Contributor Author

simonbuchan commented Oct 5, 2023

Let me know if you have any questions or preferred fixes.

The main one is bitflags! now triggers clippy::bad_bit_mask with const None = 0, so I just moved the definition out of line - maybe bumping to bitflags 2.x would fix that, but there were enough changes and it's recent enough I felt that was a bit too much churn. Also, since the Default implementations for the two affected ones are derivable I just did that too.

The Inliner<T> type also triggered a couple of "non-canonical implementation" lints - I don't know that they're actually any better, but it was an automatically applicable fix, so shrug?

use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax, TsConfig};
use swc_macros_common::{call_site, print};
use syn::{punctuated::Punctuated, Token};

#[proc_macro]
pub fn builtin(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
swc_common::GLOBALS.set(&swc_common::Globals::new(), || {
let cm = Arc::new(SourceMap::new(FilePathMapping::empty()));
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was complaining about Arc on a non-Send/Sync type, interestingly. I think that's probably a clippy bug? Strictly, you don't even need an rc at all, but the docs for SourceMap suggest using this alias, which suppresses the lint.

@@ -27,6 +27,7 @@ impl Analyzer<'_, '_> {
/// orders.
///
/// After splitting, we can check if each element is assignable.
#[allow(clippy::needless_pass_by_ref_mut)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complaining about data not being mutably used here (though it's not even actually used, there's an allow(unused))

I didn't want to change APIs here, but that's probably more correct.

"infer_arg_types: {:?}",
type_params.iter().map(|p| format!("{}, ", p.name)).collect::<String>()
);
warn!("infer_arg_types: {:?}", type_params.iter().map(|p| &p.name).join(", "));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically a different format (no trailing , ), but it was complaining about the inefficient format, and this is much clearer.

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! All looks good

@kdy1 kdy1 merged commit 105ff10 into dudykr:main Oct 5, 2023
7 checks passed
@simonbuchan simonbuchan deleted the toolchain branch October 5, 2023 02:22
sunrabbit123 pushed a commit to sunrabbit123/stc that referenced this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants