sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: "Implementation not general enough" with async and projection, fixed by wrapping with `async move`
Labels: T-compiler,A-coroutines,A-async-await,AsyncAwait-Triaged,T-types

Another instance of #110338 (pretty similar to #71723 I guess). Code sample:

```rust
pub fn serve() -> impl Future<Output = ()> + Send {
    async move {
        let netstack = Foo;
        let stream = futures::stream::iter(vec![]);
        let work_items_fut =
            // async move {
                stream.for_each(|()| async {
                    let _ns = netstack.clone();
                })
            // .await }
        ;

        let mut _fut0 = MaybeDone::Future(work_items_fut);
        let mut _fut0 = unsafe { core::pin::Pin::new_unchecked(&mut _fut0) };
        _fut0.await
    }
}
```

[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=55ee1f96d69ef810ab8433d1b57490ef)

```
error: implementation of `std::marker::Send` is not general enough
  --> src/lib.rs:24:5
   |
24 | /     async move {
25 | |         let netstack = Foo;
26 | |         let stream = futures::stream::iter(vec![]);
27 | |         let work_items_fut =
...  |
38 | |         _fut0.await
39 | |     }
   | |_____^ implementation of `std::marker::Send` is not general enough
   |
   = note: `std::marker::Send` would have to be implemented for the type `&'0 Foo`, for any lifetime `'0`...
   = note: ...but `std::marker::Send` is actually implemented for the type `&'1 Foo`, for some specific lifetime `'1`

error[[E0308]](https://doc.rust-lang.org/stable/error_codes/E0308.html): mismatched types
  --> src/lib.rs:24:5
   |
24 | /     async move {
25 | |         let netstack = Foo;
26 | |         let stream = futures::stream::iter(vec![]);
27 | |         let work_items_fut =
...  |
38 | |         _fut0.await
39 | |     }
   | |_____^ one type is more general than the other
   |
   = note: expected `async` block `[async block@src/lib.rs:29:38: 31:18]`
              found `async` block `[async block@src/lib.rs:29:38: 31:18]`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to 2 previous errors
```

What's interesting about this one to me is that uncommenting the commented lines (wrapping in an `async move`) removes the error.

The projection type being in `MaybeDone` is load-bearing, so I suspect something like #92449 would have fixed this.
Repository: next.js
Issue: [NEXT-1140] Build output showing 0B inside parenthesis folder routes
Labels: linear: next

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64
    Binaries:
      Node: 18.14.2
      npm: 9.5.0
      Yarn: N/A
      pnpm: 8.0.0
    Relevant packages:
      next: 13.3.1-canary.7
      eslint-config-next: 13.3.0
      react: 18.2.0
      react-dom: 18.2.0
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

### Link to the code that reproduces this issue

https://codesandbox.io/p/sandbox/festive-grass-tuwupb?file=%2FREADME.md

### To Reproduce

1. Start with a new experimental app dir
2. Create a new folder in app dir with parenthesis, say `(test)`. 
3. Add basic `layout` and `page` file in that with some additional css
4. Do the step 3 for one more param say `test-2` and put another (or same) set of `layout` and `page` file in this dir.
5. Run `npm run build`. You will see output like this:
<img width="473" alt="Screenshot 2023-04-15 at 4 23 36 AM" src="https://user-images.githubusercontent.com/13780952/232167555-770b68ef-68f0-4608-b411-4cba73e129a8.png">


### Describe the Bug

Build output showing 0 bytes inside parenthesis folder (eg: `(foobar)`).

### Expected Behavior

It shouldn't show 0 bytes.

### Which browser are you using? (if relevant)

Chrome 112

### How are you deploying your application? (if relevant)

Other

