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

build(cargo): Update rustc to nightly-2024-04-03 #8821

Merged
merged 58 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
942a0fa
Fix CI
kdy1 Apr 8, 2024
38e7342
Update rustc
kdy1 Apr 8, 2024
11448fb
--fix
kdy1 Apr 8, 2024
9dcda4c
--fix
kdy1 Apr 8, 2024
f78d1b1
--fix
kdy1 Apr 8, 2024
24f8242
lint
kdy1 Apr 8, 2024
e5864a0
fix
kdy1 Apr 8, 2024
7eea138
fix
kdy1 Apr 8, 2024
70ac073
fix
kdy1 Apr 8, 2024
bd17928
fix
kdy1 Apr 8, 2024
e0756db
fix
kdy1 Apr 8, 2024
2976cec
fix
kdy1 Apr 8, 2024
5c6a65c
fix
kdy1 Apr 8, 2024
ec8f705
fix
kdy1 Apr 8, 2024
693ebd2
fix
kdy1 Apr 8, 2024
8dd360b
fix
kdy1 Apr 8, 2024
568202e
fix
kdy1 Apr 8, 2024
b36bb5a
fix
kdy1 Apr 8, 2024
e0c6af7
fix
kdy1 Apr 8, 2024
5fd091f
fix
kdy1 Apr 8, 2024
026e12f
MSRv
kdy1 Apr 8, 2024
7d7bd7c
fix
kdy1 Apr 8, 2024
17835b0
fix
kdy1 Apr 8, 2024
4259e38
fix
kdy1 Apr 8, 2024
e7538e0
fix
kdy1 Apr 8, 2024
9cbd0bd
fix
kdy1 Apr 8, 2024
0a54d34
fix
kdy1 Apr 8, 2024
a81518d
fix
kdy1 Apr 8, 2024
a9dae74
fix
kdy1 Apr 8, 2024
daf207b
fix
kdy1 Apr 8, 2024
e4c1759
Discard changes to crates/swc_ecma_compat_es2015/src/generator.rs
kdy1 Apr 8, 2024
0a28712
fix
kdy1 Apr 8, 2024
69c5eb8
fix
kdy1 Apr 8, 2024
7eb0819
clippy
kdy1 Apr 8, 2024
eb282e7
rust-toolchian
kdy1 Apr 8, 2024
9a07f9e
fix
kdy1 Apr 8, 2024
7e57ac4
more fix
kdy1 Apr 8, 2024
c57a716
fix
kdy1 Apr 8, 2024
8e56b32
fix
kdy1 Apr 8, 2024
5bfd32a
Add dbg
kdy1 Apr 8, 2024
b73aa17
Update rkyv
kdy1 Apr 8, 2024
8dd702e
lockfile
kdy1 Apr 8, 2024
a6518f3
typo
kdy1 Apr 15, 2024
3f57bc6
proc-macro2
kdy1 Apr 15, 2024
5ed2c91
fix
kdy1 Apr 15, 2024
758b8b2
proc-macro2="=1.0.79"
kdy1 Apr 15, 2024
eb79aec
Update test refs
kdy1 Apr 15, 2024
960a0c3
faster
kdy1 Apr 15, 2024
0727ee6
fast
kdy1 Apr 15, 2024
c5eb294
proc-macro2 = "=1.0.79"
kdy1 Apr 15, 2024
5c4a07c
proc-macro2 = "=1.0.79"
kdy1 Apr 15, 2024
f3ca818
log
kdy1 Apr 15, 2024
2d76b4c
log
kdy1 Apr 15, 2024
f411e85
log
kdy1 Apr 15, 2024
ca85bb9
unsafe
kdy1 Apr 16, 2024
c55c25b
remove
kdy1 Apr 16, 2024
8bf9c5e
Merge branch 'main' into fix-ci
kdy1 Apr 16, 2024
47310d5
proc-macro2 = "=1.0.79"
kdy1 Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Also, SWC tries to ensure that

for rust users.

MSRV of crates is currently nightly, but we will support stable rustc again in the future.
MSRV of crates is currently `1.71`.

