sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Improve error message when moving a captured value out of a closure
Labels: C-enhancement,A-diagnostics,A-closures,T-compiler

I tried this code:

```rust
fn main() {
    let foo = String::new();
    
    bar(move || std::mem::forget(foo));
}

fn bar<F: Fn()>(a: F) {
    
}
```

I got this error:

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
 --> src/main.rs:4:34
  |
2 |     let foo = String::new();
  |         --- captured outer variable
3 |     
4 |     bar(move || std::mem::forget(foo));
  |                                  ^^^ move occurs because `foo` has type `std::string::String`, which does not implement the `Copy` trait
```

The error message is because the closure is not `FnOnce()` – it could be called multiple times. So this is correct.

But I think the error message is confusing, because it says something about moving **out of** `foo`. What’s happening instead is that the captured `foo` is moved out of the closure that needs it to stay there for a second call.

### Meta

`rustc --version --verbose`:
```
rustc 1.45.0-nightly (a08c47310 2020-05-07)
binary: rustc
commit-hash: a08c47310c7d49cbdc5d7afb38408ba519967ecd
commit-date: 2020-05-07
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0
```
Repository: rust
Issue: Huge stack allocation is generated when assigning a huge piece of memory to a reference
Labels: I-slow,C-enhancement,T-compiler,I-heavy,A-mir-opt,A-mir-opt-nrvo,C-optimization

Hi!

I am developing an application for an armv7 embedded device. I'm holding the application state in a stack-allocated enum, where one of the enum variations is 16k (total memory is 64k)

Switching to the huge app state, my microcontroller hard faults. I have played with a short repro on [godbolt.org](https://godbolt.org/z/fosnuv) and I found that a particular pattern reserves stack space where I don't believe is necessary.

I tried this code:

```rust
pub fn init(a: usize) -> [usize; 1600] {
    [a; 1600]
}

pub fn fun(bar: &mut [usize; 1600], w: bool, a: usize) {
    *bar = init(a);
}
```

I expected to see this happen:
generated machine code fills `bar` directly

Instead, this happened:
generated machine code fills stack then copies to `bar`

Code generated with `-C opt-level=3 --target=armv7-unknown-linux-gnueabihf` on godbolt.org

```asm
example::fun:
        push    {r7, lr}
        sub.w   sp, sp, #2000 ; I don't like this stack alloc
        movs    r1, #0
        mov     r3, sp
.LBB1_1:
        str     r2, [r3, r1]
        adds    r1, #4
        cmp.w   r1, #2000
        bne     .LBB1_1
        mov     r1, sp
        mov.w   r2, #2000
        bl      __aeabi_memcpy4
        add.w   sp, sp, #2000
        pop     {r7, pc}
```

`rustc --version --verbose`:
```
1.43 and newer
```
Repository: rust
Issue: static `extern "stdcall" fn()` causes linker error on i686-msvc
Labels: A-linkage,A-FFI,T-compiler,O-windows-msvc,C-bug,O-x86_32

Trying to compile the following code on i686-pc-windows-msvc fails.
The issue seems to be that for some reason `fn second`'s name is being mangled without `@0` that stdcall functions are expected to have?

`rustc main.rs --crate-type bin -C opt-level=2 -C codegen-units=5 -Clto=no`

```rust
// Removing either of these modules causes the bug to disappear
mod inner {
    pub static FIRST: extern "stdcall" fn() = super::inner2::first;
    pub static SECOND: extern "stdcall" fn() = super::inner2::second;
}

mod inner2 {
    pub extern "stdcall" fn first() {
    }
    pub extern "stdcall" fn second() {
    }
}

fn main() {
    Box::new(&inner::FIRST);
    Box::new(&inner::SECOND);
}
```
link.exe is VS2019 version, though I believe the issue would reproduce on other Visual Studio versions as well.
```
  = note: main.main.7rcbfp3g-cgu.3.rcgu.o : error LNK2001: unresolved external symbol __ZN4main6inner26second17h87d24d2e635c1bfdE@0
            Hint on symbols that are defined and could potentially match:
              __ZN4main6inner26second17h87d24d2e635c1bfdE
          main.exe : fatal error LNK1120: 1 unresolved externals
