sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: unsafe_op_in_unsafe_fn causes unnecessary unsafe warnings
Labels: A-lints,A-diagnostics,T-compiler,A-suggestion-diagnostics,D-papercut,D-edition,A-edition-2024,L-unsafe_op_in_unsafe_fn,L-false-positive,I-edition-triaged

I tried this code:

```rust
#![warn(unsafe_op_in_unsafe_fn)]
pub unsafe fn f() {
    let _ = std::mem::zeroed::<i16>();
    unsafe {
        let _ = std::mem::zeroed::<i32>();
    }
}
```

This causes a diagnostic suggestion to rewrite it to:

```rust
#![warn(unsafe_op_in_unsafe_fn)]
pub unsafe fn f() { unsafe {
    let _ = std::mem::zeroed::<i16>();
    unsafe {
        let _ = std::mem::zeroed::<i32>();
    }
}}
```

However, this in turn causes more warnings which cannot be auto-fixed:

```
warning: unnecessary `unsafe` block
 --> src/main.rs:4:5
  |
2 | pub unsafe fn f() { unsafe {
  |                     ------ because it's nested under this `unsafe` block
3 |     let _ = std::mem::zeroed::<i16>();
4 |     unsafe {
  |     ^^^^^^ unnecessary `unsafe` block
  |
  = note: `#[warn(unused_unsafe)]` on by default
```

I don't know if it would be possible to change `unused_unsafe` to have a machine-applicable suggestion to remove the `unsafe` keyword. Or maybe `unsafe_op_in_unsafe_fn` could incorporate those suggestions. I think it probably should not remove the brackets, since that would have a semantic change, and I think would be difficult to get right (though could actually help with some of the problems of the tail-drop-order changes).

Priority-wise, this is just an annoyance since the warnings do not inhibit migration. They just need to be cleaned up manually which for a large codebase could be a lot of work.


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.84.0-nightly (59cec72a5 2024-11-08)
binary: rustc
commit-hash: 59cec72a57af178767a7b8e7f624b06cc50f1087
commit-date: 2024-11-08
host: aarch64-apple-darwin
release: 1.84.0-nightly
LLVM version: 19.1.3
```


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"tyrone-wu"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: ollama
Issue: Export Current Session and Saved modelfiles
Labels: feature request

how can we export saved model files?

I want to summarize the model files and streamline the current chat context
Repository: ollama
Issue: `/save` overwrites everything including system and template and previous messages
Labels: bug

### What is the issue?

the `/save` command overwrites everything and only includes the current context, any previously saved data is lost including the system and template

to recreate
```shell
ollama create model -f customtemplate.modelfile
ollama run model

>>> /set system you are an assistant

>>> how are you?

>>> /save 02

>>> what's the time?

>>> /save 02
>>> /load 02
>>> /show template
>>> /show system

>>> what questions have i asked you so far?

You've asked me three questions so far:

1. How are you?
2. What's the time?

>>> /bye

ollama run 02
/show modelfile

>>> what questions have i asked you so far?
You've asked me one question so far:

1. What questions have I asked you so far?
```

### OS

macOS

### GPU

AMD

### CPU

Intel

### Ollama version

0.4.0
Repository: node
Issue: Unexpected behavior in module customization hooks / loader, for `require`
Labels: loaders

It seems I am one of the early adopters of module hooks.
I liked the idea of the module customization hooks, and tried to use it in my project.
However, I believe the current behavior of `require` handling in the esm loader is buggy.

Relevant [source code, here](https://github.com/nodejs/node/blob/69f8794cbea5813ff9abb490c2cd875b8332f605/lib/internal/modules/esm/translators.js#L130-L159)
https://github.com/nodejs/node/blob/69f8794cbea5813ff9abb490c2cd875b8332f605/lib/internal/modules/esm/translators.js#L130-L159

The resolving of the `specifier` is done in the main thread, using `Module._resolveFilename`, before being sent to the customization hooks.
The resolver hook is then receiving a resolved `file://` URL, instead of the real `specifier`.

These are not expected according to the documentation of the module customization hooks.
And for my use case, it has made the hooks useless.

To make it clear there are two bugs:

1. The cjs specifiers are being resolved in the wrong thread.   
   The hooks, therefore, cannot really work, because if the "expected" file does not really exist on the hard drive. The cjs `Module._resolveFilename` will throw an error in the first place.
2. The resolve hook is receiving a wrong `specifier`, if the first bug would not trigger.


The root of this issue might be the default resolver in customization hooks does not support resolving CJS modules.
An easy fix would be to move the `Module._resolveFilename` into the default resolver.
The loading of `.node` native add-ons may also get in the way. 
But IMO it should also go through the hooks, and eventually be loaded as `{type: 'commonjs', source: undefined, url: 'file://... .node'}`
Repository: react
Issue: [Compiler Bug]: Getting false eslint error from compiler
Labels: Type: Bug,Status: Unconfirmed,Component: Optimizing Compiler

### What kind of issue is this?

- [ ] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
- [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin)
- [X] eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script)