To update all SWC crates you use, you can run `curl https://raw.githubusercontent.com/swc-project/swc/main/scripts/update-all-swc-crates.sh | bash -s`. This script will update all dependencies to the latest version and run `cargo build` to ensure that everything works.
Note that you need
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ ignore-interior-mutability = [
"swc_atoms::JsWord",
"swc_ecma_ast::Id",
]
msrv = "1.58"
msrv = "1.71"
type-complexity-threshold = 25000
1 change: 0 additions & 1 deletion crates/ast_node/src/ast_node_macro.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use swc_macros_common::prelude::*;
use syn::{
self,
parse::{Parse, ParseStream},
*,
};
Expand Down
1 change: 0 additions & 1 deletion crates/ast_node/src/enum_deserialize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use swc_macros_common::prelude::*;
use syn::{
self,
parse::{Parse, ParseStream},
*,
};
Expand Down
2 changes: 1 addition & 1 deletion crates/ast_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate proc_macro;

use quote::quote;
use swc_macros_common::prelude::*;
use syn::{self, visit_mut::VisitMut, *};
use syn::{visit_mut::VisitMut, *};

mod ast_node_macro;
mod enum_deserialize;
Expand Down
2 changes: 1 addition & 1 deletion crates/string_enum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate proc_macro;

use quote::quote_spanned;
use swc_macros_common::prelude::*;
use syn::{self, parse::Parse, *};
use syn::{parse::Parse, *};

/// Creates `.as_str()` and then implements `Debug` and `Display` using it.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/swc/examples/minify.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{path::Path, sync::Arc};

use anyhow::Context;
use swc::{self, config::JsMinifyOptions, try_with_handler, BoolOrDataConfig};
use swc::{config::JsMinifyOptions, try_with_handler, BoolOrDataConfig};
use swc_common::{SourceMap, GLOBALS};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion crates/swc/examples/transform.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{path::Path, sync::Arc};

use anyhow::Context;
use swc::{self, try_with_handler};
use swc::try_with_handler;
use swc_common::{SourceMap, GLOBALS};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion crates/swc/examples/transform_error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use anyhow::Context;
use swc::{self, try_with_handler};
use swc::try_with_handler;
use swc_common::{errors::ColorConfig, FileName, SourceMap, GLOBALS};

