sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Suggest `#[repr({integer}]` for enums when using the wrong integer type
Labels: A-diagnostics,T-compiler

Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ffe26b2bc45f08e1a3d8e39def953f4e

```rust
const CONST: i32 = 0;

enum Enum {
  Variant = CONST,
}
```

The current output is:

```
error[E0308]: mismatched types
 --> src/lib.rs:4:13
  |
4 |   Variant = CONST,
  |             ^^^^^ expected `isize`, found `i32`
```

I believe it would be helpful to suggest adding a `#[repr(i32)]` to the enum in this case.
Not sure how that should be rendered.

#### Another small diagnostic improvement for int-enums

Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=580b8d3086d643767931565546c60654

```rust
const CONST: i32 = 0;

#[repr(u32)]
enum Enum {
  Variant = CONST,
}
```

The current output is:
```
error[E0308]: mismatched types
 --> src/lib.rs:5:13
  |
5 |   Variant = CONST,
  |             ^^^^^ expected `u32`, found `i32`
```

Here we should point to the attribute in a help label like we do for type annotations in `let` statements.

That is something like this.
```
error[E0308]: mismatched types
 --> src/lib.rs:5:13
  |
2 |   #[repr(u32)]
  |          --- expected due to this
...
5 |   Variant = CONST,
  |             ^^^^^ expected `u32`, found `i32`
```
Repository: vscode
Issue: [api] memento onDidChange api
Labels: feature-request,api,workbench-state

I would like to know when some values are changed by other windows. But currently I could not find onDidChange even on `env.globalState`. Is there another way to be notified?
Repository: TypeScript
Issue: API: Exception in TypeChecker.typeToTypeNode
Labels: Needs Investigation,Rescheduled

# Bug Report

### 🔎 Search Terms
typeToTypeNode kind undefined

### 🕗 Version & Regression Information

4.3.2 and earlier versions (not sure when it started)

- This is a crash

### ⏯ Playground Link