### Link to repro

Not Applicable. 

### Repro steps

import { useEffect, useRef } from 'react'

const usePrevious = <T>(value: T): T => {
  // The ref object is a generic container whose current property is mutable ...
  // ... and can hold any value, similar to an instance property on a class
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const ref: any = useRef<T>()
  // Store current value in ref
  useEffect(() => {
    ref.current = value
  }, [value]) // Only re-run if value changes
  // Return previous value (happens before update in useEffect above)
  return ref.current
}

export default usePrevious

**Getting false eslint error, above is a custom hook to store previous state value.** 

Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)eslint(react-compiler/react-compiler)




### How often does this bug happen?

Every time

### What version of React are you using?

18

### What version of React Compiler are you using?

19.0.0-beta-63b359f-20241101
Repository: ui
Issue: [bug]: sidebar inconsistency
Labels: bug

### Describe the bug

on clear installation sidebar-09 looks different than on docs and v0.

![image](https://github.com/user-attachments/assets/7dac2e06-291e-431b-8a5b-24cb3adac5e1)


### Affected component/components

sidebar

### How to reproduce

1. create a nextjs project
2. add shadcn sidebar-09
3. go to /dashboard

### Codesandbox/StackBlitz link

https://stackblitz.com/edit/stackblitz-starters-17qxnh?file=package.json

### Logs

_No response_

### System Info

```bash
macos, browser: arc
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: rust
Issue: rust_2024_prelude_collisions fails with glob of underscore import
Labels: A-lints,A-resolve,T-lang,T-compiler,C-bug,A-suggestion-diagnostics,D-invalid-suggestion,D-edition,S-has-mcve,A-edition-2024,I-edition-triaged

I tried this code:

```rust
#![warn(rust_2024_prelude_collisions)]

pub mod prelude {
    pub use crate::inner::FExt as _;
}

pub mod inner {
    pub trait FExt {
        fn into_future(self) -> StreamFuture
        where
            Self: Sized,
        {
            StreamFuture
        }
    }

    pub struct StreamFuture;

    pub struct F;
    impl FExt for F {}
}

use crate::prelude::*;

pub fn f() {
    let _ = crate::inner::F.into_future();
}
```

This generates a suggestion to modify the code like this:

```diff
@@ -23,5 +23,5 @@
 use crate::prelude::*;
 
 pub fn f() {
-    let _ = crate::inner::F.into_future();
+    let _ = FExt::into_future(crate::inner::F);
 }
```

However, this fails to compile with the following error:

```
error[E0433]: failed to resolve: use of undeclared type `FExt`
  --> src/lib.rs:26:13
   |
26 |     let _ = FExt::into_future(crate::inner::F);
   |             ^^^^ use of undeclared type `FExt`
   |
help: consider importing one of these traits
   |
23 + use crate::inner::FExt;
   |
23 + use f::FExt;
   |

warning: unused import: `crate::prelude::*`
  --> src/lib.rs:23:5
   |
23 | use crate::prelude::*;
   |     ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0433`.
```

Because the `_` import does not give the trait a name.

This comes up in real-life with importing `use futures::prelude::*`.

I'm not sure what the best solution to this would be. Perhaps it could detect a similar scenario, and fully qualify the path to the trait (like `futures::StreamExt::into_future`). Or just always fully qualify it?

### Meta

`rustc --version --verbose`:
```
rustc 1.84.0-nightly (59cec72a5 2024-11-08)
binary: rustc
commit-hash: 59cec72a57af178767a7b8e7f624b06cc50f1087
commit-date: 2024-11-08
host: aarch64-apple-darwin
release: 1.84.0-nightly
LLVM version: 19.1.3
```
Repository: vscode
Issue: Git diff does not work over a Samba share
Labels: bug,git


Type: <b>Bug</b>

I am accessing a network drive on a Linux server, shared using Samba, using the standard GNOME GVfs client. If I navigate to the file share on the terminal (`/run/user/####/gvfs/smb-share:..../`) and run `git diff`, the expected differences are displayed. However, in VS Code, it displays every file as if it is brand new; even worse, staged files won't show anything at all.

VS Code version: Code 1.95.2 (e8653663e8840adaf45af01eab5c627a5af81807, 2024-11-07T11:07:22.054Z)
OS version: Linux x64 5.4.0-200-generic snap
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 7 2700X Eight-Core Processor (16 x 2063)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: disabled_software<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off<br>webnn: disabled_off|
|Load (avg)|0, 0, 1|
|Memory (System)|15.61GB (11.27GB free)|
|Process Argv|--no-sandbox --force-user-env --crash-reporter-id d79ac254-0e9d-427a-a9ba-5adfd6c2b60d|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|ubuntu|
|XDG_CURRENT_DESKTOP|Unity|
|XDG_SESSION_DESKTOP|ubuntu|
|XDG_SESSION_TYPE|x11|
</details><details><summary>Extensions (20)</summary>

Extension|Author (truncated)|Version
---|---|---
language-hugo-vscode|bud|1.3.1
githistory|don|0.6.20
xml|Dot|2.5.1
codespaces|Git|1.17.3
gc-excelviewer|Gra|4.2.62
csdevkit|ms-|1.11.14
csharp|ms-|2.50.27
vscode-dotnet-runtime|ms-|2.2.2
vscodeintellicode-csharp|ms-|2.1.11
debugpy|ms-|2024.12.0
isort|ms-|2023.10.1
python|ms-|2024.18.1
vscode-pylance|ms-|2024.11.1
hexeditor|ms-|1.11.1
wasm-wasi-core|ms-|1.0.2
vscode-yaml|red|1.15.0
ruby-lsp|Sho|0.8.13
shopify-liquid|sis|4.0.1
code-spell-checker|str|3.0.1
vscode-icons|vsc|12.9.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
0ee40948:31013168
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013

```

</details>

<!-- generated by issue reporter -->
Repository: godot
Issue: [4.4 dev 4] WebsocketPeer regression: connections from HTML5 stay "connecting"
Labels: bug,platform:web,needs testing,topic:network

### Tested versions

- Reproducible in 4.4.dev4+

### System information

Linux Mint 22. Firefox and Google Chromium

### Issue description

HTML5/WebsocketPeer regression:
- **Error happens when connecting to a port different to port 80**
- WebsocketPeer does not connect to local golang Websocket server from **4.4-dev4 HTML5 export** build
- After the call to connect_to_url the socket get_ready_state() can only be **connecting**, when calling close() get_ready_state() stays returning **closing** permanently
- The test works correctly from editor in 4.4-dev4
- The test works correctly in 4.4-dev3 HTML5 export

### Steps to reproduce

- Setup enviroment to execute HTML5 build with 'Access-Control-Allow-Origin', '*' header
- Execute de MRP and compare the outputs from editor and HTML5

# Console Output from HTML5 4.4-dev3 or Editor 4.4-dev4 ===
	#WebsocketPeer regression TEST_1
	#NEW_SOCKET_STATE: Connecting
	#NEW_SOCKET_STATE: Connected
	#NEW_SOCKET_STATE: Clossing
	#NEW_SOCKET_STATE: Closed
	#WebsocketPeer regression TEST_2
	#NEW_SOCKET_STATE: Connecting
	#NEW_SOCKET_STATE: Connected
	#NEW_SOCKET_STATE: Closed
	#WebsocketPeer regression TEST_END



# Console Output from HTML5 4.4dev4
	#WebsocketPeer regression TEST_1
	#NEW_SOCKET_STATE: Connecting
	#NEW_SOCKET_STATE: Clossing
	#WebsocketPeer regression TEST_2
	#NEW_SOCKET_STATE: Connecting
	#NEW_SOCKET_STATE: Clossing
	#WebsocketPeer regression TEST_END


### Minimal reproduction project (MRP)

[websocketpeerdev4bug.zip](https://github.com/user-attachments/files/17692221/websocketpeerdev4bug.zip)
Repository: deno
Issue: deno bench does not support --inspect-brk 
Labels: suggestion,needs discussion

Version: Deno 2.0.6

I wrote a benchmark for my code, and wanted to debug it. And also point the browser's performance profiler at it.
So I tried `deno bench --inspect-brk`. This however, does not work.

```
PM> deno bench --inspect-brk
error: unexpected argument '--inspect-brk' found

  tip: to pass '--inspect-brk' as a value, use '-- --inspect-brk'

Usage: deno bench [OPTIONS] [files]... [-- [SCRIPT_ARG]...]
```
Repository: rust
Issue: Support calling functions with SIMD vectors that couldn't be used in the caller
Labels: A-LLVM,C-feature-request,A-SIMD,WG-llvm,A-ABI,T-opsem

We now lint and will eventually error on this program:
```rust
use std::mem::transmute;
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;

#[target_feature(enable = "avx")]
#[allow(improper_ctypes_definitions)]
unsafe extern "C" fn with_target_feature(x: __m256) {
    let val = unsafe { transmute::<_, [u32; 8]>(x) };
    dbg!(val);
}

fn main() {
    assert!(is_x86_feature_detected!("avx"));
    // SAFETY: we checked that the `avx` feature is present.
    unsafe {
        with_target_feature(transmute([1; 8])); //~ ERROR: missing `avx` target feature
    }
}
```
```
warning: ABI error: this function call uses a vector type that requires the `avx` target feature, which is not enabled in the caller
  --> test.rs:18:9
   |
18 |         with_target_feature(transmute([1; 8]));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function called here
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
   = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)
   = note: `#[warn(abi_unsupported_vector_types)]` on by default