<sub>[NEXT-1140](https://linear.app/vercel/issue/NEXT-1140/build-output-showing-0b-inside-parenthesis-folder-routes)</sub>
Repository: PowerToys
Issue: fancy zonesのショートカット
Labels: Needs-Triage

### Description of the new feature / enhancement

Fancy zonesのショートカット
［Ctrl］＋［Windows］＋［Alt］＋数字キー
が使用できなくなった。

仕様変更か不具合化は分からないが、再度実装または修正を希望します。

### Scenario when this would be used?

即座に使えるウィンドウレイアウトの設定が1つしか使えない。

windows標準機能の［Windows］＋ 矢印キー
を使った方が圧倒的に使いやすい。

### Supporting information

_No response_
Repository: opencv
Issue: cv2.error: Unknown C++ exception from cv2.legacy.MultiTracker.add
Labels: category: legacy,incomplete

Context: https://forum.opencv.org/t/cv2-error-unknown-c-exception-from-opencv-code/12816
Repository: storybook
Issue: [Bug]: builtin event handler types are not supported well
Labels: bug,addon: controls

### Describe the bug

to reproduce:
1. create a new project (I used `yarn create vite test-storybook --template react-ts`)
2. cd into it and init storybook (`npx storybook@latest init` - unfortunately, `yarn dlx storybook@latest init` [doesn't work](https://github.com/storybookjs/storybook/issues/22103))
3. go into the default `Button` component and change `onClick` from `() => void` to `React.MouseEventHandler`
4. run storybook (`yarn storybook`)

in the docs for Button, you'll notice that onClick has a raw value of
```onClick : {
_isMockFunction : true
getMockImplementation : () => this._ensureMockConfig(f).mockImpl
mock : {...} 5 keys
mockClear : () => { this._mockState.delete(f); return f; }
mockReset : () => { f.mockClear(); this._mockConfigRegistry.delete(f); return f; }
mockRestore : () => { f.mockReset(); return restore ? restore() : void 0; }
mockReturnValueOnce : (value) => f.mockImplementationOnce(() => value)
...
```

In the Primary story, you'll notice that the value of `onClick` is `onClick : {}`

Changing the type of `onClick` back to the default `() => void` fixes the problem (`onClick` is documented both in the docs and in the stories as `-`)

### To Reproduce

I created a test repo: https://github.com/herzaso/test-storybook

### System

```shell
Environment Info:

  System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    Yarn: 3.3.1 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 112.0.5615.49
    Safari: 16.0
```


### Additional context

_No response_
Repository: pytorch
Issue: Libtorch consumes too much memory as 16225
Labels: module: cpp,module: memory usage,triaged

### 🐛 Describe the bug

I met the same problem as https://github.com/pytorch/pytorch/issues/16255 when I was using latest libtorch . I convert resnet152 in torchvision to torchscript model. The following is my code:

#include <torch/torch.h>
#include <torch/script.h>

#include <nvToolsExt.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include <vector>
#include <chrono>
#include <pthread.h>

void run_inference(torch::jit::script::Module& model, std::vector<torch::jit::IValue>& imgs)
{
	for (int i = 0; i < 100; ++i)
		model.forward(imgs);

	torch::cuda::synchronize();

}

int main(int arc, char** argv) {
	
	c10::InferenceMode guard(true);
	torch::Device device(torch::kCUDA);
	torch::Tensor img = torch::rand({4, 3, 224, 224}).to(device);
	std::vector<torch::jit::IValue> inputs;
	inputs.push_back(img);
	std::string model_path = argv[1];

	// torch::jit::script::Module model = torch::jit::load(model_path);
	auto model = torch::jit::load(model_path);
	model.to(device);
	if(torch::cuda::is_available()) {
		std::cout << "CUDA now is available ! Inference on GPU." << std::endl;
	}
	
	// warm up
	run_inference(model, inputs);
	
	nvtxRangePushA("MEASURE");
	auto start = std::chrono::high_resolution_clock::now();
	run_inference(model, inputs);
	auto stop = std::chrono::high_resolution_clock::now();
	nvtxRangePop();
	auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start);

	std::cout << "Running time : " << duration.count() << " ms" << std::endl;
	
}


pytorch memory: 740MB

libtorch memory： 2000MB
I was confused...

### Versions

libtorch build-version: 2.0.0+cu118
hardware: RTX 4090Ti

cc @jbschlosser
Repository: PowerToys
Issue: Switching Desktops/Workspaces with Mouse Buttons
Labels: Needs-Triage

### Description of the new feature / enhancement

Mouse side buttons to switch between Desktops.

![image](https://user-images.githubusercontent.com/23485114/232196356-075ce0e9-b4af-4ccd-9c0a-18977c89c0ad.png)


### Scenario when this would be used?

Now I have to use AutoHotKey:

```ahk
XButton1::Send ^#{Left}
XButton2::Send ^#{Right}
```

[Switch.zip](https://github.com/microsoft/PowerToys/files/11238724/Switch.zip)


### Supporting information

_No response_
Repository: PowerToys
Issue: Add a name to the setting for remapping a shortcut key.
Labels: Needs-Triage

### Description of the new feature / enhancement

Add a name to the setting for remapping a shortcut key.
Just like circled in the picture.
![github](https://user-images.githubusercontent.com/115683118/232202630-3605683a-1338-4822-9f75-1d38d9196158.png)


### Scenario when this would be used?

Let me know the purpose of remapping shortcut keys.
Let me know why I remap shortcuts.

### Supporting information

_No response_
Repository: next.js
Issue: GitHub Pages <Link href="/"> goes to  to <user-name>.github.io/<repo-name>.txt 
Labels: examples

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
    Binaries:
      Node: 18.15.0
      npm: 9.5.0
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 13.3.1-canary.7
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
```


### Which example does this report relate to?

github-pages

### What browser are you using? (if relevant)

I tested it in Chrome, Edge and Brave

### How are you deploying your application? (if relevant)

to GitHub Pages with npm run deploy

### Describe the Bug

I can't get back home 😟

The <Link href="/"> on the About page leads to <user-name>.github.io/<repo-name>.txt (see image below).

![image](https://user-images.githubusercontent.com/50735562/232203058-4a5170f8-aa2e-41a9-965e-7b11418480b5.png)

When hovering over that link, the url displayed in the bottom left hand corner does seem correct (see image below).

![image](https://user-images.githubusercontent.com/50735562/232203029-8f9a4676-6dd7-4917-a712-48895a539e05.png)

### Expected Behavior

Bring me back home when I click the home link

### To Reproduce

Deploy the github-pages example
Repository: rust
Issue: "&mut v[v[0]..]" doesn't compile
Labels: A-lifetimes,A-borrow-checker,T-compiler,A-NLL,C-bug,NLL-polonius

Consider this code:
```rust
fn main() {
    let mut v = vec![1, 2];
    let x = &mut v[v[0]..];
}
```

It doesn't compile ( https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b69d691f31f8c8ef9e7ca949c4be542b, rustc 1.68.2).

Of course, this example can be simply fixed by extracting `v[0]`. But I still argue that this is correct code, and it should compile. Even if this is not possible to fix in short time, I still think this should be fixed in some next-generation borrow checker.

I actually got similar code in my actual production code base. This is simplified example from my production code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e56a648d80a8af7c3eabdcfe504df774

Adding `-Zpolonius` changes nothing
Repository: godot
Issue: Bone2D nodes are rendered wrongly when parent node is scaled
Labels: enhancement,topic:editor,documentation,topic:animation,topic:2d

### Godot version

v4.0.2.stable.official [7a0977ce2]

### System information

Linux amd64, nvidia GTX 1080 TI driver Version: 525.105.17

### Issue description

Greetings, I am facing what I think is an issue with the in-editor display of `Bone2D`. When I have the following scene tree for say a character:

```
Node2D
    Skeleton2D
        Bone2D
            ...
```

![2023-04-15-133606_1911x1556_scrot](https://user-images.githubusercontent.com/60892584/232214911-6e5bdf17-e4f9-41ff-8da3-358d22bc4289.png)

Then, when I scale the top Node2D down, the in-editor rendered bones scale correctly. 
![2023-04-15-133654_1911x1556_scrot](https://user-images.githubusercontent.com/60892584/232215064-a46c0ecc-ce24-4e22-873c-3a2595c78966.png)


However, as soon as I hit ctrl+s to save, the bones are rendered big and chunky instead.
![2023-04-15-133711_1911x1556_scrot](https://user-images.githubusercontent.com/60892584/232214985-daa037ad-5d67-43db-a533-6b81aeb5095d.png)


### Steps to reproduce

1. Create new project
2. Make a Node2D scene
3. Add a Node2D, this is the character root
4. Add a Skeleton2D to the character root from step 3
5. Add a number of Bone2D nodes to make a visible skeleton
6. Scale the character root down (to e.g 0.2)
7. Observe the in-editor rendered bones to scale nicely
8. Save the project with ctrl+s
9. Observe the bones being rendered way thicker.

### Minimal reproduction project

[bone2d_render_bug.zip](https://github.com/godotengine/godot/files/11239291/bone2d_render_bug.zip)
Repository: PowerToys
Issue: Shortcut menu interactable
Labels: Needs-Triage

### Description of the new feature / enhancement

When opened the shortcut menu, the hint and actions should be clickable, which we will waste no time on finding the certian key
For example powertoys will open "settings" when "[ i ] open settings" is clicked

### Scenario when this would be used?

For users who are not familiar with their keyboards. Open the shortcut hint takes time, finding the key takes double

### Supporting information

_No response_
Repository: godot
Issue: Crypto.sign() fails with a cryptic error if they CryptoKey is shorter than 512 bits
Labels: bug,topic:core

### Godot version

4.0.2 official

### System information

Arch Linux btw

### Issue description

Using an RSA key of length smaller than 512 bits makes the `Crypto.sign()` method fail with a generic error that doesn't help figuring out what the problem is:

```
E 0:00:03:0361   LiblastPackage.gd:453 @ save_to_file(): Error while signing: -16512
  <C++ Error>    Condition "ret" is true. Returning: out
  <C++ Source>   modules/mbedtls/crypto_mbedtls.cpp:411 @ sign()
  <Stack Trace>  LiblastPackage.gd:453 @ save_to_file()
                 PackageTest.gd:63 @ _on_button_pressed()
```

I think it'd make sense to do one of two things:
1. Make `Crypto.generate_rsa()` would throw an error like "an RSA key can't be shorter than 512 bits" when generating it (if that's the case)
2. Make `Crypto.sign()` say  "Signing failed. The RSA key must be at least 512 bits long." or something

I'm doing my first steps with cryptography so maybe this stuff is obvious, but for people like myself, it'd be great to have Godot throw something more meaningful than `Error while signing: -16512`.

### Steps to reproduce

1. Generate a key shorter than 512 bits with `var key = crypto.generate_rsa(256)`
2. Use that to sign a message `var signature = crypto.sign(HashingContext.HASH_SHA256, sha256, key)
3. Check the error log

### Minimal reproduction project

n/a
Repository: terminal
Issue: Use a single renderer instance per window to reduce memory usage
Labels: Issue-Feature,Product-Terminal,Area-AtlasEngine

**The problem:** On my system, when Windows Terminal is maximized, every single DxRenderer/AtlasEngine instance consumes about 30MB committed virtual memory, 10MB physical memory, as well as 34 threads. Most of this is just due to the creation of the D3D11 device. It also consumes 100MB committed GPU memory, most of which is due to the creation of the swap chain. This cost quickly stacks up when you have a lot of open tabs. It gets more dire if you consider that a certain brand of stylish laptops are being sold right now with a total (across CPU _and_ GPU) amount of memory of 8GB, but a 200+ PPI display.

**The solution:** Instead of creating one renderer per pane, we could create one renderer per window.

# Proposed technical implementation details (optional)

Option 1 (?): https://learn.microsoft.com/en-us/uwp/api/windows.ui.composition.compositiontexture?view=winrt-26100

Option 2:

The swap chain would basically exist "behind" the XAML overlay that draws the pane grid lines. (Although, optimally, the renderer would draw them, so that DWM doesn't need to compose two swap chains.)
To allow us to draw multiple panes in a tab, we'll simply pass the renderer an array of `IRenderData`, one `IRenderData` per pane. The renderer will loop over the array and draw them iteratively into the swap chain at the pane's supposed position. Switching tabs simply switches the array of `IRenderData` that is being drawn. In case of `AtlasEngine` each `IRenderData` is assigned one `IBackend` instance which contains the glyph cache.
Implementing this will only be possible once `IRenderData` is less of a `I` and more of a `Data`, so that we can create multiple of them easily, pass them around, etc. It would also require us to implement buffer snapshotting and move the DirectWrite text segmentation into the `IBackend`. Afterwards, the above change can be implemented within a few days (I've already prepared most of what would be necessary for this).

A remaining open question is the overhead of switching tabs since the above proposal would lead to the destruction of the old `IBackend` array when the `IRenderData` array is being replaced. But I believe that this can be solved fairly easily by simply backing up the last used `IRenderData`/`IBackend` array, so that switching back and forth between 2 tabs is very quick at least (the most common scenario I can imagine). `IBackend` creation isn't _that_ expensive though, so even switching between a third tab wouldn't lag _that_ much.
Repository: godot
Issue: The code editor deletes more than expected when using CTRL + DELETE
Labels: bug,topic:editor,usability,regression,topic:gui

### Godot version

v4.0.2.stable.official [7a0977ce2]

### System information

Windows 11, Forward+, RTX 2070 Super

### Issue description

When using `CTRL + DELETE`, the code editor deletes more than expected. In this case of deleting the indent (to fix it), the first word is deleted, instead of just the spaces/tabs.

In Godot 3 it works as expected. This issue exists since Godot 4. It's a regression.


### Steps to reproduce

1. Open a script (GDScript) in Godot 4.
2. Move the cursor in front of a line in the indent section.
3. Press `CTRL + DELETE` and see that the code is removed. Expected: Only indent (spaces) should be deleted.
4. Do the same in Godot 3 and see that it works as expected: Only delete the spaces not the code.

| Godot 3 | Godot 4 |
| --- | --- |
|![godot_3](https://user-images.githubusercontent.com/53160891/232234012-b745b2ac-4157-424c-b1a5-c2783edc1399.gif)|![godot_4](https://user-images.githubusercontent.com/53160891/232234021-b249e29f-8435-4a36-b22f-711c9a683d6f.gif)|


### Minimal reproduction project

No project needed. Just test this is any code editor.

### Additional information

If the cursor is at the end of the line but before trailing spaces of the line, the lines are not deleted with `CTRL + DELETE`. It's maybe because this function only work on words (not space).

<img width="380" src="https://user-images.githubusercontent.com/53160891/232234578-01d7891c-b441-444d-90bf-7cf33bd2b213.gif" />
Repository: rust
Issue: "left.extend_from_slice(right.strip_prefix(&mut left[n..]).unwrap())" doesn't compile
Labels: A-lifetimes,A-borrow-checker,T-compiler,A-NLL,C-bug,NLL-polonius

Here is simplified version of my code from actual production code base:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=99a751acd113949b2a77fa251e33f955 (rustc 1.68.2)

The code doesn't compile, but the code is correct, and it should compile. Yes, I can do the same task easier, but the code is still correct.

`-Zpolonius` doesn't change anything, i. e. this bug is not fixed by Polonius.

@rustbot label +A-lifetimes +T-compiler +A-borrow-checker +NLL-polonius +A-NLL
Repository: vscode
Issue: [Accessibility]: Support filtering symbol types in Document Sylbol View
Labels: feature-request,accessibility,editor-symbols

CC @meganrogge and @isidorn

Related to #163506:

Similar to Problem View, it would be so much helpful if filtering feature could be supported in Document Symbol View. Filtering some specific symbol types can contribute to efficiency and flexible accessibility in code navigation.
Repository: PowerToys
Issue: feature request: disable sorting by metadata by default in windows explorer
Labels: Needs-Triage

### Description of the new feature / enhancement

By default windows explorer detects if folder has many audio/video/images and sorts them by metadata, which is can be extremely slow on hdd (20-30 seconds in folder with 30 videos), medium slow on ssd and slow on nvme (10 seconds to sort folder with ~2000 images).

### Scenario when this would be used?

If you have folder with many images/videos/audios and explorer is sorting files very slow you'll appreciate this option.

### Supporting information

You can manually switch to non-metadata sorting but this is process is long and you need to do this for EVERY folder, and there is no way to do this globally, so option for this will be appreciated.

more info:
https://superuser.com/questions/487647/sorting-by-date-very-slow
https://superuser.com/questions/238825/sort-files-by-date-modified-but-folders-always-before-files-in-windows-explorer
https://superuser.com/questions/738978/how-to-prevent-windows-explorer-from-slowly-reading-file-content-to-create-metad
https://answers.microsoft.com/en-us/windows/forum/windows_7-files/explorer-sort-by-date-very-very-slow/11dde6fa-3571-4e6f-b09d-813ee907820e
https://superuser.com/questions/233223/prevent-windows-explorer-from-trying-to-extract-metadata
https://superuser.com/questions/311432/windows-7-explorer-scanning-folder-when-opening-the-folder
https://superuser.com/questions/182209/windows-7-green-bar-of-slowness-why-do-simple-tasks-like-sorting-a-folder-by-s
Repository: kubernetes
Issue: Refactoring / cleanup: too many util pkgs for testing, some are dumb
Labels: priority/backlog,kind/cleanup,help wanted,sig/architecture,triage/accepted

Examples: k8s.io/client-go/util/testing includes:

```
func MkTmpdir(prefix string) (string, error) {
        tmpDir, err := os.MkdirTemp(os.TempDir(), prefix)
        if err != nil {
                return "", err
        }
        return tmpDir, nil
}
```

I think that every caller of that can be replaced with `os.MkdirTemp("", prefix)`.

It would be cool if someone went through ALL of the "testing" dirs to see if there are ACTUALLY USEFUL test helper functions.  For functions that are called less than 10 times, maybe just copy them to the respective places (if they are simple).  E.g. the same file as above has:

```
func MkTmpdirOrDie(prefix string) string {
        tmpDir, err := MkTmpdir(prefix)
        if err != nil {
                panic(err)
        }
        return tmpDir
}
```

...which is called just 5 times from 3 files.  Kill it and copy to those pkgs.

If there are enough non-trivial, useful things, we can conside k/utils/testing or something?