[Playground](https://www.typescriptlang.org/play?#code/C4TwDgpgBAYg9nKBeKAKAZgOwFxoHQECGATgOYDOuA2gLq0CUyAfFAG5wCWAJo0i+9wDcAKADGcTOWBR0CXPEQpUAIxLMoAbwC+9EUA)

### 💻 Code

Using compiler API:
```ts
function transformVariableDeclaration(statement: ts.VariableDeclaration, checker: ts.TypeChecker) {
    if (statement.initializer) {
        const initializerType = checker.getTypeAtLocation(statement.initializer);
        const initializerTypeNode = checker.typeToTypeNode(initializerType, undefined, undefined); // TypeError: Cannot read property 'kind' of undefined
        // ...
    }
}
```

Target code being transpiled:
```ts
type Foo = (fn: (...args: [][]) => void) => void;
const foo: Foo = (bar => {});
```

Exception thrown:
```
Exception has occurred: TypeError: Cannot read property 'kind' of undefined
  at Object.parenthesizeElementTypeOfArrayType (node_modules\typescript\lib\typescript.js:20825:28)
    at Object.createArrayTypeNode (node_modules\typescript\lib\typescript.js:22343:53)
    at typeReferenceToTypeNode (node_modules\typescript\lib\typescript.js:49344:52)
    at typeToTypeNodeHelper (node_modules\typescript\lib\typescript.js:49085:95)
    at serializeTypeForDeclaration (node_modules\typescript\lib\typescript.js:50323:30)
    at symbolToParameterDeclaration (node_modules\typescript\lib\typescript.js:49803:41)
    at node_modules\typescript\lib\typescript.js:49725:263
    at Array.map (<anonymous>)
    at signatureToSignatureDeclarationHelper (node_modules\typescript\lib\typescript.js:49725:229)
    at createTypeNodeFromObjectType (node_modules\typescript\lib\typescript.js:49296:49)
```

### 🙁 Actual behavior

When calling `typeToTypeNode` an exception is thrown.

### 🙂 Expected behavior

No exception should be thrown and undefined should be returned.

Tracing through the ts code, undefined is returned from `typeReferenceToTypeNode` [here](https://github.dev/microsoft/TypeScript/blob/main/src/compiler/checker.ts#L5095) (linking to online editor since github can't display the file) and there is a comment referencing [this issue](https://github.com/microsoft/TypeScript/issues/18217). That is assigned to the object attempting to be accessed.

The trigger seems to be the rest parameter type being an array of empty tuples. The real code that triggered the issue used some tricky generics to arrive at that type, but this direct version was able to reproduce the same issue.
Repository: pytorch
Issue: compile_commands.json doesn't contain nvcc invocations
Labels: module: build,triaged

Steps to reproduce:
1. Build with CUDA enabled
2. Look for a CUDA file (e.g., Activations.cu) in `compile_commands.json`

cc @malfet @seemethere @walterddr
Repository: pytorch
Issue: Java NVIDIA GPU Inference Support
Labels: triaged,oncall: mobile

## 🚀 Feature
The [Java Demo](https://github.com/pytorch/java-demo) now supports Linux, Mac, and Windows. That's great. However, looking at [Device.java](https://github.com/pytorch/pytorch/blob/master/android/pytorch_android/src/main/java/org/pytorch/Device.java) in the underlying [pytorch_android library](https://github.com/pytorch/pytorch/tree/master/android/pytorch_android), it appears to only support CPU and VULKAN (= mobile android GPU). 

Please add support for Java NVIDIA GPU inference. 

## Motivation
Our entire web stack is Java/JVM based. It would be massively helpful to be able to deploy pytorch models for Java-based cloud NVIDIA GPU inference. 

## Pitch

Pretty please? Java is a pretty widely used language, and better support for inference in it would broaden the appeal of PyTorch. 

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
[Export the pytorch model to an ONNX model](https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html) and then use [JavaCPP ONNX presets](https://github.com/bytedeco/javacpp-presets/tree/master/onnxruntime). _This adds undesirable steps & complexity to the pipeline_

Unfortunately the JavaCPP PyTorch presets don't (yet?) support module loading: see https://github.com/bytedeco/javacpp-presets/issues/1068
Repository: material-ui
Issue: [material-ui] Dialog Title overrides the Dialog Content padding
Labels: new feature,component: dialog,package: material-ui

Title gets rid of the top padding on Dialog Content and it gets overridden by:

.MuiDialogTitle-root+.css-141nu3b-MuiDialogContent-root {
    padding-top: 0;
}

This is on "@material-ui/core": "^5.0.0-beta.1".

This is an issue if you have the whole title background a different color than the content. Content will bump right up to it.

Example:

https://codesandbox.io/s/hopeful-fermi-0v850?file=/src/App.js:514-515

#26795
Repository: flutter
Issue: [Desktop] Equivalent of Electron's `second-instance`
Labels: c: new feature,framework,c: proposal,a: desktop,P3,team-framework,triaged-framework

## Use case

Electron's `second-instance`: https://www.electronjs.org/docs/latest/api/app/#event-second-instance

Used for deeplinking (redirection after authentication) and also to prevent multiple instances.

## Proposal

It would be nice to have it in the desktop embedding plugins as it is useful in many use cases.
Repository: kubernetes
Issue: Steady state kubelet CPU usage is high due to excessive allocation in prometheus scraping of cadvisor
Labels: kind/bug,priority/backlog,sig/node,lifecycle/frozen,needs-triage

The `/metrics/cadvisor` endpoint uses a custom prometheus collector to generate the many thousands of series necessary to get pod/container level metrics from the kubelet for cpu/memory/container info.  Unfortunately, the pattern here generates a very large number of transient allocations on each scrape.

Over about 10-15 scrapes we generate about 7 million objects which corresponds to about 20% of memory allocations and about 20% (approximately) of CPU during steady state kubelet use on a lightly loaded node (20 pods).

```
   5657009 17.01% 17.01%    5657009 17.01%  k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus.makeLabelPairs
   1900758  5.72% 22.73%    2381366  7.16%  k8s.io/kubernetes/vendor/github.com/prometheus/client_golang/prometheus.NewDesc
```

A normal prometheus metric vector caches the creation of dto.LabelPairs because the default golang protobuf implementation is very pointer happy (`[]*struct{ key *string, value *string}`) which causes a lot of allocations on the heap that are unnecessary and also because most of the time the set of label pairs is consistent from scrape to scrape.

However, because of how cadvisor/metrics/prometheus.go creates those, label pairs aren't cached or reused (semi-intentionally) so every scrape does the maximum number of possible allocations, when in practice 99% of those allocations can be avoided.

The fix is to amortize allocations by reusing desc across collect intervals, but that requires us to track and flush unused descriptors after the containers are out of scope.  That would in theory cut about 20% of kubelet cpu use across most of the fleet that is scraping `metrics/cadvisor` (which is pretty high since these are the basic metrics most distros want for admins).

#### What happened:

#### What you expected to happen:

#### How to reproduce it (as minimally and precisely as possible):

#### Anything else we need to know?:

#### Environment:
- Kubernetes version (use `kubectl version`):
- Cloud provider or hardware configuration:
- OS (e.g: `cat /etc/os-release`):
- Kernel (e.g. `uname -a`):
- Install tools:
- Network plugin and version (if this is a network-related bug):
- Others:
Repository: angular
Issue: zone.js Promise.finally behavior different from native
Labels: area: zones,P3

### Which @angular/* package(s) are the source of the bug?

Don't known / other

### Is this a regression?

No

### Description


![image](https://user-images.githubusercontent.com/35769340/130121351-765b89b7-aa50-4226-b305-65ab66840050.png)

![image](https://user-images.githubusercontent.com/35769340/130254974-9710fabe-1816-4d50-9d6c-4caa40364cfe.png)


<details>
  <summary>Sample code</summary>
  
  ```javascript
    new Promise(res => {
       throw 'error';
       res(null);
    }).finally(() => console.log('finally'));
  ```
</details>

## Minimal reproduction
zone.js: https://stackblitz.com/edit/zones-js-zdlcnc?file=index.ts
native:  https://stackblitz.com/edit/js-iauprh

## What happened in zone.js 
zone.js `.finally()` [ scheduleResolveOrReject](https://github.com/angular/angular/blob/e3b6e26565bcd03b259392c6676ce931e8b5be20/packages/zone.js/lib/common/promise.ts#L452) then [clearRejectedNoCatch](https://github.com/angular/angular/blob/e3b6e26565bcd03b259392c6676ce931e8b5be20/packages/zone.js/lib/common/promise.ts#L226), which will [remove](https://github.com/angular/angular/blob/e3b6e26565bcd03b259392c6676ce931e8b5be20/packages/zone.js/lib/common/promise.ts#L243) the uncaught error

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/zones-js-zdlcnc?file=index.ts

### Please provide the exception or error you saw

```true
zone.js `.finally()` not throw the uncaught error while uncaught, but native promise will.
```


### Please provide the environment you discovered this bug in

```true
zone.js    v0.11.4
```


### Anything else?

_No response_
Repository: react
Issue: [DevTools Bug]: React Profiler: Flamegraph section overflows and not resizable
Labels: Type: Bug,Status: Unconfirmed,Resolution: Needs More Information,Component: Developer Tools

### Website or app

https://stackoverflow.com/help/minimal-reproducible-example

### Repro steps

note: the URL I linked is not relevant and only meant to make the bug report submit pass, previously closed [here](https://github.com/facebook/react/issues/22137) since I couldn't find any production site with a *development* build, so I don't think it makes sense to outright fail bug reports for react profiler related issue. 

actual bug report:
I have a page that has lots of component so the component tree is pretty long, when I profile on it, the flamechart just overflows by default and I have to put it fullscreen to see the "why did this render" side bar
![image](https://user-images.githubusercontent.com/2238944/130124388-4dc40efd-b8a0-4a03-aacf-3d8bc6d64990.png)


### How often does this bug happen?

Every time

### DevTools package (automated)

_No response_

### DevTools version (automated)

_No response_

### Error message (automated)

_No response_

### Error call stack (automated)

_No response_

### Error component stack (automated)

_No response_

### GitHub query string (automated)

_No response_
Repository: flutter
Issue: TabBarView does not trigger child 'deactivate()' method when swiped if TextField has focus
Labels: a: text input,framework,f: material design,f: focus,has reproducible steps,found in release: 2.2,found in release: 2.5,team-design,triaged-design

## Steps to Reproduce

Add `TabBarView `and 3 children to it, one of them with a `TextField` and `autofocus = true`

Change tabs by swiping left/right.

Child `deactivate()` method is not called in the tab with the `TextField`, if it has focus, when swiping away from the tab.

If I call `FocusScope.of(context).requestFocus(new FocusNode());` on another tab, then `deactivate()` is called on the tab with the `TextField`.

Changing tab by swiping in not removing the focus from `TextField`.

**Expected results:** <!-- what did you want to see? -->

`TextField` should loose focus when hidden from view tree when swiping away from its tab.

Child `deactivate()` method should be called the same way it is when changing tabs by tapping on them.


<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 2.4.0-5.0.pre.164, on Microsoft Windows [versÃ£o 10.0.19042.1165],
    locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Chrome - develop for the web
[√] Android Studio (version 4.2)
[√] Connected device (3 available)

• No issues found!

```
Repository: TypeScript
Issue: Add lacking documentation for Date constructor interface
Labels: Suggestion,Experience Enhancement

# lib Update Request

## Configuration Check

My compilation *target* is `ES5` and my *lib* is `the default`.

## Missing / Incorrect Definition

None - this is just improving documentation (jsdocs).

## Sample Code

None - this is just improving documentation (jsdocs).

## Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Repository: vscode
Issue: Cannot open folder from command line when VS Code update is pending
Labels: bug,install-update,windows,workbench-cli

<!-- ⚠️⚠️ 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?: Yes

<!-- 🪓 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. -->
- VS Code Version: 1.58.2
- OS Version: Windows_NT x64 10.0.19043

Steps to Reproduce:

1. Wait until VS Code has an update
2. In Windows Terminal, type `code` in a directory

Output:
```
D:\Development\MyProject>code .
internal/modules/cjs/loader.js:937
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\Microsoft VS Code\resources\app\out\cli.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:934:15)
    at Module._load (internal/modules/cjs/loader.js:779:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

```

Issue https://github.com/microsoft/vscode/issues/129072 is somewhat similar but after the update is done I can successfully open a folder from command line.
Repository: vscode
Issue: Configurable scroll padding
Labels: feature-request,editor-rendering

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
I'd like to be able to configure an amount of characters (or lines) of padding for both horizontal and vertical scrolling (using the text cursor).
Currently, vscode has 0 lines of vertical padding, and ~2 characters of padding for horizontal scrolling. I'd like to be able to configure this in settings, to show more or less while scrolling.

Currently:
![image](https://user-images.githubusercontent.com/31492625/130136243-2e72890a-9846-4a13-85f5-7d80efedfaa6.png)

Example of modified padding:
![image](https://user-images.githubusercontent.com/31492625/130136501-e4e96cd8-e1f7-422b-ad22-95860e69d8ad.png)
Repository: flutter
Issue: Integration test example boilerplate to support async main
Labels: c: new feature,tool,t: flutter driver,c: proposal,P2,team-tool,triaged-tool

## Use case

Most real apps need to do some initialization on startup.  Example from my project:
```dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final userAgent = await getUserAgent();
  await Logo.preload();
  final dataDir = await getApplicationDocumentsDirectory();
  final tempDir = await getTemporaryDirectory();
  runApp(AppWidget(userAgent, dataDir, tempDir));
}
```

When following the docs ["An introduction to integration testing"](https://flutter.dev/docs/cookbook/testing/integration/introduction), I copied the example code which includes this boilerplate:
```dart
group('test-group', () {
  late FlutterDriver driver;
  setUpAll(() async {
    driver = await FlutterDriver.connect();
  });
  tearDownAll(() async {
    driver.close();
  });
```

The test fails immediately with #41029.  Any user writing a real app will hit this eventually.  They will waste time reading the test output, using a search engine to look for the solution, reading through the 12 pages of text on #41029, identifying the fix, implementing the fix, and running the test again to see if it was fixed.  This is a big waste of time for folks using Flutter professionally.

## Proposal

Update the example to this:

```dart
group('test-group', () {
  late FlutterDriver driver;
  setUpAll(() async {
    driver = await FlutterDriver.connect();
    await driver.waitUntilFirstFrameRasterized(); // <---- ADD THIS
  });
  tearDownAll(() async {
    driver.close();
  });
```

Even better, update `FlutterDriver.connect()` to wait for the first frame.  That will eliminate 1 of the 10 lines of boilerplate required by every flutter_driver test.
Repository: pytorch
Issue: Enable some amount of CI tests on lazy_tensor_staging branch
Labels: oncall: jit,module: lazy

Tests to consider adding are:
1) test_ptltc, C++ unit tests. (CPU is done. GPU is under consideration.)
2) example.py (https://github.com/pytorch/pytorch/blob/lazy_tensor_staging/lazy_tensor_core/example.py). Needed to cover some python scripts.
3) test_ops.py (https://github.com/pytorch/xla/blob/master/test/test_ops.py). Needs to change the device to lazy and run it with the TS backend.
4) other tests in the above folder could be useful too, like training MNIST end to end. This one should be super fast even for CPU.

cc @gmagogsfm
Repository: nvm
Issue: Semver range support
Labels: feature requests

I know the preferred way to reference ranges in `nvm` is with `lts/name`, but we've run into an issue when `pkg.engines` has to specify a minimum value for the minor version, ie `>= 10.13.1`. Without switching to an exact version, users who don't habitually update their nvm references will not get the memo to update to the minimum.

Allowing `^10.13.1` or something like that would allow a minimum version without capping the maximum version, which is desirable.
Repository: flutter
Issue: [image_picker][Android]: images/videos are stored in cache directory that may cause increase in storage space
Labels: c: new feature,platform-android,p: image_picker,package,c: proposal,P3,team-android,triaged-android


![Inked7684F099-4F77-4275-BE04-F6BD1A3929CC_LI](https://user-images.githubusercontent.com/32152153/130165411-829b2084-bf60-4b3a-b1bb-1b9f623f0a70.jpg)

## Use case
[image_picker] Every time you select a picture or video, it will be cached in a private directory, which will increase a lot of storage space,and you cannot share this directory with other applications.

## Proposal
I want to add configurations that don't need to be cached and return to the original album directory, so that my app can reduce storage usage and share pictures or videos instantly.