```

The lint is necessary because the way we codegen this function would be unsound (and indeed, if you run this on the [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=78a91a7266b7e39fe539c1e8d8c9892d) you can see that the argument value gets corrupted). See https://github.com/rust-lang/rust/issues/116558 for more context.

However, there's no fundamental reason that we couldn't compile this code! We "just" need to generate the call to `with_target_feature` using its proper ABI, i.e., using the AVX registers. This is sound because the function anyway requires that target feature, so the caller must have already ensured that this target feature is available.

The problem is that LLVM currently simply has no way to express such a call. So we have three options:
- error (the easiest one, and what we are currently working towards)
- fix this in LLVM (also see https://github.com/llvm/llvm-project/issues/70563) -- I am told this is quite hard
- generate a shim that uses the Rust ABI (so it is not affected by these ABI shenanigans), and has the `avx` feature gate, and calls the actual callee -- not a pretty solution since the extra function call is bad for performance, and performance is the reason people manually write SIMD code to begin with

Lucky enough, this only affects non-Rust ABIs, so users should only rarely run into this.

Cc @rust-lang/wg-llvm @rust-lang/opsem @chorman0773 @veluca93
Repository: godot
Issue: Websockets disconnect when idle on web builds
Labels: discussion,topic:network

### Tested versions

4.4.dev4
4.3

### System information

Windows 11, SteamOS

### Issue description

Using Websockets causes the connection to be closed after a while (feels like roughly half a minute) if no data is being sent.
This applies to both regular Websockets and the multiplayer functionality.

### Steps to reproduce

- Establish a Websocket connection
- Do not send any data for some time

### Minimal reproduction project (MRP)

any project with Websocket functionality on html5
Repository: ollama
Issue: Ollama ps to report actual number of layers instead of percentage.
Labels: feature request

Can we have Ollama to report how many layers out of total layers are offloaded to cpu instead of percentage?
I think This would be more useful information than just percentage when setting num_gpu parameter. Also you can see how many layers a model has.
Thanks!
Repository: next.js
Issue: Type error: Namespace 'React' has no exported member 'PromiseLikeOfReactNode'.
Labels: bug

### Link to the code that reproduces this issue

https://github.com/cryfs/cryfs-web-next/tree/feature/failing

### To Reproduce

1. Clone repository from above link, in the specified branch
2. Run "npm run build" (which will run next build)

### Current vs. Expected behavior

With next.js 13.5.4, everything works fine. But when upgrading to next.js 13.5.5, ([this commit](https://github.com/cryfs/cryfs-web-next/commit/55785a15b962f9acae70a3502e8d226943b65897)), it breaks and shows:

```
./node_modules/next/dist/client/components/error-boundary.d.ts:26:71
Type error: Namespace 'React' has no exported member 'PromiseLikeOfReactNode'.

  24 |     static getDerivedStateFromProps(props: ErrorBoundaryHandlerProps, state: ErrorBoundaryHandlerState): ErrorBoundaryHandlerState | null;
  25 |     reset: () => void;