```
Reducing the value of either `-C opt-level` or `-C codegen-units` or using `-Clto=fat` makes the linking succeed.

I tested that this issue occurs on `1.45.0-nightly (75e1463c5 2020-05-13)`, stable 1.32.0, and various other releases between those two. 1.31.0 does not have this issue. x86_64-pc-windows-msvc also works correctly.
Repository: TypeScript
Issue: Type Inference In Switch Statement Not Work With &&
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:**  4.0.0-dev.20200512

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** switch, inference, switch and inference

**Code**

```ts
interface I1 {
    type: 'I1';
    value: string;
}

interface I2 {
    type: 'I2';
    value: number;
}

type T = I1 | I2;

let t: T | undefined;

if (t && t.type == 'I1') {
    t.value; // Type string
}

switch (t?.type) {
    case 'I1':
        t.value; // Type string
        break;
}

switch (t && t.type) {
    case 'I1':
        t.value; // Uh oh, error
        t!.value; // Uh oh, string | number
        break;
}
```

**Expected behavior:**
The compile should understand that `t && t.type` is like as `t?.type` except that has also other falsy values.

**Actual behavior:**
The compiler does not infer from such expression.

**Playground Link:** https://www.typescriptlang.org/play/?ts=4.0.0-dev.20200512#code/JYOwLgpgTgZghgYwgAgJIEZkG8BQz-JgCeADhAFzIDkGVA3HgQG5wA2ArhcgM5hSgBzBgF8cOUJFiIUqAEzZG+YmUo1Z9RchYcuIdgFsARtBFjlKACrIAvGkwAfNLIY5WEMIUpXH7EABMIGFAIPxdgGGQACg8AMhjCADpzG1sadCoASgUCRO1OOmQAekLkC1IUXn4QARxRHG4Ad2AwBAALKLAAfiTyrNwchDhuFDSqck0csAS8iALi0vKePkEJgkMoCDgAa1N6ppb26OQ4xPM+zUHh6lpxnMnptnyikoBVdoB7VoAaZGgod6gqyUAEIHjo5q8Pt8llUBMhHHojNAgch1psdrUcEA
Repository: flutter
Issue: Error: Error when reading '../../bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory
Labels: c: crash,tool,P2,team-tool,triaged-tool

I have a mac OS Catalina and every time when I turn on my mac this error appeared when I try a compilation in the android studio. For solving the problem I need to download the Flutter again but I want to know a permanently alternative because keep doing download the same thing every day isn't normal!

I put my flutter doctor on attachment!
![image](https://user-images.githubusercontent.com/65370225/81987144-7c29a000-960f-11ea-8873-5ea72e87e598.png)
Repository: pytorch
Issue: [DISCUSSION] RPC server-side ThreadLocalState
Labels: oncall: jit,triaged,module: multithreading,module: rpc

This is a followup discussion of #38439. We fix #38439 by restoring `ThreadLocalState` and distributed autograd context separately. Creating this issue to track discussion on whether distributed autograd context id belongs to `ThreadLocalState.h` or we should create `RpcThreadLocalState.h` or else. Below are some concerns and notes from an offline discussion with @xush6528 @ilia-cher and @pritamdamania87,

*  the reason we didn't put ctx id in ThreadLocalState was because there was a concern that it would get passed to the backward pass and might trigger autograd recording for RPC calls in the backward pass. 
* There is not preferred to add another flag to `ThreadLocalState.h` to set/skip autograd context id. 
* If we add context id into `ThreadLocalState.h`, we should also dedup the similar logic added for RPC's TorchScript support.  See #36395

cc @suo @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @rohan-varma @xush6528 @jjlilley @osalpekar
Repository: tensorflow
Issue: Recursive support for tf.io.gfile.glob
Labels: stat:awaiting tensorflower,type:feature

Currently, the `tf.io.gfile.glob` API do not support `recursive=True` kwargs, which is inconsistent with Python [glob.glob](https://docs.python.org/3/library/glob.html).

Example to demonstrate the issue:

```py
import glob
import tensorflow as tf

tf.io.gfile.makedirs('/tmp/a/b/c')

