Dunqing
ab694b064a
fix(transformer/typescript): retain TSImportEqualsDeclaration in namespace when its binding has been referenced or onlyRemoveTypeImports is true ( #8458 )
...
close : #8384
2025-01-13 05:57:30 +00:00
Dunqing
9a03bd23b9
fix(transformer/typescript): remove type-only import = when only_remove_type_imports is true ( #8275 )
...
close: https://github.com/oxc-project/oxc/issues/8230
close: https://github.com/rolldown/rolldown/issues/3287
Related PR in Babel: https://github.com/oxc-project/oxc/issues/8230
I have compared our output with TypeScript, and it is the same as `TypeScript`, Babel's implementation currently hasn't removed imports referenced by type-only `TSImportEqualsDeclaration`
2025-01-11 08:42:51 +00:00
Boshen
33d776db51
chore(tasks/coverage): ignore fn-name-cover.js in test262 minifier runtime
2025-01-10 10:47:09 +08:00
renovate
772b71c838
chore(deps): update dependency rust to v1.84.0 ( #8391 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.83.0` -> `1.84.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.84.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1840-2025-01-09 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.83.0...1.84.0 )
\==========================
<a id="
Language"></a>
## Language
- [Allow `#[deny]` inside `#[forbid]` as a no-op](https://redirect.github.com/rust-lang/rust/pull/121560/ )
- [Show a warning when `-Ctarget-feature` is used to toggle features that can lead to unsoundness due to ABI mismatches](https://redirect.github.com/rust-lang/rust/pull/129884 )
- [Use the next-generation trait solver in coherence](https://redirect.github.com/rust-lang/rust/pull/130654 )
- [Allow coercions to drop the principal of trait objects](https://redirect.github.com/rust-lang/rust/pull/131857 )
- [Support `/` as the path separator for `include!()` in all cases on Windows](https://redirect.github.com/rust-lang/rust/pull/125205 )
- [Taking a raw ref (`raw (const|mut)`) of a deref of a pointer (`*ptr`) is now safe](https://redirect.github.com/rust-lang/rust/pull/129248 )
- [Stabilize s390x inline assembly](https://redirect.github.com/rust-lang/rust/pull/131258 )
- [Stabilize Arm64EC inline assembly](https://redirect.github.com/rust-lang/rust/pull/131781 )
- [Lint against creating pointers to immediately dropped temporaries](https://redirect.github.com/rust-lang/rust/pull/128985 )
- [Execute drop glue when unwinding in an `extern "C"` function](https://redirect.github.com/rust-lang/rust/pull/129582 )
<a id="1.84.0-Compiler"></a>
## Compiler
- [Add `--print host-tuple` flag to print the host target tuple and affirm the "target tuple" terminology over "target triple"](https://redirect.github.com/rust-lang/rust/pull/125579 )
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://redirect.github.com/rust-lang/rust/pull/129935 )
- [Set up indirect access to external data for `loongarch64-unknown-linux-{musl,ohos}`](https://redirect.github.com/rust-lang/rust/pull/131583 )
- [Enable XRay instrumentation for LoongArch Linux targets](https://redirect.github.com/rust-lang/rust/pull/131818 )
- [Extend the `unexpected_cfgs` lint to also warn in external macros](https://redirect.github.com/rust-lang/rust/pull/132577 )
- [Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features](https://redirect.github.com/rust-lang/rust/pull/131080 )
- [Added Tier 2 support for the `wasm32v1-none` target](https://redirect.github.com/rust-lang/rust/pull/131487 )
<a id="1.84.0-Libraries"></a>
## Libraries
- [Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`](https://redirect.github.com/rust-lang/rust/pull/129329 )
- [Move `<float>::copysign`, `<float>::abs`, `<float>::signum` to `core`](https://redirect.github.com/rust-lang/rust/pull/131304 )
- [Add `LowerExp` and `UpperExp` implementations to `NonZero`](https://redirect.github.com/rust-lang/rust/pull/131377 )
- [Implement `FromStr` for `CString` and `TryFrom<CString>` for `String`](https://redirect.github.com/rust-lang/rust/pull/130608 )
- [`std::os::darwin` has been made public](https://redirect.github.com/rust-lang/rust/pull/123723 )
<a id="1.84.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`Ipv6Addr::is_unique_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unique_local )
- [`Ipv6Addr::is_unicast_link_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unicast_link_local )
- [`core::ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance.html )
- [`core::ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance_mut.html )
- [`<ptr>::addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.addr )
- [`<ptr>::expose_provenance`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.expose_provenance )
- [`<ptr>::with_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.with_addr )
- [`<ptr>::map_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.map_addr )
- [`<int>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.isqrt )
- [`<int>::checked_isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.checked_isqrt )
- [`<uint>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.u32.html#method.isqrt )
- [`NonZero::isqrt`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html#impl-NonZero%3Cu128%3E/method.isqrt )
- [`core::ptr::without_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance.html )
- [`core::ptr::without_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance_mut.html )
- [`core::ptr::dangling`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling.html )
- [`core::ptr::dangling_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling_mut.html )
These APIs are now stable in const contexts
- [`AtomicBool::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.from_ptr )
- [`AtomicPtr::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicPtr.html#method.from_ptr )
- [`AtomicU8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU8.html#method.from_ptr )
- [`AtomicU16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU16.html#method.from_ptr )
- [`AtomicU32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.from_ptr )
- [`AtomicU64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU64.html#method.from_ptr )
- [`AtomicUsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr )
- [`AtomicI8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI8.html#method.from_ptr )
- [`AtomicI16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI16.html#method.from_ptr )
- [`AtomicI32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI32.html#method.from_ptr )
- [`AtomicI64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI64.html#method.from_ptr )
- [`AtomicIsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicIsize.html#method.from_ptr )
- [`<ptr>::is_null`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_null-1 )
- [`<ptr>::as_ref`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_ref-1 )
- [`<ptr>::as_mut`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_mut )
- [`Pin::new`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new )
- [`Pin::new_unchecked`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new_unchecked )
- [`Pin::get_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_ref )
- [`Pin::into_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.into_ref )
- [`Pin::get_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_mut )
- [`Pin::get_unchecked_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_unchecked_mut )
- [`Pin::static_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_ref )
- [`Pin::static_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_mut )
<a id="1.84.0-Cargo"></a>
## Cargo
- [Stabilize MSRV-aware resolver config](https://redirect.github.com/rust-lang/cargo/pull/14639/ )
- [Stabilize resolver v3](https://redirect.github.com/rust-lang/cargo/pull/14754/ )
<a id="1.84-Rustdoc"></a>
## Rustdoc
- [rustdoc-search: improve type-driven search](https://redirect.github.com/rust-lang/rust/pull/127589 )
<a id="1.84.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Enable by default the `LSX` target feature for LoongArch Linux targets](https://redirect.github.com/rust-lang/rust/pull/132140 )
- [The unstable `-Zprofile` flag (“gcov-style” coverage instrumentation) has been removed.](https://redirect.github.com/rust-lang/rust/pull/131829 ) This does not affect the stable flags for coverage instrumentation (`-Cinstrument-coverage`) and profile-guided optimization (`-Cprofile-generate`, `-Cprofile-use`), which are unrelated and remain available.
- Support for the target named `wasm32-wasi` has been removed as the target is now named `wasm32-wasip1`. This completes the [transition](https://redirect.github.com/rust-lang/compiler-team/issues/607 ) [plan](https://redirect.github.com/rust-lang/compiler-team/issues/695 ) for this target following [the introduction of `wasm32-wasip1`](https://redirect.github.com/rust-lang/rust/pull/120468 ) in Rust 1.78. Compiler warnings on [use of `wasm32-wasi`](https://redirect.github.com/rust-lang/rust/pull/126662 ) introduced in Rust 1.81 are now gone as well as the target is removed.
- [The syntax `&pin (mut|const) T` is now parsed as a type which in theory could affect macro expansion results in some edge cases](https://redirect.github.com/rust-lang/rust/pull/130635#issuecomment-2375462821 )
- [Legacy syntax for calling `std::arch` functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks).](https://redirect.github.com/rust-lang/rust/pull/130443#issuecomment-2445678945 )
- The `wasm32-unknown-emscripten` target's binary release of the standard library is now [built with the latest emsdk 3.1.68](https://redirect.github.com/rust-lang/rust/pull/131533 ), which fixes an ABI-incompatibility with Emscripten >= 3.1.42. If you are locally using a version of emsdk with an incompatible ABI (e.g. before 3.1.42 or a future one), you should build your code with `-Zbuild-std` to ensure that `std` uses the correct ABI.
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://redirect.github.com/rust-lang/rust/pull/129935 )
- [The next-generation trait solver is now enabled for coherence, fixing multiple soundness issues](https://redirect.github.com/rust-lang/rust/pull/130654 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "before 11am on monday" in timezone Asia/Shanghai.
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-01-09 18:11:17 +00:00
overlookmotel
0df18667ea
fix(transformer/typescript): create Reference for require ( #8355 )
...
Create a `Reference` when generating new `IdentifierReference` for `require`.
2025-01-09 16:50:46 +00:00
Dunqing
79a8fc6f7d
fix(semantic): report error for super property appearing in function body ( #8376 )
...
Missing error that super property inside plain function.
```js
class C {
constructor() {
function g() {
// * It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
super();
}
}
method() {
function func() {
// It is a Syntax Error if FunctionBody Contains SuperProperty is true.
super.good();
}
}
}
```
I am not sure why test262 doesn't cover tests like that
2025-01-09 06:38:09 +00:00
overlookmotel
f1f129b09d
fix(transformer/private-methods): create brand binding var in hoist scope ( #8361 )
...
Brand binding is a `var`, so is bound in hoist scope.
2025-01-09 03:17:38 +00:00
翠 / green
3ba0b5316d
chore(tasks/coverage): fix test262 cases to run on windows ( #8358 )
...
`skip_test_path` was not working on windows because the path included
`\\`.
2025-01-09 10:48:37 +08:00
overlookmotel
78d7c97357
fix(transformer/typescript): create Reference for Infinity ( #8354 )
...
Create a `Reference` when generating new `IdentifierReference` for `Infinity`.
2025-01-09 02:26:33 +00:00
Dunqing
e4d66e4636
fix(transformer/arrow-functions): store super_methods on a Stack to fix nested async methods ( #8331 )
...
In the following case, async methods can be nested in another async method. The implementation is changing to store `super_methods` on a stack, and then we can store super method information in the correct `super_methods` map.
```js
const outer = {
value: 0,
async method() {
() => super.value;
const inner = {
value: 0,
async method() {
() => super.value;
}
};
() => super.value;
}
};
```
2025-01-08 21:00:45 +00:00
Boshen
ce2b5a994b
chore(minifier): disable RemoveUnusedCode ( #8243 )
...
A lot of edge cases fail in test262 and monitor-oxc.
2025-01-04 08:49:20 +00:00
Boshen
2da4365fbe
feat(parser): missing initializer in destructuring declaration inside for loop head ( #8222 )
...
closes #8220
2025-01-02 14:02:49 +00:00
Boshen
2786dea164
feat(minifier): add RemoveUnusedCode ( #8210 )
2025-01-02 12:50:21 +00:00
Boshen
cd349a312d
chore(tasks/coverage): do not run minifier in script mode ( #8213 )
2025-01-01 14:56:43 +00:00
Dunqing
e5ee38fdf1
chore(transformer): enable class-properties plugin ( #7750 )
...
Done!
2024-12-31 12:30:58 +00:00
branchseer
f88acb331b
fix(parser): allow line breaks between const and enum ( #8193 )
...
https://www.typescriptlang.org/play/?ts=5.7.2#code/MYewdgzgLgUApmArgWwAQEFUG8C+Mg
2024-12-31 08:45:17 +08:00
Boshen
11c4bd8687
feat(span): implement source type {file basename}.d.{extension}.ts ( #8109 )
2024-12-25 12:24:34 +00:00
camc314
708e9cfac0
fix(semantic): report errors for missing class method impls ( #8082 )
2024-12-25 12:24:33 +00:00
camc314
de82492e97
fix(parser): report syntax errors for missing constructor implementations ( #8081 )
2024-12-25 12:24:32 +00:00
injuly
55d6eb9507
fix(parser): disallow type parameters on class constructors ( #8071 )
...
TypeScript does not allow type parameters on constructors:
```ts
class A {
constructor<T>(t: T) {} // <- should be an error
}
```
Here's a comparison snippet on:
1. [TypeScript
playground](https://www.typescriptlang.org/play/?#code/MYGwhgzhAECC0G8BQ1XWAewHYQC4CcBXYXDfAHlgD4AKASkSRTQF8kWg )
(syntax error).
2. [SWC
playground](https://play.swc.rs/?version=1.10.1&code=H4sIAAAAAAAAA0vOSSwuVnBWqOZSUEjOzysuKSpNLskvsgmx09BUqFao5aoFAOf92%2FAiAAAA&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BCIOhERP9mOVBTl7oUE0maH3xszsA5KwcwGnmotxzIkTYx0ziXhHER%2FSgKSE7IhmwRuvRWu1agd4x5tRwOiaUKpW8j3hoOLkbHjLfM22DH%2FC030iZD5ClZUh8nhVTc0Jfj4XvayfaQ%2B9tA%2F4Ad12XkxWH71TaEFh%2B0LYuVI0xQBAAA%3D )
(syntax error)
3. [OXC
playground](https://playground.oxc.rs/#eNo9T8EKwjAM/ZWSk8IOKngpInjxCzx66Wo2Cl0zkk4do/9u6+guyXshL+9lAQsarDci6qaWZ1DKUpDIk43El8d1t1+nSpWaniFBAwR6AZ5CaTKHaL6gswQb8C7EisXSiBuZh5Z8ZZFNkI54AN0ZL5gaGA0Lcr6YcblS8bb6H0A03GO2AJTT4XiGvGHphT2WMJkMLrjOVXH+JTL5u6dPEb+RW5KcaTVN6QerbleM )
(parses as valid syntax)
This PR makes OXC behave exactly like `tsc`, with a little test case.
Happy holidays!
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-24 07:38:39 +08:00
Boshen
e632a7b158
feat(transformer): remove typescript symbols after transform ( #8069 )
...
part of #7460
2024-12-23 08:24:54 +00:00
Boshen
be2c60dd10
fix(parser): parse import source from from 'mod' ( #8056 )
2024-12-21 10:20:14 +00:00
Boshen
8b025e36db
chore(coverage): bump test262 ( #8055 )
2024-12-21 10:20:14 +00:00
camc314
274f117d4e
fix(transformer/nullish-coalescing): use correct scope id for binding ( #8053 )
2024-12-21 07:08:29 +00:00
Dunqing
1cf7b83431
refactor(semantic): simplify handling namespace stack ( #7987 )
...
We had a BindingIdentifier to `TSModuleDeclarationName` so that we don't need to get binding from name.
2024-12-18 07:56:13 +00:00
Boshen
99a431be74
fix(coverage): make coverage runtime timeout stable ( #7953 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-17 12:02:56 +08:00
Dunqing
14c51ffa1d
fix(semantic): remove inherting ScopeFlags::Modifier from parent scope ( #7932 )
...
close : #7900
After #4283 changed, we don't need to inherit `ScopeFlags` from the `constructor`, `set`, `get` anymore, I think this is a logic of forgetting to remove
2024-12-16 11:26:12 +00:00
Dunqing
596aead0e9
fix(semantic): reset references flags when resolved ( #7923 )
...
For this case, we set `current_reference_flags` to `ReferenceFlags::Type` for `TSInterfaceHeritage`, but never unset it, which causes resolving `fowardRef` identifier reuse `current_reference_flags` of `TSInterfaceHeritage`.
```ts
import { forwardRef } from "react";
export interface MenuTriggerProps extends Object {}
export const MenuTrigger = forwardRef();
```
In this PR, reset the `current_reference_flags` when resolved, so that we don't need to reset it in individual visit functions. This is a reasonable change because the `current_reference_flags` only applies to the next encountered identifier.
2024-12-16 02:26:52 +00:00
翠 / green
db9e93b554
feat(mangler): mangle top level variables ( #7907 )
...
Adds `top_level` option which is similar to [terser's `toplevel`
option](https://terser.org/docs/cli-usage/#cli-mangle-options ).
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-15 21:31:41 +08:00
overlookmotel
3858221f45
refactor(global): sort imports ( #7883 )
...
Pure refactor. Re-order imports for clarity:
1. `std`
2. External crates
3. `oxc_*` crates
4. Current crate `use crate::...`
5. Super `use super::...`
6. Local modules
This order is from "furthest away" to "closest". This makes it clearer to see what is coming from where.
`cargo +nightly fmt` (#7877 ) did a lot of the work, but unfortunately `rustfmt` does not have an option to (a) put workspace crates in a separate block from external crates and (b) move `mod` statements to after `use` statements.
2024-12-14 15:07:21 +00:00
Boshen
81eedb10c0
feat(parser): 'readonly' type modifier is only permitted on array and tuple literal types. ( #7880 )
2024-12-14 12:00:52 +00:00
Boshen
7fb9d47460
style(rust): cargo +nightly fmt ( #7877 )
2024-12-14 06:03:31 +00:00
Boshen
7610dc19ff
fix(parser): parse import source from 'mod' ( #7833 )
2024-12-13 10:26:36 +00:00
Yunfei He
9479e2b0a2
fix(semantic): missing references when export {} references a type-only binding and a normal ( #7812 )
...
https://playground.oxc.rs/#eNpdTzEOgzAM/AryzFAqdUHq2rlD1YklUIMihTiyTQGh/L0BBEMn31l35/MCDZTQkBfNXmRE3xbHQKzZPSsqX3mcNrZkOgfcJU+mIPmfPEIOBOUCPPh1yOzVTFAqD5iDs14PLA0FPMnc1+QOpmy8tMT9vog5BMOCnAITXkMOfCq3BajhDtMFQLleihskRUMf7HDtkkhvvW3tYU7vKpN7OBpX8xe5JkmVWuMEY4w/P71iMw==
Current:
<img width="876" alt="image"
src="https://github.com/user-attachments/assets/58327920-44ef-469d-8c7c-a2d7b17da717 "
/>
Expected:
https://babeljs.io/repl#?browsers=&build=&builtIns=false&corejs=false&spec=false&loose=false&code_lz=MYewdgzgLgBAKiAhtAagSwKYHcAOIBOsAvDAIwBQ5UAnjhvEtAAr4g4QwkXkYAeehGAG8YNOg2RQWbCABoJqTLgKwAvkA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Ctypescript&prettier=false&targets=&version=7.26.4&externalPlugins=&assumptions=%7B%7D
<img width="877" alt="image"
src="https://github.com/user-attachments/assets/9b847baa-5b5a-43be-b77d-d529fb3f8026 "
/>
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-12-13 12:00:58 +08:00
Dunqing
7a832307c2
fix(semantic): missing reference when export default references a type alias binding ( #7813 )
...
Fixes : #7809
`ExportNamedDecalration` and `ExportDefaultDeclaration` can reference both type binding and value, so we need to make sure the `ReferenceFlags` is `Read | Type`
2024-12-12 14:12:30 +00:00
overlookmotel
4a3bca8354
fix(semantic): fix identifying strict mode arrow functions ( #7785 )
...
Semantic analysis was not marking an arrow function containing a `"use strict"` directive as `ScopeFlags::StrictMode`. Fix that.
2024-12-10 23:57:42 +00:00
overlookmotel
e010b6a7a0
feat(transformer/logical-assignment-operators): no temp vars for literals ( #7759 )
...
`TransformCtx::duplicate_expression` (introduced in #7754 ) don't create temp vars for literals. This produces more compact output for the logical assignment operators transform.
This diverges from Babel (it's better!) so add an override for one of Babel's fixtures. Also add further tests for all literal types.
2024-12-10 02:28:28 +00:00
Boshen
72eab6cd96
feat(parser)!: stage 3 import source and import defer ( #7706 )
...
* https://github.com/tc39/proposal-defer-import-eval
* https://github.com/tc39/proposal-source-phase-imports
* https://tc39.es/proposal-source-phase-imports/#sec-ecmascript-language-expressions
* https://tc39.es/proposal-defer-import-eval/#prod-NameSpaceImport
2024-12-06 16:15:52 +00:00
Boshen
66a680a119
deps(coverage): bump test262 ( #7695 )
2024-12-06 14:34:01 +08:00
Dunqing
0ca10e270a
refactor(transformer): use ctx.var_declarations.create_var* methods ( #7666 )
...
It turns out these APIs are very useful, we remove many boilerplate code.
2024-12-05 14:31:20 +00:00
Boshen
8c0b0ee2bd
fix(parser): better diagnostic for invalid for await syntax ( #7649 )
2024-12-04 15:18:29 +00:00
Boshen
d2767bea62
feat(semantic): syntax error for delete object?.#a ( #7636 )
...
closes #7603
2024-12-04 05:33:05 +00:00
Boshen
1486849ec2
fix(semantic): syntax error for undeclared private field access ( #7635 )
...
closes #7582
2024-12-04 05:33:04 +00:00
Boshen
348d4f451a
feat(sourcemap): move oxc_sourcemap to github.com/oxc-project/oxc-sourcemap ( #7604 )
...
It's mostly stable so we can v1.0.0 it.
And we will create cyclic dependency with StringWizard soon.
2024-12-03 11:59:43 +00:00
Boshen
18519dea33
refactor(syntax): remove ModuleRecord::export_default ( #7578 )
...
This value can be derived.
2024-12-02 09:17:57 +00:00
Boshen
8a788b8f4b
feat(parser)!: Build ModuleRecord directly in parser ( #7546 )
...
This has the benefit of:
* expose dynamic import / import meta info from parser
* 1 less ast shallow in semantic builder
* no ast walk in oxc's module lexer
* some more benefits coming soon
2024-11-29 14:50:42 +00:00
renovate
d0842e070a
chore(deps): update dependency rust to v1.83.0 ( #7537 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.82.0` -> `1.83.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.83.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1830-2024-11-28 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.82.0...1.83.0 )
\==========================
<a id="1.83.0-Language"></a>
## Language
- [Stabilize `&mut`, `*mut`, `&Cell`, and `*const Cell` in const.](https://redirect.github.com/rust-lang/rust/pull/129195 )
- [Allow creating references to statics in `const` initializers.](https://redirect.github.com/rust-lang/rust/pull/129759 )
- [Implement raw lifetimes and labels (`'r#ident`).](https://redirect.github.com/rust-lang/rust/pull/126452 )
- [Define behavior when atomic and non-atomic reads race.](https://redirect.github.com/rust-lang/rust/pull/128778 )
- [Non-exhaustive structs may now be empty.](https://redirect.github.com/rust-lang/rust/pull/128934 )
- [Disallow implicit coercions from places of type `!`](https://redirect.github.com/rust-lang/rust/pull/129392 )
- [`const extern` functions can now be defined for other calling conventions.](https://redirect.github.com/rust-lang/rust/pull/129753 )
- [Stabilize `expr_2021` macro fragment specifier in all editions.](https://redirect.github.com/rust-lang/rust/pull/129972 )
- [The `non_local_definitions` lint now fires on less code and warns by default.](https://redirect.github.com/rust-lang/rust/pull/127117 )
<a id="1.83.0-Compiler"></a>
## Compiler
- [Deprecate unsound `-Csoft-float` flag.](https://redirect.github.com/rust-lang/rust/pull/129897 )
- Add many new tier 3 targets:
- [`aarch64_unknown_nto_qnx700`](https://redirect.github.com/rust-lang/rust/pull/127897 )
- [`arm64e-apple-tvos`](https://redirect.github.com/rust-lang/rust/pull/130614 )
- [`armv7-rtems-eabihf`](https://redirect.github.com/rust-lang/rust/pull/127021 )
- [`loongarch64-unknown-linux-ohos`](https://redirect.github.com/rust-lang/rust/pull/130750 )
- [`riscv32-wrs-vxworks` and `riscv64-wrs-vxworks`](https://redirect.github.com/rust-lang/rust/pull/130549 )
- [`riscv32{e|em|emc}-unknown-none-elf`](https://redirect.github.com/rust-lang/rust/pull/130555 )
- [`x86_64-unknown-hurd-gnu`](https://redirect.github.com/rust-lang/rust/pull/128345 )
- [`x86_64-unknown-trusty`](https://redirect.github.com/rust-lang/rust/pull/130453 )
Refer to Rust's \[platform support page]\[platform-support-doc]
for more information on Rust's tiered platform support.
<a id="1.83.0-Libraries"></a>
## Libraries
- [Implement `PartialEq` for `ExitCode`.](https://redirect.github.com/rust-lang/rust/pull/127633 )
- [Document that `catch_unwind` can deal with foreign exceptions without UB, although the exact behavior is unspecified.](https://redirect.github.com/rust-lang/rust/pull/128321 )
- [Implement `Default` for `HashMap`/`HashSet` iterators that don't already have it.](https://redirect.github.com/rust-lang/rust/pull/128711 )
- [Bump Unicode to version 16.0.0.](https://redirect.github.com/rust-lang/rust/pull/130183 )
- [Change documentation of `ptr::add`/`sub` to not claim equivalence with `offset`.](https://redirect.github.com/rust-lang/rust/pull/130229 ).
<a id="1.83.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`BufRead::skip_until`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.skip_until )
- [`ControlFlow::break_value`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.break_value )
- [`ControlFlow::continue_value`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.continue_value )
- [`ControlFlow::map_break`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.map_break )
- [`ControlFlow::map_continue`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.map_continue )
- [`DebugList::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugList.html#method.finish_non_exhaustive )
- [`DebugMap::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugMap.html#method.finish_non_exhaustive )
- [`DebugSet::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugSet.html#method.finish_non_exhaustive )
- [`DebugTuple::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugTuple.html#method.finish_non_exhaustive )
- [`ErrorKind::ArgumentListTooLong`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ArgumentListTooLong )
- [`ErrorKind::Deadlock`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.Deadlock )
- [`ErrorKind::DirectoryNotEmpty`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.DirectoryNotEmpty )
- [`ErrorKind::ExecutableFileBusy`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ExecutableFileBusy )
- [`ErrorKind::FileTooLarge`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.FileTooLarge )
- [`ErrorKind::HostUnreachable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.HostUnreachable )
- [`ErrorKind::IsADirectory`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.IsADirectory )
- [`ErrorKind::NetworkDown`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NetworkDown )
- [`ErrorKind::NetworkUnreachable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NetworkUnreachable )
- [`ErrorKind::NotADirectory`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NotADirectory )
- [`ErrorKind::NotSeekable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NotSeekable )
- [`ErrorKind::ReadOnlyFilesystem`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ReadOnlyFilesystem )
- [`ErrorKind::ResourceBusy`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ResourceBusy )
- [`ErrorKind::StaleNetworkFileHandle`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.StaleNetworkFileHandle )
- [`ErrorKind::StorageFull`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.StorageFull )
- [`ErrorKind::TooManyLinks`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.TooManyLinks )
- [`Option::get_or_insert_default`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.get_or_insert_default )
- [`Waker::data`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.data )
- [`Waker::new`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.new )
- [`Waker::vtable`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.vtable )
- [`char::MIN`](https://doc.rust-lang.org/stable/core/primitive.char.html#associatedconstant.MIN )
- [`hash_map::Entry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/hash_map/enum.Entry.html#method.insert_entry )
- [`hash_map::VacantEntry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/hash_map/struct.VacantEntry.html#method.insert_entry )
These APIs are now stable in const contexts:
- [`Cell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.Cell.html#method.into_inner )
- [`Duration::as_secs_f32`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.as_secs_f32 )
- [`Duration::as_secs_f64`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.as_secs_f64 )
- [`Duration::div_duration_f32`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.div_duration_f32 )
- [`Duration::div_duration_f64`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.div_duration_f64 )
- [`MaybeUninit::as_mut_ptr`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.as_mut_ptr )
- [`NonNull::as_mut`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_mut )
- [`NonNull::copy_from`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_from )
- [`NonNull::copy_from_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_from_nonoverlapping )
- [`NonNull::copy_to`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_to )
- [`NonNull::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_to_nonoverlapping )
- [`NonNull::slice_from_raw_parts`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.slice_from_raw_parts )
- [`NonNull::write`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write )
- [`NonNull::write_bytes`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write_bytes )
- [`NonNull::write_unaligned`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write_unaligned )
- [`OnceCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.OnceCell.html#method.into_inner )
- [`Option::as_mut`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_mut )
- [`Option::expect`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.expect )
- [`Option::replace`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.replace )
- [`Option::take`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.take )
- [`Option::unwrap`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.unwrap )
- [`Option::unwrap_unchecked`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.unwrap_unchecked )
- [`Option::<&_>::copied`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.copied )
- [`Option::<&mut _>::copied`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.copied-1 )
- [`Option::<Option<_>>::flatten`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.flatten )
- [`Option::<Result<_, _>>::transpose`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.transpose )
- [`RefCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.RefCell.html#method.into_inner )
- [`Result::as_mut`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.as_mut )
- [`Result::<&_, _>::copied`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.copied )
- [`Result::<&mut _, _>::copied`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.copied-1 )
- [`Result::<Option<_>, _>::transpose`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.transpose )
- [`UnsafeCell::get_mut`](https://doc.rust-lang.org/stable/core/cell/struct.UnsafeCell.html#method.get_mut )
- [`UnsafeCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.UnsafeCell.html#method.into_inner )
- [`array::from_mut`](https://doc.rust-lang.org/stable/core/array/fn.from_mut.html )
- [`char::encode_utf8`](https://doc.rust-lang.org/stable/core/primitive.char.html#method.encode_utf8 )
- [`{float}::classify`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.classify )
- [`{float}::is_finite`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_finite )
- [`{float}::is_infinite`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_infinite )
- [`{float}::is_nan`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_nan )
- [`{float}::is_normal`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_normal )
- [`{float}::is_sign_negative`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_sign_negative )
- [`{float}::is_sign_positive`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_sign_positive )
- [`{float}::is_subnormal`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_subnormal )
- [`{float}::from_bits`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_bits )
- [`{float}::from_be_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_be_bytes )
- [`{float}::from_le_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_le_bytes )
- [`{float}::from_ne_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_ne_bytes )
- [`{float}::to_bits`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_bits )
- [`{float}::to_be_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_be_bytes )
- [`{float}::to_le_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_le_bytes )
- [`{float}::to_ne_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_ne_bytes )
- [`mem::replace`](https://doc.rust-lang.org/stable/core/mem/fn.replace.html )
- [`ptr::replace`](https://doc.rust-lang.org/stable/core/ptr/fn.replace.html )
- [`ptr::slice_from_raw_parts_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.slice_from_raw_parts_mut.html )
- [`ptr::write`](https://doc.rust-lang.org/stable/core/ptr/fn.write.html )
- [`ptr::write_unaligned`](https://doc.rust-lang.org/stable/core/ptr/fn.write_unaligned.html )
- [`<*const _>::copy_to`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to )
- [`<*const _>::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to_nonoverlapping )
- [`<*mut _>::copy_from`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_from )
- [`<*mut _>::copy_from_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_from_nonoverlapping )
- [`<*mut _>::copy_to`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to-1 )
- [`<*mut _>::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to_nonoverlapping-1 )
- [`<*mut _>::write`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write )
- [`<*mut _>::write_bytes`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write_bytes )
- [`<*mut _>::write_unaligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write_unaligned )
- [`slice::from_mut`](https://doc.rust-lang.org/stable/core/slice/fn.from_mut.html )
- [`slice::from_raw_parts_mut`](https://doc.rust-lang.org/stable/core/slice/fn.from_raw_parts_mut.html )
- [`<[_]>::first_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.first_mut )
- [`<[_]>::last_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.last_mut )
- [`<[_]>::first_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.first_chunk_mut )
- [`<[_]>::last_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.last_chunk_mut )
- [`<[_]>::split_at_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut )
- [`<[_]>::split_at_mut_checked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_checked )
- [`<[_]>::split_at_mut_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked )
- [`<[_]>::split_first_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_first_mut )
- [`<[_]>::split_last_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_last_mut )
- [`<[_]>::split_first_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_first_chunk_mut )
- [`<[_]>::split_last_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_last_chunk_mut )
- [`str::as_bytes_mut`](https://doc.rust-lang.org/stable/core/primitive.str.html#method.as_bytes_mut )
- [`str::as_mut_ptr`](https://doc.rust-lang.org/stable/core/primitive.str.html#method.as_mut_ptr )
- [`str::from_utf8_unchecked_mut`](https://doc.rust-lang.org/stable/core/str/fn.from_utf8\_unchecked_mut.html )
<a id="1.83.0-Cargo"></a>
## Cargo
- [Introduced a new `CARGO_MANIFEST_PATH` environment variable, similar to `CARGO_MANIFEST_DIR` but pointing directly to the manifest file.](https://redirect.github.com/rust-lang/cargo/pull/14404/ )
- [Added `package.autolib` to the manifest, allowing `[lib]` auto-discovery to be disabled.](https://redirect.github.com/rust-lang/cargo/pull/14591/ )
- [Declare support level for each crate in Cargo's Charter / crate docs.](https://redirect.github.com/rust-lang/cargo/pull/14600/ )
- [Declare new Intentional Artifacts as 'small' changes.](https://redirect.github.com/rust-lang/cargo/pull/14599/ )
<a id="1.83-Rustdoc"></a>
## Rustdoc
- [The sidebar / hamburger menu table of contents now includes the `# headers` from the main item's doc comment](https://redirect.github.com/rust-lang/rust/pull/120736 ). This is similar to a third-party feature provided by the rustdoc-search-enhancements browser extension.
<a id="1.83.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Warn against function pointers using unsupported ABI strings.](https://redirect.github.com/rust-lang/rust/pull/128784 )
- [Check well-formedness of the source type's signature in fn pointer casts.](https://redirect.github.com/rust-lang/rust/pull/129021 ) This partly closes a soundness hole that comes when casting a function item to function pointer
- [Use equality instead of subtyping when resolving type dependent paths.](https://redirect.github.com/rust-lang/rust/pull/129073 )
- Linking on macOS now correctly includes Rust's default deployment target. Due to a linker bug, you might have to pass `MACOSX_DEPLOYMENT_TARGET` or fix your `#[link]` attributes to point to the correct frameworks. See [#​129369](https://redirect.github.com/rust-lang/rust/pull/129369 ).
- [Rust will now correctly raise an error for `repr(Rust)` written on non-`struct`/`enum`/`union` items, since it previous did not have any effect.](https://redirect.github.com/rust-lang/rust/pull/129422 )
- The future incompatibility lint `deprecated_cfg_attr_crate_type_name` [has been made into a hard error](https://redirect.github.com/rust-lang/rust/pull/129670 ). It was used to deny usage of `#![crate_type]` and `#![crate_name]` attributes in `#![cfg_attr]`, which required a hack in the compiler to be able to change the used crate type and crate name after cfg expansion.
Users can use `--crate-type` instead of `#![cfg_attr(..., crate_type = "...")]` and `--crate-name` instead of `#![cfg_attr(..., crate_name = "...")]` when running `rustc`/`cargo rustc` on the command line.
Use of those two attributes outside of `#![cfg_attr]` continue to be fully supported.
- Until now, paths into the sysroot were always prefixed with `/rustc/$hash` in diagnostics, codegen, backtrace, e.g.
thread 'main' panicked at 'hello world', map-panic.rs:2:50
stack backtrace:
0: std::panicking::begin_panic
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
1: map_panic::main::{{closure}}
at ./map-panic.rs:2:50
2: core::option::Option<T>::map
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29
3: map_panic::main
at ./map-panic.rs:2:30
4: core::ops::function::FnOnce::call_once
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc )
> We want to change this behaviour such that, when `rust-src` source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a `--remap-path-prefix` that causes this local path to be remapped in the usual way.
[#​129687](https://redirect.github.com/rust-lang/rust/pull/129687 ) implements this behaviour, when `rust-src` is present at compile time, `rustc` replaces `/rustc/$hash` with a real path into the local `rust-src` component with best effort.
To sanitize this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo` or not have the `rust-src` component installed.
- The allow-by-default `missing_docs` lint used to disable itself when invoked through `rustc --test`/`cargo test`, resulting in `#[expect(missing_docs)]` emitting false positives due to the expectation being wrongly unfulfilled. This behavior [has now been removed](https://redirect.github.com/rust-lang/rust/pull/130025 ), which allows `#[expect(missing_docs)]` to be fulfilled in all scenarios, but will also report new `missing_docs` diagnostics for publicly reachable `#[cfg(test)]` items, [integration test](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#integration-tests ) crate-level documentation, and publicly reachable items in integration tests.
- [The `armv8r-none-eabihf` target now uses the Armv8-R required set of floating-point features.](https://redirect.github.com/rust-lang/rust/pull/130295 )
- [Fix a soundness bug where rustc wouldn't detect unconstrained higher-ranked lifetimes in a `dyn Trait`'s associated types that occur due to supertraits.](https://redirect.github.com/rust-lang/rust/pull/130367 )
- [Update the minimum external LLVM version to 18.](https://redirect.github.com/rust-lang/rust/pull/130487 )
- [Remove `aarch64-fuchsia` and `x86_64-fuchsia` target aliases in favor of `aarch64-unknown-fuchsia` and `x86_64-unknown-fuchsia` respectively.](https://redirect.github.com/rust-lang/rust/pull/130657 )
- [The ABI-level exception class of a Rust panic is now encoded with native-endian bytes, so it is legible in hex dumps.](https://redirect.github.com/rust-lang/rust/pull/130897 )
- [Visual Studio 2013 is no longer supported for MSVC targets.](https://redirect.github.com/rust-lang/rust/pull/131070 )
- [The sysroot no longer contains the `std` dynamic library in its top-level `lib/` dir.](https://redirect.github.com/rust-lang/rust/pull/131188 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2024-11-29 07:25:36 +00:00
Dunqing
58a125ff88
fix(transformer/async-to-generator): correct the SymbolFlags of function id in module ( #7470 )
2024-11-26 11:59:22 +00:00
Dunqing
37842c166d
fix(transformer/object-rest-spread): generate catch variable binding with correct SymbolFlags ( #7469 )
2024-11-26 11:59:21 +00:00
Boshen
ed6a69e2db
chore(coverage): update runtime.snap
2024-11-25 22:36:05 +08:00