> 26 |     render(): string | number | boolean | React.ReactFragment | React.PromiseLikeOfReactNode | React.JSX.Element | null | undefined;
     |                                                                       ^
  27 | }
  28 | export declare function GlobalError({ error }: {
  29 |     error: any;

```

The update of the next.js version is the only change in that commit, so this seems to be a breaking change in a minor version.

How can I fix this? Ideally without upgrading next.js since we're not ready to go to Next.js 14 yet. The latest minor version on next.js 13 (13.5.7) still has the issue.

### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024
Binaries:
  Node: 18.19.1
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 13.5.5
  eslint-config-next: 13.5.5
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.0.4
Next.js Config:
  output: export
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Which stage(s) are affected? (Select all that apply)

next build (local)

### Additional context

works in 13.5.5-canary.2
broken in 13.5.5-canary.3
Repository: godot
Issue: GDScript Editor setting "Highlight Type Safe Lines" not working as intended
Labels: enhancement,discussion,topic:gdscript

### Tested versions

Reproducible in 4.3.stable

### System information

Linux Ubuntu (KDE plasma)

### Issue description

The setting "highlight type safe code" does not work as intended. When turning on the setting (which it is by default) and changing theme colors ("Line Number Color" green and "Safe Line Number Color" blue) to be better visible, this is the result of my example code.
![image](https://github.com/user-attachments/assets/90d86c69-c6fd-4199-8dfd-49922c232985)
This behaviour seems inconsistent. 
Expected behaviour:
Additionally green highlighting in line 9, 10, 14

I was trying to find the original issue/pull request adding this setting feature to find the intended documented behaviour so I am not sure if I might be misunderstanding this bug report, in that case I will close the issue again.

### Steps to reproduce

1. Go to 'Editor > Editor Settings > Text Editor > Appearance > Gutters > Highlight Type Safe Lines' and enable it. 
2. Go to 'Editor > Editor Settings > Text Editor > Theme > Highlighting > Line Number Color' and 'Editor > Editor Settings > Text Editor > Theme > Highlighting > Line Number Color' and change colors to something more vibrant.
3. Create following script:
```gdscript
func hello():
	var basecase: int = 42
	basecase = 3
	
	var unsafe = 12
	unsafe = 4
	unsafe = "lol"
	
	
	var veryunsafe = 24
	veryunsafe = "hi"
	veryunsafe = 4
```

### Minimal reproduction project (MRP)

[bug-report-type-safe-line-highlighting.zip](https://github.com/user-attachments/files/17692831/bug-report-type-safe-line-highlighting.zip)
Repository: godot
Issue: Editor documentation is not updating
Labels: bug,topic:editor,documentation

### Tested versions
master

### System information

win10 21H2,Vulkan API 1.2.0

### Issue description

![image](https://github.com/user-attachments/assets/2f6a9301-cd02-42ac-b8cc-2beed4d972d5)
![image](https://github.com/user-attachments/assets/ce0fa621-726d-4f84-9366-8d82bcbecf64)
comment out: **//Engine::get_singleton()->add_singleton(Engine::Singleton("WorkerThreadPool", worker_thread_pool));**
start editor, in docs ZdSpace singleton still existed.
Trying to comment out other singleton is the same.

but, I del dir "editor_data/cache" and restart editor, document will be updated.

### Steps to reproduce

look at up

### Minimal reproduction project (MRP)

use commit 1d3c4e192c
Repository: ui
Issue: [feat]: Schedule Component
Labels: area: request

### Feature description

It is a component that displays events based on their time and day and places them in the correct place in the table. This explanation is clearer in the attached video below.

https://github.com/user-attachments/assets/533af091-25de-4940-b45b-e2099f35d6c3





### Affected component/components

_No response_

### Additional Context
N/A


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues and PRs