tf.io.gfile.glob('/tmp/a/**')  # ['/tmp/a/b']
glob.glob('/tmp/a/**', recursive=True)  # ['/tmp/a/', '/tmp/a/b', '/tmp/a/b/c']
```
It would be nice to support `recursive=True` for the Gfile API:

```py
tf.io.gfile.glob('/tmp/a/**', recursive=True)  # ['/tmp/a/', '/tmp/a/b', '/tmp/a/b/c']
```
Repository: TypeScript
Issue: Suggestion: Reorder properties in HtmlAttribute
Labels: Suggestion,In Discussion,Domain: Performance

After discussing #38399 with @ahejlsberg, @RyanCavanaugh, and @DanielRosenwasser it sounds like one possible improvement we could make to the check time of code consuming [JSX.IntrinsicElements](https://github.com/preactjs/preact/blob/7f5cac7cbcf2645a0b55d316736575062505c7c5/src/jsx.d.ts#L765)  (and related libraries) would be to reorder some of the properties in `HTMLAttributes` so that the ones depending on the type parameter are resolved first when comparing types structurally (i.e. so we hit the variance short-circuit ASAP).  We could consider submitting PRs to that effect.
Repository: TypeScript
Issue: Suggestion: Can we check properties in a more efficient order during structural comparisons?
Labels: Needs Investigation,Domain: Performance

A generalization of #38583: we can't tell without (expensively) resolving a property's type/signature whether it depends on a type variable, but we can heuristically check whether it syntactically appears to depend on one.  If this heuristic is good enough, we might be able to check properties in a more efficient order.
Repository: rust
Issue: precision loss in Fp mul
Labels: C-bug,T-libs,A-floating-point

Fp Multiplication result should be normalized for the extended 128-bit mantissa representation before round-to-even rounding. Otherwise, it may lose a bit of precision if both arguments are normalized and more bits if they weren't.

https://github.com/rust-lang/rust/blob/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/num/diy_float.rs#L24

Affects dec2float conversion.
https://github.com/rust-lang/rust/blob/7c34d8d6629506a596215886e5fc4bb2b04b00ae/src/libcore/num/dec2flt/algorithm.rs#L156
Repository: flutter
Issue: Dumping logs at the end of running tests is causing timeouts on Fuchsia
Labels: customer: fuchsia,framework,dependency: fuchsia,platform-fuchsia,P3,team-framework,triaged-framework
Repository: vscode
Issue: Cursor changes to arrow when switching windows (macOS)
Labels: bug,upstream,macos,electron,confirmed,editor-highlight,upstream-issue-pending

## Summary:

When I switch between VSCode windows, the macOS cursor gets stuck on the "Arrow", and does not return to the proper "I-Beam" cursor.  This behavior started in VSCode v1.45, but is also reproducible in v1.45.1.

## Steps:

1. Activate VSCode application.  Notice that the cursor is the proper "I-Beam" cursor.
2. Switch to another VSCode window either using the "Window" menu, or a keyboard shortcut such as `Cmd-Tilde`.
3. The cursor will be an "Arrow" cursor on the new window, and will remain that way.  It gets "stuck" in this state.

## Screencast illustrating the issue:

https://youtu.be/XLCP7F811Zs

## System Information

- macOS Catalina 10.15.3 (19D76)
- VSCode v1.45 & v1.45.1

CPUs | Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
-- | --
GPU Status | 2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: unavailable_offrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_off_okwebgl: enabledwebgl2: enabled
Load (avg) | 2, 2, 2
Memory (System) | 32.00GB (12.30GB free)
Process Argv | -psn_0_8435723
Screen Reader | no
VM | 0%

## Enabled Extensions

Extension | Author (truncated) | Version
-- | -- | --
project-manager | ale | 11.0.0
spellright | ban | 3.0.50
php-symbols | lin | 2.1.0
sublime-keybindings | ms- | 4.0.7
vscode-icons | vsc | 10.1.1
vscode-todo-highlight | way | 1.0.4
material-theme | zhu | 3.6.1
Repository: flutter
Issue: SizedBox docs missing what happens if height or width are bigger than the Parent
Labels: framework,d: api docs,P2,team-framework,triaged-framework

`SizedBox` docs specify what would happen if `width` or `height` are `null` or `double.infinity`, but it just makes a hint at `widget forces its child to have a specific width and/or height (assuming values are permitted by this widget's parent)`. but it doesn't specify what happens if the values aren't permitted by the parent.

Also, I have seen a different behavior from setting `height: double.maxFinite` instead of `height: double.infinity`, where `double.maxFinite` correctly sizes a `TabBarView`'s unbounded `ViewPort`, but `double.infinity` doesn't. This difference in behavior should be documented as well, as this is a hack I am seeing on the wild.
Repository: pytorch
Issue: Doc update regarding predictability of experiments using Seeds and Workers
Labels: module: docs,triaged,module: determinism

## 🚀 Feature
The current official docs don't have specific examples regarding the use of seeds and worker_init_fn in order to attain a certain degree of reproducibility.
Following the suggestion by @ptrblck in the [thread](https://discuss.pytorch.org/t/reproducibility-with-all-the-bells-and-whistles/81097), I would like to add the solutions mentioned to the official docs.

## Motivation
While participating in a Kaggle competition I ended up spending countless hours of GPU compute on reproducing my results across followup runs of the pipeline but I realized it too late that the number of workers, the seeds **inside** these works all affect the outcome of the run. I searched a lot of discussions and docs to end up realizing how to use the worker_init_fn and what to expect from it. I would not want people to end up where I did so I would like to give them a heads up with whatever I have understood.

## Pitch
As suggested by @ptrblck , I would like to update the [doc](https://pytorch.org/docs/stable/notes/randomness.html) with the code examples and give people a clear heads-up regarding the dependency of the results on the workers and seeds and how they may be able to reach an acceptable level of reproducibility.

## Alternatives
As far as I can tell, this would be the most thorough example.

## Additional context
N/A


cc @jlin27
Repository: svelte
Issue: Support two-way-data-binding with custom-input-elements
Labels: awaiting submitter,custom element

Custom (Input) Elements like ui5-input uses the propname value for the inputvalue attribute. 

But svelte only permit value as propname when the element's name is input, textarea or select 

https://github.com/sveltejs/svelte/blob/bdabd89f093afe06d5a4bfb8ee0362b0a9634cfc/src/compiler/compile/nodes/Element.ts#L532

otherwise svelte throws an error that value is not a valid binding-element

pls have a look here: 
https://codesandbox.io/s/divine-architecture-3qvlc?file=/App.svelte
Repository: pytorch
Issue: Make rebuildBucket() to be async in c10d reducer
Labels: oncall: distributed,triaged,module: data parallel

Follow up #35137, right now rebuildBucket() is blocking during broadcast communication, we can make broadcast communication call in this function to be async and overlap with next forward() call when rebuildBucket() is called multiple times during whole training processes in the future. Right now, it is not a concern, as rebuildBucket() is only called once during whole training. 

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @xush6528 @osalpekar
Repository: godot
Issue: HTTPRequest sometimes returning response code "502" to a POST request
Labels: bug,platform:windows,topic:core

**Godot version:**
3.2.2 beta2

**OS/device including version:**
Windows

**Issue description:**
HTTPRequest sometimes returns response code 502 when doing a POST request with simple body.
The request is sent to Github API v3, with a body of 
```
{
"content":content,
"encoding":encoding,
}
```
where `content` is the content of a file, in this case an .obj file.
I don't know if it may be linked to reading issues or just the Github API not responding correctly, but the response code is not always 502.
The script that contains this code is "Commit.gd" in `addons/github-integration/scripts/`

**Steps to reproduce:**
1. Download and import the project
2. Activate Github Integration plugin, and log in your Github profile with mail and token
3. Select a repository of your choice double clicking it
4. Press "Commit to Repo"
5. Press "Select Files" and choose "newWater.obj"
6. Press "Commit and Push" and wait for the debug messages in output.

**Minimal reproduction project:**
https://gofile.io/d/gMDnIp

Thank you very much.
Repository: create-react-app
Issue: Why Can't We Allow Developers To Override Proxy Behaviour For text/html Requests?
Labels: needs triage

Firstly great project and apologies if this is not the correct repository to log this question. Please let me know if it belongs elsewhere and I will move it.

Question:

When developing with CRA, we can specify a proxy that allows us to route requests to one or more backends whilst the CRA server handles serving the actual UI. To determine whether to proxy a request or forward it to a backend, the request’s Accept header is checked to see if it expects a text or html response - if so, no proxying occurs. I understand why this is usually a good idea.

The problem comes when a developer needs to get a specific response to such a request from the backend. An example of such a scenario might be authorization flows that rely on redirects that are triggered by a navigation event that needs a specific response from the backed. Thus the developer may set the `window.location.href` from react to a specific path on the server, allowing the server to trigger a challenge and redirect to an IDP and complete an OAuth/OIDC flow, for example. Even if you feel the developer should really be using a different approach for OAuth/OIDC, other scenarios exist where responding to a URL navigation by forwarding the request to the backend may be helpful.

Since the developer knows which paths should serve which contents, why not let them say for a given path “No, don’t even try to serve index.html here, just go to the configured backend no matter what the accept header says”? It would seem reasonable to let the developer specify this in `setupProxy.js`.
Repository: PowerToys
Issue: [Image Resizer] Support only showing in extended context menu
Labels: Idea-Enhancement,Product-Settings,Product-Image Resizer

## Feature Request

Can Image Resizer include a setting where it can be configured to only show in *extended* context menu (i.e. Shift + Right click). It is already supported by Powerrename, and it would be great to also have this setting in Image Resizer.
Repository: node
Issue: internalModuleStat & internalModuleReadJSON prevent resolution override
Labels: fs,module

### What steps will reproduce the bug?

Imagine that the `fs` module is overriden to add support for a virtual filesystem. Make a `require` call towards a virtual file.

### What is the expected behavior?

The resolution should succeed, since the `fs` methods know how to access the file.

### What do you see instead?

Cannot find module 'virtual'.

### Additional information

This occurs because Node cheats and doesn't actually use all of the `fs` methods. In most cases it does (for example `fs.realpath`, `fs.readFile`, `fs.readdir`), but not for all. Two methods in particular goes into unique native bindings that cannot be overriden:

- `internalModuleStat` is used instead of `fs.stat`: https://github.com/nodejs/node/blob/master/lib/internal/modules/cjs/loader.js#L151
- `internalModuleReadJSON` is used instead of `fs.readFile`:
https://github.com/nodejs/node/blob/master/lib/internal/modules/cjs/loader.js#L257

Since those functions aren't exposed (not only do they come from `internalBinding`, they're also [`destructured`](https://github.com/nodejs/node/blob/master/lib/internal/modules/cjs/loader.js#L62-L65) so we never have a chance to change their references), we cannot even add the virtual layer to them at all.

Would it be possible to use the `fs` primitives or, at least, to expose `internalModuleStat` & friends in a way we can wrap them?
Repository: terminal
Issue: Enable focusing tabs by mouse scrolling on the tab row
Labels: Help Wanted,Area-UserInterface,Product-Terminal,Issue-Task



https://code.visualstudio.com/updates/v1_45#_switch-tabs-using-mouse-wheel

> When you use the mouse wheel to scroll over editor tabs, you currently cannot switch tabs, only reveal tabs that are out of view. Now with a new setting `workbench.editor.scrollToSwitchTabs`, you can change the behavior to switch the active editor tab.
>
> Below when the cursor focus in the editor tab region, if the user scrolls their mouse wheel, the active editor changes.
>
> Note: You can also press and hold the Shift key while scrolling to get the opposite behavior (for example, you can switch editor tabs even when the `scrollToSwitchTabs` setting is off).

This seemed like a cool idea, so I figured I'd add it here.
Repository: pytorch
Issue: Add Distributed LR Scheduler to RPC
Labels: module: bootcamp,feature,triaged,module: rpc

The original request is from [this discussion](https://discuss.pytorch.org/t/does-distributedoptimizer-suppor-zero-grad-and-lr-scheduling) on forum. Currently, applications need to use the raw RPC APIs to implement LR scheduling in user code. It will be useful provide a helper for this. 

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @rohan-varma @xush6528 @jjlilley @osalpekar
Repository: go
Issue: x/pkgsite: confusing display of constants block when there are unexported constants
Labels: Documentation,help wanted,NeedsInvestigation,Tools,pkgsite

If you look at documentation on this page: https://golang.org/pkg/text/template/parse/#NodeType

The NodeDot is 6 and NodeField is 8, but there is nothing between these two constants. however the source has two unexported consts between  NodeDot and NodeField, which makes NodeField 8.

When you debug the code you can easly misunderstand the node types but simply counting them from the top.

The documentation should indicate actual values of constants