sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Suggestions when a single-field enum variant pattern is needed
Labels: C-enhancement,A-diagnostics,T-compiler,A-suggestion-diagnostics,D-newcomer-roadblock

Beginners are often confused by the pattern where a set of types are combined using an `enum`, especially when the name of the enum variant is the same as the name of the variant's field's type. Even knowing how it works, I've myself forgotten to write out enum variant patterns containing struct patterns where they are needed. It would be useful if the compiler could give suggestions that understand this mistake.

Given [the following code:](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=dfd5194a1dc236b243654bfe56eb830f)

```rust
enum Foo {
    Bar(Bar),
}
struct Bar {
    x: i32,
}

fn oops_1(f: Foo) {
    match f {
        Foo::Bar { x } => todo!()
    }
}
fn oops_2(f: Foo) {
    match f {
        Bar { x } => todo!()
    }
}
```

The current output is:

```
error[E0769]: tuple variant `Foo::Bar` written as struct variant
  --> src/lib.rs:10:9
   |
10 |         Foo::Bar { x } => todo!()
   |         ^^^^^^^^^^^^^^
   |
help: use the tuple variant pattern syntax instead
   |
10 |         Foo::Bar(x) => todo!()
   |                 ~~~

error[E0308]: mismatched types
  --> src/lib.rs:15:9
   |
14 |     match f {
   |           - this expression has type `Foo`
15 |         Bar { x } => todo!()
   |         ^^^^^^^^^ expected enum `Foo`, found struct `Bar`
```

The compiler could instead recognize these cases, and produce the suggestion `Foo::Bar(Bar { x }) =>` as well as a message specific to the situation:

* A variant pattern with fields which do not match the variant, but do match the fields of the variant's sole field.
* A pattern not of enum type where an enum pattern is expected, but the enum has a variant whose sole field is of the pattern's type.

@rustbot label +A-suggestion-diagnostics +C-enhancement +D-newcomer-roadblock
Repository: create-react-app
Issue: Eject adds build tools to `dependencies` instead of `devDependencies`
Labels: needs triage,issue: bug report

### Describe the bug

When running `react-scripts eject`, the generated `package.json` has loaders, webpack, jest, etc all in `dependencies`. Correct me if I'm wrong, but these fields should all be in `devDependencies` instead.

### Did you try recovering your dependencies?

