sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Inferred lifetimes in static trait method resolve to 'static, even though a local lifetime would suffice
Labels: A-lifetimes,T-compiler,A-inference,C-bug,E-needs-mcve

With a static function `sf` on a trait implemented on struct `S`, then calling `S::sf(&value)` with value being `(&str, …)`, the borrow checker will report that the string within the tuple doesn't live long enough. It behaves like it expects `&str` to be static, and indeed works only with &'static strings. However, if `S::sf` is made into a standalone function `sf`, it works as expected with non-static strings.

I tried to run `cargo check` on [this code](https://github.com/crates-io/criner/blob/2c6314397b347d4b3ddd4dcf6e3f0278bcaa447b/criner/src/engine/report/waste.rs#L50-L57), which caused these error messages:

<img width="794" alt="Screenshot 2020-02-26 at 08 02 37" src="https://user-images.githubusercontent.com/63622/75298787-6907ff00-586e-11ea-8363-83730d55b9e2.png">

Instead I expected the check to pass.

When commenting in [this line](https://github.com/crates-io/criner/blob/2c6314397b347d4b3ddd4dcf6e3f0278bcaa447b/criner/src/engine/report/waste.rs#L59) and commenting out [this line](https://github.com/crates-io/criner/blob/2c6314397b347d4b3ddd4dcf6e3f0278bcaa447b/criner/src/engine/report/waste.rs#L57) `sf` is used instead, and `cargo check` passes as expected.

### How to reproduce

The following snippet takes 1min 10s to execute on a 12core laptop.

```sh
git clone https://github.com/crates-io/criner && \
cd criner && \
git checkout 2c6314397b347d4b3ddd4dcf6e3f0278bcaa447b && \
cargo check
```

### Observations

The error message provided by the borrow checker is sparse compared to how helpful it usually is. Also I do suspect it is related to interactions of using references in static trait functions.

### Meta

`rustc --version --verbose`:
```
rustc 1.41.0 (5e1a79984 2020-01-27)
binary: rustc
commit-hash: 5e1a799842ba6ed4a57e91f7ab9435947482f7d8
commit-date: 2020-01-27
host: x86_64-apple-darwin
release: 1.41.0
LLVM version: 9.0
```

Also tested on nightly - the issue persists:
`rustc +nightly --version --verbose`
```
rustc 1.43.0-nightly (834bc5650 2020-02-24)
binary: rustc
commit-hash: 834bc5650acf7019a53b409db68986857822812c
commit-date: 2020-02-24
host: x86_64-apple-darwin
release: 1.43.0-nightly
LLVM version: 9.0
```
Repository: pytorch
Issue: Add `start_process_in_context` to `torch.multiprocessing`
Labels: module: multiprocessing,triaged,enhancement

## 🚀 Feature
Add the method `start_process_in_context(mp_context, fn, args=(), nprocs=1, join=True, daemon=False)` to `torch.multiprocessing.spawn` to allow the user to pass a python multiprocessing context object. 

## Motivation
Currently `start_process` takes a string `start_method` and internally constructs a python multiprocessing context to start the subprocess. The issue with this approach is that if I wanted to use a multiprocessing data structure (e.g. mp Queue) in my function, this needs to be created in the context I'm running my sub-processes on which is not available to me.

See: https://github.com/pytorch/pytorch/blob/master/torch/multiprocessing/spawn.py#L137

## Pitch
See RFC PR: https://github.com/pytorch/pytorch/pull/33797

1. Add a `start_process_in_context` method that takes an `mp_context` object as a parameter
2. Change the `start_process` method to call `start_process_in_context(multiprocessing.get_context(start_method, fn, args, nprocs, join, daemon)`


## Alternatives
1. Can have the user use vanilla python multiprocessing when they want to use mp data structures in their functions. PyTorch mp adds some nice features on top of vanilla multiprocessing such as error queues and better join logic using sentinels.

## Additional context

N/A
Repository: pytorch
Issue: Can't get module gradient in autograd.Function's custom backward when DataParallel is used
Labels: triaged,module: data parallel

I noticed a strange behavior when using `DataParallel` with custom backward pass in `autograd.Function`. Here is an example:

```py
import torch
import torch.nn as nn
from torch.autograd import Function
torch.set_default_tensor_type('torch.cuda.FloatTensor')
import os

class Combo(nn.Module):
    def __init__(self):
        super(Combo, self).__init__()
        self.func = nn.Conv1d(3,3,3,padding=1)
        
    def forward(self, x):
        z = Debug.apply(self.func, x)
        return z 

class Debug(Function):
    @staticmethod
    def forward(ctx, f, z):
        ctx.save_for_backward(z)
        ctx.f = f
        return z
    
    @staticmethod
    def backward(ctx, grad):
        grad = grad.clone()
        f = ctx.f
        z, = ctx.saved_tensors
        z = z.clone().detach().requires_grad_()
        with torch.enable_grad():
            y = f(z)
        y.backward(torch.randn(z.shape), retain_graph=False)
        print(f.weight.grad)                               # <------------------ HERE
        return None, grad

net = Combo()
para_net = nn.DataParallel(net)

xx = torch.randn(4,3,7).requires_grad_()    # Batch size 4
yy = para_net(xx)
loss = yy.mean()
loss.backward()
```

I want to compute and update `f.weight.grad` within the custom `backward` function (see "<----- HERE" in the code). I found that when `CUDA_VISIBLE_DEVICES=0` (i.e., only 1 GPU is used), this works fine; but if I use `CUDA_VISIBLE_DEVICES=0,1,2,3`, the printed `f.weight.grad` will be `None` on each GPU device. 

My guess is that when using multiple GPUs, each device will store a copy of `f`, which creates this problem.

The desired behavior is for each device to compute its own `f.weight.grad` and then added together when eventually collected by GPU 0. Is there anyway to resolve this?

Thanks a lot!
Repository: nvm
Issue: --lts flag won't install on ubuntu (Windows Linux Subsystem) might be just ubuntu too
Labels: OS: windows,installing node,pull request wanted

The option to download <code>nvm install --lts</code> gets a bunch of downloads done and saves it in cache, however, it just spits out the lts version failed to download. In my case it said

<code>nvm: install v12.16.1 failed!</code>

A quick workaround is to just manually install the version you want.

In my case, I had tried to run the installation with the --lts flag then I just explicitly installed v 12.16.1

Might be worthwhile to look into because this might be an issue with all Ubuntu users.

Also, I downloaded nvm with curl. I'm not sure if that might help.
Repository: godot
Issue: export(NodePath) references to the node and not the path
Labels: bug,topic:editor

**Godot version:**
3.2 and 3.2.1 rc1 
**OS/device including version:**
Windows 10 64 bit
**Issue description:**
An example: 

tool
extends Position3D

```
export(NodePath) var target 
var from : Spatial

func _ready():
	print(target)
	from = get_node(target)
	print(from)

```

will print this in-editor:
../../../Skeleton2/LThigh
[BoneAttachment:66373]
../../../Skeleton2/LCalf/Position3D
[Position3D:66376]
../../../Skeleton2/LFoot
[BoneAttachment:66377]
but will print this in-game:

[Object:null]
[Object:null]
[Object:null]

I also got it to throw an error: 

> Assigned type (Object) doesn't match the function argument's type (NodePath).  

with the same above code, but I've been unable to recreate it. This issue was found when trying to find a workaround to #34415 

I've included the project with these files, the bug is present in src/Player/Player.tscn

**Steps to reproduce:**
Using the above code and set the export value to some node

**Minimal reproduction project:**

[bug_mannequin.zip](https://github.com/godotengine/godot/files/4253474/bug_mannequin.zip)
Repository: go
Issue: cmd/go: fails when main module is in a 9P network share on Windows Subsystem for Linux
Labels: OS-Windows,NeedsInvestigation,GoCommand,modules

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.14 windows/amd64
</pre>

### Does this issue reproduce with the latest release?
It is the last release


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\a\AppData\Local\go-build
set GOENV=C:\Users\a\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS= -mod=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\a\go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=Z:\home\a\go\graph\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\a\AppData\Local\Temp\go-build115528494=/tmp/go-build -gno-record-gcc-switches

</pre></details>

### What did you do?

I'm using Windows Subsystem for Linux 2 and I access my files using a network driver. I tried to use `go mod init` in a new project and got this error : 
```
a@Hackintosh-Windows MINGW64 /z/home/a/go/graph
$ go mod init graph
go: creating new go.mod: module graph
go: updating go.mod: Lock Z:\home\a\go\graph\go.mod: Fonction incorrecte.
```
(Fonction incorrecte means incorrect/invalid function)

Then i tried to create it by end with the content : 
```
module graph

go 1.14
```

Running `go list -m` (or any command requiring this file actually) gives me this error : `go: RLock Z:\home\a\go\graph\go.mod: Fonction incorrecte.`

### What did you expect to see?

my go.mod file created.


### What did you see instead?

An error about Lock/RLock.

### More information:

After reinstalling go 1.13.8, i had everything working back.
Repository: pytorch
Issue: Wrongly detected: Division of ints in TorchScript uses Python 3 true division semantics
Labels: oncall: jit

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

https://github.com/pytorch/pytorch/blob/758ad516f32708de243f194144ee0f7b9e0f5117/torch/jit/frontend.py#L507 gives false positive exception on expressions like `float(a) / float(b)`.

## To Reproduce

For instance [(source):](https://circleci.com/gh/pytorch/pytorch/4601756?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)
```
Feb 26 08:48:58   File "/opt/python/cp27-cp27mu/lib/python2.7/site-packages/torch/jit/frontend.py", line 509, in build_BinOp
Feb 26 08:48:58     raise FrontendError(err_range, 'Division of ints in TorchScript uses Python 3 true '
Feb 26 08:48:58 torch.jit.frontend.FrontendError: Division of ints in TorchScript uses Python 3 true division semantics. Please put `from __future__ import division` at the top of your file:
Feb 26 08:48:58   File "/opt/python/cp27-cp27mu/lib/python2.7/site-packages/torch/_lobpcg.py", line 646
Feb 26 08:48:58                                     dtype=UBU.dtype)
Feb 26 08:48:58                 R_norm = _utils.norm(R)
Feb 26 08:48:58                 rerr = float(R_norm) / float(BU_norm * U_norm)
Feb 26 08:48:58                                    ~~~~ <--- HERE
Feb 26 08:48:58                 vkey = 'ortho_UBUmI_rerr[{}, {}]'.format(i, j)
Feb 26 08:48:58                 self.fvars[vkey] = rerr
```

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

No exception should be raised.
Repository: go
Issue: github: consider using GitHub Discussions
Labels: NeedsInvestigation,Community

The Go project uses the GitHub issue tracker for tracking bugs, not for asking questions or having general discussions.

Proposal #23745 was about considering using it with a "question" label, which we tried, but it wasn't a great experience for everyone involved (an issue tracker is designed primarily for tracking bugs, not asking questions or having discussions), and so we didn't proceed with it.

As @mvdan mentioned in https://github.com/golang/go/issues/23745#issuecomment-591378648, GitHub is working on a [new Discussions feature](https://news.ycombinator.com/item?id=22388639) that is specifically for having discussions rather than tracking bugs. Once it becomes available for general use, we can consider using it for the Go project. **Edit:** It's now [available](https://github.blog/2020-12-08-new-from-universe-2020-dark-mode-github-sponsors-for-companies-and-more/#discussions) in beta.

This is the tracking issue.

(Until something changes, please see https://golang.org/wiki/Questions for a list of places to ask questions and having discussions.)

/cc @golang/osp-team
Repository: TypeScript
Issue: @ts-ignore on an import that gets redefined strips the import from output
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.7.5 and 3.8.0

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
- ts-ignore remove import
- ts-ignore strip import

**Code**

```ts
// @ts-ignore: Local Foo override
import Foo from "foo";

declare const Foo: {
    bar(): number;
}

Foo.bar();
```

**Expected behavior:**

JS output should probably be:

```js
import Foo from "foo";

Foo.bar();
```

**Actual behavior:**

JS output is:

```js
Foo.bar();
```

**Playground Link:** https://www.typescriptlang.org/play/index.html?ts=3.8-Beta&ssl=9&ssc=1&pln=1&pc=1#code/PTAEAEBcGcFoEsDmA7A9gJwKYC5QBlUBjAQwBtQAxVVUVAN03XXgBNMAoeAWwAcNJK1UADN0qLqABEw6pIDc7dm0KliWUIVTJoAqqlwBvdqBOgARmoAUASlzIArlzOMFAX0V6AdBfQ2FQA

**Related Issues:** None so far

---

**Additional remarks**: We are aware of other ways to type the `foo` module but in this particular case the foo override needs to be done in the file using it. As far as we tried, adding a ts-ignore is the only way to make ts understand that we want to redefine the module.
Now, this seems to move the declaration site from the import to the the declare statement and that has the effect to mark the import site as unused, since the import is unused, ts strips it.
Repository: flutter
Issue: Flutter OnScreen Keyboard opens on physical key press
Labels: a: text input,e: device-specific,framework,P3,team-text-input,triaged-text-input

I have a device that uses a laserscanner to scan barcodes and outputs the result as simulated keypresses. I've used this with a RawKeyboardListener and it worked fine. Since then I've added a login screen to the app, that is only shown if the user hasn't logged in. If the login screen has been shown and disposed the onscreen keyboard opens when i press the physical scanner button. This should not happen and doesn't happen if the login screen hasn't been shown. My guess is, that there still are some remains of the textfields used in the login screen, after it is disposed. I've tried setting the FocusNodes for the Textfields and then disposing them in the dispose method, but that didn't work

I've asked a question on StackOverflow: [https://stackoverflow.com/questions/60417173/flutter-onscreen-keyboard-opens-on-physical-key-press](url)

## Steps to Reproduce

1. Screen with one or more Textfields
2. focus one or more
3. navigate to new screen
4. press physical button

**Expected results:** button is pressed but only the keyevents are fired

**Actual results:** the onscreen keyboard opens

<details>
  <summary>Logs</summary>

```
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.16299.1686], locale de-DE)
    • Flutter version 1.12.13+hotfix.8 at C:\Users\sruettge\Documents\flutter
    • Framework revision 0b8abb4724 (2 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at C:\Users\sruettge\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 36.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.42.1)
    • VS Code at C:\Users\sruettge\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[√] Connected device (1 available)
    • MEMOR 10 • S19H00332 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!
```

</details>
Repository: node
Issue: Many zlib tests are failing on armhf with system zlib
Labels: arm

<!--
Thank you for reporting an issue.

This issue tracker is for bugs and issues found within Node.js core.
If you require more general support please file an issue on our help
repo. https://github.com/nodejs/help


Please fill in as much of the template below as you're able.

Version: output of `node -v`
Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify affected core module name
-->

* **Version**: 10.19.0
* **Platform**: armhf-linux
* **Subsystem**: tests

### What steps will reproduce the bug?

<!--
Enter details about your bug, preferably a simple code snippet that can be
run using `node` directly without installing third-party dependencies.
-->

Build Node on ARMv7 with `--shared-zlib`, then run `make test-ci-js`.

### How often does it reproduce? Is there a required condition?

Every time.

### What is the expected behavior?

Tests succeed.

<!--
If possible please provide textual output instead of screenshots.
-->

### What do you see instead?

<!--
If possible please provide textual output instead of screenshots.
-->

```
ot ok 2163 parallel/test-zlib
  ---
  duration_ms: 1.641
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2164 parallel/test-zlib-brotli
  ---
  duration_ms: 1.441
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2165 parallel/test-zlib-brotli-flush
  ---
  duration_ms: 1.636
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2166 parallel/test-zlib-brotli-from-brotli
  ---
  duration_ms: 1.317
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2167 parallel/test-zlib-brotli-from-string
  ---
  duration_ms: 1.418
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2174 parallel/test-zlib-convenience-methods
  ---
  duration_ms: 1.524
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2199 parallel/test-zlib-random-byte-pipes
  ---
  duration_ms: 1.445
  severity: crashed
  exitcode: -7
  stack: |-
  ...
not ok 2205 parallel/test-zlib-write-after-flush
  ---
  duration_ms: 1.315
  severity: crashed
  exitcode: -7
  stack: |-
  ...
```

### Additional information

<!--
Tell us anything else you think we should know.
-->
Repository: vscode
Issue: [folding] pressing Enter in collapsed region should add new line outside region
Labels: feature-request,editor-folding


Issue Type: <b>Bug</b>

1. In a TypeScript file add a region
```ts
//#region Helper functions XXX
YYY
... some code goes here
//#endregion
ZZZ
```
2. Collapse the region.
3. Place the cursor just after XXX.
4. Press Enter

**Expected result:**
 Line break is added after end of region (before ZZZ)
```ts
//#region Helper functions XXX
YYY
... some code goes here
//#endregion

ZZZ
```
**Actual result:**
Region is expanded. Line break is added at the beginning off the region (before YYY)
```ts
//#region Helper functions XXX

YYY
... some code goes here
//#endregion
ZZZ
```

VS Code version: Code 1.42.1 (c47d83b293181d9be64f27ff093689e8e7aed054, 2020-02-11T14:46:03.121Z)
OS version: Windows_NT ia32 10.0.18363

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)|
|GPU Status|2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_renderer: disabled_off<br>surface_control: disabled_off<br>surface_synchronization: enabled_on<br>video_decode: enabled<br>viz_display_compositor: enabled_on<br>viz_hit_test_surface_layer: disabled_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|31.79GB (15.58GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (4)</summary>

Extension|Author (truncated)|Version
---|---|---
EditorConfig|Edi|0.14.4
csharp|ms-|1.21.12
debugger-for-chrome|msj|4.12.6
vetur|oct|0.23.0


</details>
<!-- generated by issue reporter -->
Repository: TypeScript
Issue: disable certain global types for specific files, or specify type roots for specific files.
Labels: Suggestion,Awaiting More Feedback

This continues some ideas from https://github.com/microsoft/TypeScript/issues/17042, which was closed by @microsoft (for inactivity, I think?).

## Search Terms

disable certain global types for specific files, specific type roots for certain files

## Suggestion

Ability to specify which `@types` (or in general, which specified `typeRoots`) apply to which files in a project.

## Use Cases

My project's `src` folder contains both `.ts` and `.test.ts` files, and I'd like an easy way for globals like `describe` to be defined only for the `.test.ts` files.

## Examples

Not sure, but maybe some sort of new options in `tsconfig.json` for specifying which `types` items, `lib` items, or `typeRoots` items apply to which files.

This would be a beneficial feature because various editors (VS Code aside) look for a `tsconfig.json` file at the root of a project, and at the moment the only way to make types work in all files is to just provides all types for all files, which is undesirable because `describe` is not a function that is available in source files (as an example).

Example configuration: maybe instead of a `typeRoots` array, it can be an object like:

```js
"typeRoots": {
  "./src/**/*.test.ts": ["../path/to/test/types"], // test-only types
  "./src/**/*.ts": ["../path/to/@types"] // other types other files
}
```

Or something. That's just an example to get the idea rolling.

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).