fn main() {
Expand Down
17 changes: 4 additions & 13 deletions crates/swc/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,9 @@ impl Options {
}
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
pub enum RootMode {
#[default]
#[serde(rename = "root")]
Root,
#[serde(rename = "upward")]
Expand All @@ -793,11 +794,6 @@ pub enum RootMode {
UpwardOptional,
}

impl Default for RootMode {
fn default() -> Self {
RootMode::Root
}
}
const fn default_swcrc() -> bool {
true
}
Expand Down Expand Up @@ -1179,21 +1175,16 @@ pub struct JscOutputConfig {
pub preamble: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub enum OutputCharset {
#[default]
#[serde(rename = "utf8")]
Utf8,
#[serde(rename = "ascii")]
Ascii,
}

impl Default for OutputCharset {
fn default() -> Self {
OutputCharset::Utf8
}
}

/// `jsc.experimental` in `.swcrc`
#[derive(Debug, Default, Clone, Serialize, Deserialize, Merge)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
Expand Down
2 changes: 1 addition & 1 deletion crates/swc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ use swc_common::{
pub use swc_compiler_base::{PrintArgs, TransformOutput};
pub use swc_config::config_types::{BoolConfig, BoolOr, BoolOrDataConfig};
use swc_ecma_ast::{EsVersion, Program};
use swc_ecma_codegen::{self, Node};
use swc_ecma_codegen::Node;
use swc_ecma_loader::resolvers::{
lru::CachingResolver, node::NodeModulesResolver, tsc::TsConfigResolver,
};
Expand Down
14 changes: 6 additions & 8 deletions crates/swc/tests/fixture/issues-8xxx/8020/output/1.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { _ as _dispose } from "@swc/helpers/_/_dispose";
import { _ as _using } from "@swc/helpers/_/_using";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
function baz() {
return bar;
}
try {
var _stack = [];
var foo = _using(_stack, null);
var bar = 1;
var _usingCtx = _using_ctx();
var foo = _usingCtx.u(null);
const bar = 1;
console.log(baz());
} catch (_) {
var _error = _;
var _hasError = true;
_usingCtx.e = _;
} finally{
_dispose(_stack, _error, _hasError);
_usingCtx.d();
}
12 changes: 5 additions & 7 deletions crates/swc/tests/fixture/issues-8xxx/8629/output/1.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { _ as _dispose } from "@swc/helpers/_/_dispose";
import { _ as _using } from "@swc/helpers/_/_using";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
var _Disposable;
try {
var _stack = [];
var _usingCtx = _using_ctx();
var _computedKey;
_computedKey = Symbol.dispose;
class Disposable {
Expand All @@ -11,12 +10,11 @@ try {
}
}
_Disposable = Disposable;
var _disposable = _using(_stack, new Disposable());
var _disposable = _usingCtx.u(new Disposable());
console.log('ok');
} catch (_) {
var _error = _;
var _hasError = true;
_usingCtx.e = _;
} finally{
_dispose(_stack, _error, _hasError);
_usingCtx.d();
}
export { _Disposable as Disposable };
12 changes: 5 additions & 7 deletions crates/swc/tests/fixture/issues-8xxx/8629/output/2.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { _ as _dispose } from "@swc/helpers/_/_dispose";
import { _ as _using } from "@swc/helpers/_/_using";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
var _Disposable;
try {
var _stack = [];
var _usingCtx = _using_ctx();
var Disposable = 1334;
_Disposable = Disposable;
var _disposable = _using(_stack, new Disposable());
var _disposable = _usingCtx.u(new Disposable());
console.log('ok');
} catch (_) {
var _error = _;
var _hasError = true;
_usingCtx.e = _;
} finally{
_dispose(_stack, _error, _hasError);
_usingCtx.d();
}
export { _Disposable as Disposable };
28 changes: 12 additions & 16 deletions crates/swc/tests/fixture/issues-8xxx/8774/output/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { _ as _dispose } from "@swc/helpers/_/_dispose";
import { _ as _using } from "@swc/helpers/_/_using";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
const logClean = function() {
return {
[Symbol.dispose] () {
Expand All @@ -12,42 +11,39 @@ const logClean = function() {
};
async function foo() {
try {
var _stack = [];
var a = _using(_stack, logClean());
var b = _using(_stack, logClean(), true);
var _usingCtx = _using_ctx();
const a = _usingCtx.u(logClean());
const b = _usingCtx.a(logClean());
for (const a of [
logClean(),
logClean()
]){
try {
var _stack1 = [];
var _usingCtx1 = _using_ctx();
{}
} catch (_) {
var _error = _;
var _hasError = true;
_usingCtx1.e = _;
} finally{
_dispose(_stack1, _error, _hasError);
_usingCtx1.d();
}
}
for (const a of [
logClean(),
logClean()
]){
try {
var _stack2 = [];
var _usingCtx2 = _using_ctx();
{}
} catch (_) {
var _error1 = _;
var _hasError1 = true;
_usingCtx2.e = _;
} finally{
_dispose(_stack2, _error1, _hasError1);
_usingCtx2.d();
}
}
} catch (_) {
var _error2 = _;
var _hasError2 = true;
_usingCtx.e = _;
} finally{
await _dispose(_stack, _error2, _hasError2);
await _usingCtx.d();
}
}
foo();
2 changes: 1 addition & 1 deletion crates/swc/tests/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use swc_common::{
BytePos, FileName, Globals, SourceMap, GLOBALS,
};
use swc_compiler_base::PrintArgs;
use swc_ecma_ast::{EsVersion, *};
use swc_ecma_ast::*;
use swc_ecma_minifier::option::MangleOptions;
use swc_ecma_parser::{EsConfig, Syntax, TsConfig};
use swc_ecma_transforms::{
Expand Down
Loading
Loading