<!--
  Your module tree might be corrupted, and that might be causing the issues.
  Let's try to recover it. First, delete these files and folders in your project:

    * node_modules
    * package-lock.json
    * yarn.lock

  Then you need to decide which package manager you prefer to use.
  We support both npm (https://npmjs.com) and yarn (https://yarnpkg.com/).
  However, **they can't be used together in one project** so you need to pick one.

  If you decided to use npm, run this in your project directory:

    npm install -g npm@latest
    npm install

  This should fix your project.

  If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
  Then run in your project directory:

    yarn

  This should fix your project.

  Importantly, **if you decided to use yarn, you should never run `npm install` in the project**.
  For example, yarn users should run `yarn add <library>` instead of `npm install <library>`.
  Otherwise your project will break again.

  Have you done all these steps and still see the issue?
  Please paste the output of `npm --version` and/or `yarn --version` to confirm.
-->

N/A

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

```
System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 17.4.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.5.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.3
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

(Write your steps here:)

1. `npx create-react-app my-proj --template typescript`
2. `cd my-proj && npm eject`

### Expected behavior

Build tools are inserted under `devDependencies`.

### Actual behavior

Build tools are inserted under `dependencies`.
Repository: flutter
Issue: Use the clang toolchain in buildroot for iOS simulator ARM64 builds.
Labels: engine,P2,team-engine,triaged-engine

Backfilling an issue for the [comment in code](https://github.com/flutter/buildroot/blob/master/build/toolchain/clang.gni#L47) here by @gw280
Repository: electron
Issue: [Feature Request]: Electron server-side APIs/rendering
Labels: enhancement :sparkles:,documentation :notebook:

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

Electron examples generally follow the pattern:

- API layer - Electron wrapper exposing client-side APIs
- User-interface - Browser window running static html/css/js

However there doesn't seem to be a discussion of how server-side APIs/rendeing should work in Electron land. There are many resulting questions:

1. Should all server-side APIs be run in the Electron main thread, and exposed via Browser window functions? what if we want REST APIs instead of browser methods?
2. What if we want to use a framework to develop server-side APIs? (Express, NextJS, NestJS) how should it be run alongside Electron?
3. How should we run a server to render pages server-side instead of navigating static pages?

**As a developer I would like an opinionated, expert recommendation on how to run server-side code/frameworks alongside Electron.**

### Proposed Solution

A section/page on [Electron Docs](https://www.electronjs.org/docs/latest) describing how server-side code should be used within/alongside Electron. Server-side code best practices & examples considering performance and security.

An example Electron app repo on GitHub with actual working code. I've created a quick example with branches for ExpressJS and NextJS:
https://github.com/kmturley/electron-server

### Alternatives Considered

Potential alternatives:

- Medium blog posts
- Stackoverflow answers
- GitHub issues discussions

However these are less official, contain multiple opinions and do not always demonstrate best practices.

### Additional Information

_No response_
Repository: vscode
Issue: [Codespaces] machine-overridable, experimental setting changes its value when the focus changes
Labels: bug,help wanted,settings-editor

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- Version: 1.66.0-insider
- Commit: 3e5c7e2c570a729e664253baceaf443b69e82da6
- Date: 2022-03-14T05:14:23.074Z (16 hrs ago)
- Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36

Steps to Reproduce:
This reproduces with the "Azure: Authentication Library" setting from the Azure Account Extension. Definition in package.json: https://github.com/microsoft/vscode-azure-account/blob/1268dab932c324a63f9875b96e3cf6dca742cfa2/package.json#L224

1. In Codespaces, install the [Azure Account Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)
2. Open user settings with the "Preferences: Open Settings (UI)" command 
3. Select user settings and use the drop down on the left to navigate to "Extensions" -> "Azure configuration". 
4. Modify the "Azure: Authentication Library" setting and then click away from the dropdown box to change focus as shown below. The setting reverts back to the default value.

https://user-images.githubusercontent.com/22795803/158266976-6c613eff-4c9e-4dff-84ab-38ad330e6692.mov

More info:
This setting does not appear when searching the user settings even though it can be navigated to in the user settings tree. It does appear in a search of the workspace settings as expected.

![image](https://user-images.githubusercontent.com/22795803/158267656-cb466927-6de5-415e-a597-6796e412837a.png)
![image](https://user-images.githubusercontent.com/22795803/158267667-9bd675f0-62ce-4cf6-827b-5a70ded0cef8.png)

Related: https://github.com/microsoft/vscode-azure-account/issues/482
Repository: PowerToys
Issue: [FancyZones] Bring overlapping canvas zone to front on mouseover / hover / hotkey
Labels: Idea-Enhancement,Product-FancyZones,Needs-Triage

### Description of the new feature / enhancement

When using canvas layouts, it's possible to have overlapping Fancy Zones, but it would be nice if you could bring another zone to the front just by hovering over its region (could include a delay period to avoid accidental behavior, if desired.)

Alternatively, a hotkey to send the current zone to the background temporarily might serve the same purpose.

Potentially, having a particular zone always go to the background when its apps are not focused might also be useful.

### Scenario when this would be used?

As an example, I have a code editor that takes up more than 50% of my horizontal screen space and 100% of the vertical. On the remaining <50% of the horizontal space I have Slack/other chat that I monitor, but is partially obscured by my code editor's overlapping zone.  Currently, if I want to see the obscured areas of the chat window, I have to click in the chat client, then click back in my code editor (or alt-tab, etc.)  It would be nice if I could just mouse over the general region of the other zone and have it automatically gain focus from the perspective of Fancy Zones, without having to click inside the client to give it focus.

Alternatively, if there was a hotkey option to send the current zone temporarily to the background and bring others forward, it would serve the same purpose.

### Supporting information

_No response_
Repository: neovim
Issue: refactor: improve vim.paste Replace-mode handling
Labels: enhancement,api,refactor,clipboard,lua

### Feature already in Vim?

Yes

### Feature description

Currently Replace mode pasting is implemented using `nvim_buf_set_lines()`. This approach has several problems:
- Its code looks ugly.
- It doesn't deal with multibyte characters well.
- It is hard to support streamed pasting.
- It is hard to support Virtual Replace mode.

An alternative approach may be to use `nvim_input()` or `nvim_feedkeys()` with the `'paste'` option set. This approach may be slower, but I don't think it is common for one to paste a very large block of text in Replace mode.
Repository: flutter
Issue: Make the clang-tidy presubmit check understand generated files.
Labels: engine,P2,team-engine,triaged-engine

An instance of the [failure is here](https://ci.chromium.org/p/flutter/builders/try/Mac%20clang-tidy/800).

Impeller references files that generated at built time contain reflected shader information for creating pipeline state objects at runtime. To do this, the ImpellerC shader compiler is built and invoked. However, this only happens when a target depending on Impeller is actually built.

Presubmits on CI don't actually build any targets and just run tidyness checks on the source code as-is. When this happens, references to the generated sources cannot be resolved and the tidyness check fails.

This is not an issue with Clang Tidy not being able to ignore certain issues. Instead, it is an issue with Clang Tidy not being able to recognizer a valid translation unit due to missing references.

Another complication is the FLUTTER_NOLINT is only respected when the top level TU contains this string. That is, if the TU that includes a header that contains a missing reference, FLUTTER_NOLINT does nothing.
Repository: pytorch
Issue: DISABLED test_trace_buffer_slice (__main__.TestFX)
Labels: triaged,skipped,module: fx



This test was disabled because it is failing on master ([recent examples](http://torch-ci.com/failure/test_trace_buffer_slice%2C%20TestFX)).

cc @ezyang @SherlockNoMad
Repository: deno
Issue: flaky WPT: /fetch/api/basic/response-null-body.any.html - Response.body is null for responses with status=204 (method=POST)
Labels: flaky

https://github.com/denoland/deno/runs/5543231621?check_suite_focus=true

```

/fetch/api/basic/response-null-body.any.html

test Response.body is null for responses with status=204 (method=POST) ... failed

failures:

Response.body is null for responses with status=204 (method=POST)
promise_test: Unhandled rejection with value: object "TypeError: error sending request for url (http://web-platform.test:8000/fetch/api/resources/status.py?code=204&content=hello-world): invalid HTTP version parsed"
Error
    at get_stack (http://web-platform.test:8000/resources/testharness.js:4418:21)
    at new AssertionError (http://web-platform.test:8000/resources/testharness.js:4411:22)
    at assert (http://web-platform.test:8000/resources/testharness.js:4395:19)
    at Test.<anonymous> (http://web-platform.test:8000/resources/testharness.js:703:29)
    at Test.step (http://web-platform.test:8000/resources/testharness.js:2534:25)
    at http://web-platform.test:8000/resources/testharness.js:2581:35

failures:

        "Response.body is null for responses with status=204 (method=POST)"

file result: failed. 9 passed; 1 failed; 0 expected failure; total 10
```
Repository: TypeScript
Issue: Variance measurement within generic functions is inaccurate
Labels: Bug

# Bug Report

I was looking into what it'd take to expand variance analysis to be useful in relating generic signatures when I realized that generic signatures pretty often get used _within_ generic types, and so, logically, their variance would also need to account for the outer type parameters. Then I realized the same should already be true for type aliases/interfaces, since we allow generic local type aliases/interfaces.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?noImplicitAny=false&strictFunctionTypes=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitThis=false&target=99&module=1&ts=4.6.2&filetype=ts#code/GYVwdgxgLglg9mABMAPAFQHwAoCUiDeAUIolAJ4AOApogIIoCqGiAvAcSYhHAFyIMBuDiW5goAJwCGfLAA8+aPC2bgA1mDgB3MEJIBfQh3FUoIcUixgQAG2uJJAZ3tgy9p-Uw4hBwqEiwERABzdAAaRDQAZRAAI0QqWSgqMAATJ0xcdhJrE3tWZHRsLw4cqEQ4tlQo2KKhDkl8mN1y-MlvIA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
// @strict: true
function f<T>() {
  type A<U> = {
    co: U;
    contra: (x: T) => unknown;
  }

  return (null as any as A<T>);
}

function g<T, TSub extends T>() {
  let a = f<T>();
  let b = f<TSub>();

  a = b;
  b = a;
}
```

### 🙂 Expected behavior

Neither assignment in `g` succeeds because the generic parameter passed to `f` is used in both co- and contravariant positions in `A`, which should make it invariant.

### 🙁 Actual behavior

There is no error on the `a = b` assignment. This is because variance measurement for `A` does not account for any outer type parameters used in `A`.
Repository: godot
Issue: Convert 'return' in 'fragment' shader error to warning (Godot 3.x)
Labels: enhancement,topic:shaders

### Godot version

3.5.0.beta, commit 3f08b7236181bac5216d6bf15ba18282600c8c55

### System information

Android 10 (Quest 2), Android 12 (Pixel 3 XL)

### Issue description

I have the following piece of fragment shader code, which up to Godot 3.4.3.stable used to work fine ([full code](https://github.com/m4gr3d/GAST/blob/89bf3fecbd708d36c3ee32b53bec1d1dcb0a3c00/core/src/main/cpp/gdn/projection_mesh/projection_mesh_utils.h#L42)):
```
if (VIEW_INDEX == VIEW_RIGHT) {
        // Right Eye
        if (shader_view_index == 0) {
            // Discarding since this shader should only render for the left (0) view index.
            discard;
            return;
        }
        new_uv = (right_eye_sampling_transform * vec4(UV.x, UV.y, 0.0, 1.0)).xy;
    } else {
        // Left Eye
        if (shader_view_index == 1) {
            // Discarding since this shader should only render for the right (1) view index.
            discard;
            return;
        }
        new_uv = (left_eye_sampling_transform * vec4(UV.x, UV.y, 0.0, 1.0)).xy;
    }
```

In Godot 3.5.0.beta (commit 3f08b7236181bac5216d6bf15ba18282600c8c55), I get the following shader error and the shader stops working:
```
2022-03-14 19:02:30.610 3480-3537 E/godot: SHADER ERROR: Using 'return' in 'fragment' processor function results in undefined behavior!
2022-03-14 19:02:30.610 3480-3537 E/godot:    at: (null) (:33) - Using 'return' in 'fragment' processor function results in undefined behavior!
```

### Steps to reproduce

Run the snippet of shader fragment code above against Godot 3.4.3.stable and then against Godot 3.5.0.beta.
It should work in Godot 3.4.3.stable, and fail in Godot 3.5.0.beta.

### Minimal reproduction project

_No response_
Repository: godot
Issue: `changed` signal not emitted when changing uniforms in a `ShaderMaterial`
Labels: enhancement,topic:rendering,documentation,topic:shaders

### Godot version

3.4.3-rc1

### System information

Ubuntu Desktop 20.04 LTS GNOME (x86_64)

### Issue description

Every object that extends `Resource` implements a `changed` signal which is emitted when a parameter is changed on said resource. When a uniform variable is changed in a `ShaderMaterial` however, this signal is **not** emitted. This only happens for uniform variables — changing other parameters, such as the `shader` parameter, emits the `changed` signal as expected.

### Steps to reproduce

This can be verified on any object which can have a `ShaderMaterial` assigned to it, e.g. `MeshInstance2D`:
```GDScript
tool
extends MeshInstance2D

func _ready() -> void:
	material.connect("changed", self, "_on_material_changed")
	
func _on_material_changed() -> void:
	print("Material changed!")
```

The message will be printed to the console when removing or adding a shader to the `shader` parameter, but not when changing uniforms.

### Minimal reproduction project

_No response_
Repository: pytorch
Issue: Cannot get op through FX when using nn.Sequential
Labels: triaged,module: fx

### 🚀 The feature, motivation and pitch

When I want to trace op of Alexnet based on nn.Sequential, I print node name and I got:

features_0, features_1.. or classifier_0 classifier_1..


But what I expect are con2d, dropout, relu...

### Alternatives

_No response_

### Additional context

_No response_

cc @ezyang @SherlockNoMad
Repository: pytorch
Issue: `package.PackageExporter` does not actually appear to have a `file_structure` method
Labels: module: docs,oncall: package/deploy,imported

### 📚 The doc issue

https://pytorch.org/docs/stable/package.html#use-the-file-structure-api

the file structure api described here doesn't seem to work with the package exporter class, the code block is accessing a method which does not appear to exist for the PackageExporter class.

### Suggest a potential alternative/fix

_No response_

cc @brianjo @mruberry
Repository: pytorch
Issue: Autograd API to get saved for backwards tensors for an autograd graph
Labels: module: double backwards,module: autograd,triaged

### 🐛 Describe the bug

@Chillee nerdsniped me into thinking about how to get AOTAutograd working on higher order derivatives. For a moment, let's forget about the actual compilation aspect, and just focus on what it would take to trace out and then reconstruct a torch.autograd.Function that supports higher order derivatives.

The basic hazard, as laid out in @zdevito's  https://colab.research.google.com/drive/1VpeE6UvEPRz9HmsHh1KS0XxXjYu533EC?usp=sharing is that saved tensors for backwards may receive gradient contributions when run in a higher order context. If we trace only a single backwards, we won't ever see such contributions (because they're always zero in this case.)

So what ingredients do we need for our torch.autograd.Function?

1. We need to explicitly return every saved tensor for backwards as an output of the torch.autograd.Function, so that they are able to receive gradients when used, and
2. We need a way to specify additional gradients for the saved tensors when we run backwards

If we have (1), we automatically have (2), since we can add the list of tensors to the outputs argument of torch.autograd.grad, and then just specify the extra gradient contributions we wanted to provide with `grad_outputs`. So all we need is something like `torch.autograd.saved_for_backwards(outputs, inputs)` which returns a list of all tensors which were saved for backwards given the graph specified by outputs and inputs, so that we can additionally return them as outputs.

Then, AOTAutograd can simply perform this query, and add the saved tensors for backwards as extra outputs to the forward function they trace. Graph partitioning is then trivial, as the cut points are exactly uses of these saved tensors.

### Versions

master

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7