sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Type derivation failure on generic parameters: type annotations required
Labels: A-type-system,A-associated-items,T-compiler,A-inference,C-bug,T-types

The following example fails with this error:
```
error[E0284]: type annotations required: cannot resolve `<E as H>::R == NR`                                                            
  --> examples/minreprod/src/main.rs:24:36                                                                                             
   |                                                                                                                                   
24 |             impl<E: H<R = NR>, ER> H for A<E>                                                                                     
   |                                    ^                                                                                              
   |                                                                                                                                   
   = note: required because of the requirements on the impl of `H` for `main::make_a::A<E>`                                            
```

Example:

```rust
pub struct NR;

pub trait H {
    type R: From<NR>;
}

struct X {}
impl H for X {
    type R = NR;
}

fn main() {
    fn make_a() -> impl H<R = NR> {
        {
            struct A<E: H<R = NR>> {
                e: E,
            }

            impl<E: H<R = NR>, ER> H for A<E>
            where
                E: H<R = ER>,
                ER: From<NR>,
                NR: From<ER>,
            {
                type R = NR;
            }
            
            A { e: X{} }
        }
    }
}
```

If you remove the `ER` parameter here, and all bounds on it, compilation succeeds. Likewise, if you remove the bound on `E`, compilation succeeds.

Obviously some of the parameters/bounds are redundant, but I'm generating code like this from a macro which doesn't know how to interpret extra bounds like `E: H<R = NR>` and must include the other bounds to handle other cases, while the compiler should (IMO) be able to figure this out.

For the curious, this is related to [`kas::macros::make_widget`](https://docs.rs/kas/0.0.2/kas/macros/index.html#the-make_widget-macro).
Repository: vue
Issue: Add beforeDeactivated hook
Labels: feature request

### What problem does this feature solve?
I use :key and keep-alive tag to display chats. And in order to maintain the position of the scroll when switching between chat rooms, I need to save the scrollTop when the hook is deactivated and put it on the element when the hook is activated. But the deactivated hook is already called when the element has been removed from the DOM, so I needed a new hook - beforeDeactivated.

Seriously, this hook is needed just like the others before* hooks.

### What does the proposed API look like?
Here, I think, everything is clear. Simple hook.

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: pytorch
Issue: Allow to build pytorch for a *specific* architecture
Labels: module: build,triaged

## 🚀 Feature
Allow the end user to specify which CPU architecture to target in the build process.

## Motivation

We are building Pytorch from source for our clusters. We have clusters that have a variety of CPU architectures, supporting instruction sets from sse3, to avx512 and all in between. Currently, pytorch build *insists* on using the architecture on which it is being built. We tried to pass specific compilation flags (`-march=corei7-avx` for example), but it just won't work, it always get overwritten by something.

## Pitch

Get the build procedure in line with standard practices and let whoever build the source choose the optimization parameters.
Repository: vscode
Issue: Specify terminal group for integrated terminal in launch configuration
Labels: debug,under-discussion

It is great to see that task configurations now allow the specification of terminal group (https://github.com/Microsoft/vscode/issues/47265) - works well from my initial testing. Can you please also allow launch configurations to specify terminal group when using the integrated terminal for debug and start/stop?

See my comment here: https://github.com/Microsoft/vscode/issues/47265#issuecomment-449993673
Repository: rust
Issue: Problem with using struct expressions with path metavariables
Labels: A-parser,A-macros,T-compiler,C-bug

## STR

this occurs on stable & nightly.

```Rust
macro_rules! m {
    ($s: path) => {{
        Some($s {})
    }}
}

struct S {}
fn main() {
    let _ = m!(S);
}
```

## Expected Result

Code compiles, e.g. it compiles if the macro doesn't contain a `Some`:
```Rust
macro_rules! m {
    ($s: path) => {{
        $s {}
    }}
}
```

## Actual Result

Obscure parser error

```
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `{`
 --> src/main.rs:3:17
  |
3 |         Some($s {})
  |                 ^ expected one of `)`, `,`, `.`, `?`, or an operator here
...
9 |     let _ = m!(S);
  |             ----- in this macro invocation

error: aborting due to previous error
```

cc @dtolnay @estebank @petrochenkov 

@nikomatsakis & @eddyb : this frustrates me lifting `TypeFoldable` over `Result`
Repository: tensorflow
Issue: Build Tensorflow version that detects CPU instruction set at runtime and lights-up/down
Labels: stat:awaiting tensorflower,type:feature,type:build/install

**System information**
- TensorFlow version (you are using): 1.12.0 CPU

**Describe the feature and the current behavior/state.**
Currently Tensorflow cross-compiles for different instruction sets and will warn if the CPU supports instructions that the TF build does not use, and fail to load if the CPU does not support an instruction set that the TF build uses.  This makes it impossible to build an application that runs on a variety of hardware and ensure that it achieves optimal results for that hardware (or even runs at all).

I understand that TF supports cross-compilation and developers can build their own library that works best for their hardware, but this doesn't solve the case where an application developer wants to ship an application that uses TF and runs on a variety of hardware.

I understand that having multiple codepaths with runtime light-up could increase the size of TF, that could be dealt with by making this a separate flavor/configuration of TF, eg: "portable" build, and that could be published as a binary zip/tarball along side the current builds.

**Will this change the current api? How?**
No

**Who will benefit with this feature?**
Applications and libraries redistributing tensor flow binaries to run on a variety of hardware.
Repository: flutter
Issue: [camera] Allow controlling the preview and output mirroring
Labels: c: new feature,customer: crowd,p: camera,package,team-ecosystem,P3,triaged-ecosystem

I am currently using the camera pluggin on flutter. Is there a way to remove the mirror effect from the front camera (selfie camera) when you take a picture? If there is none, can it be added ?
Repository: godot
Issue: Master peer ID not preserved on duplication
Labels: enhancement,documentation,topic:network,topic:multiplayer

**Godot version:**
v3.1-beta3

**OS/device including version:**
Arch Linux rolling & NVidia GPU

**Issue description:**
Duplicated nodes do not seem to preserve parent's network master ID.

**Steps to reproduce:**
- Create some "child" node and append it to some "parent" node.
- Set network master ID for parent node.
- Child properly inherits parent's network master ID.
- Duplicate child and observe clone's network master ID being equal to 1.

**Minimal reproduction project:**
```gdscript
extends Node

func _ready() -> void:
    var parent = Node.new()
    var child = Node.new()
    parent.add_child(child)
    parent.set_network_master(1337)

    prints(
        parent.get_network_master(),
        child.get_network_master()
    )  # 1337 1337

    print(child.duplicate().get_network_master())  # 1
```
Repository: pytorch
Issue: Allow building C++ custom ops that imports another custom ops
Labels: module: cpp-extensions,triaged

## 🚀 Feature
It seems like from the docs that you can only build the custom ops individually
https://pytorch.org/tutorials/advanced/cpp_extension.html

```Integrating a C++/CUDA Operation with PyTorch
Integration of our CUDA-enabled op with PyTorch is again very straightforward. If you want to write a setup.py script, it could look like this:

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
    name='lltm',
    ext_modules=[
        CUDAExtension('lltm_cuda', [
            'lltm_cuda.cpp',
            'lltm_cuda_kernel.cu',
        ])
    ],
    cmdclass={
        'build_ext': BuildExtension
    })
```
Can we support building the custom ops that rely on other already built custom ops?

## Motivation

I have a custom op `op_a`. Now I am working on a second custom op `op_b`. `op_b` calls `op_a`.

We should support importing. As Pytorch is used in larger and larger projects. This is going to be very common

cc @yf225 @glaringlee @zou3519
Repository: rust
Issue: Tracking issue for making `dbg!(x)` work in `const fn`
Labels: T-lang,T-libs-api,C-tracking-issue,S-blocked,A-const-eval,needs-rfc,A-fmt,Libs-Tracked,S-tracking-design-concerns

We should make `dbg!(expr)` work in `const fn` by using some `lang_item` that is on the body of a function that contains the contents of `dbg!(...)`. We also need to make it work with inlining.

This sorta needs `impl const Debug` to work, but in the meantime we can just dump the miri state something something, @oli-obk can fill in...
Repository: rust
Issue: target_feature doesn't trickle down to closures and internal fns
Labels: A-codegen,T-lang,A-SIMD,F-target_feature_11,A-target-feature

Leaves poorly optimized assembly in its wake.

```#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;

// Creates non inlined calls to intrinsics
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[target_feature(enable = "avx2")]
pub unsafe fn foo(input: &[__m256]) -> f32 {
    let accum = |val: __m256| {
        let roll = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 0);
        let mut sum = val;
        let mut tmp = _mm256_permutevar8x32_ps(val, roll);
        for i in 0..7 {
            sum = _mm256_add_ps(tmp, sum);
            tmp = _mm256_permutevar8x32_ps(tmp, roll);
        }
        sum
    };
    // Once we call a complex internal closure or fn multiple
    //  times, we find that the compiler hasn't told them that
    //  they can inline or use avx2 intrinsics. Not the sharpest.
    let sum1 = accum(input[0]);
    let sum2 = accum(input[1]);
    _mm256_cvtss_f32(sum1) + _mm256_cvtss_f32(sum2)
}

// Works as expected
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[target_feature(enable = "avx2")]
pub unsafe fn bar(input: &[__m256]) -> f32 {
    // When we pull this tool out of the shed every thing works
    #[target_feature(enable = "avx2")]
    unsafe fn accum(val: __m256) -> __m256 {
        let roll = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 0);
        let mut sum = val;
        let mut tmp = _mm256_permutevar8x32_ps(val, roll);
        for i in 0..7 {
            sum = _mm256_add_ps(tmp, sum);
            tmp = _mm256_permutevar8x32_ps(tmp, roll);
        }
        sum
    }
    let sum1 = accum(input[0]);
    let sum2 = accum(input[1]);
    _mm256_cvtss_f32(sum1) + _mm256_cvtss_f32(sum2)
}
```

https://rust.godbolt.org/z/cIr7qS

I found this bug by triggering this one with closures. I wasn't able to trigger it from godbolt. I'm using the latest stable, so if I copied the code in it would work (as in not work).
https://github.com/rust-lang/rust/issues/50154

Making a separate issue since this one is a performance bug.
Repository: vscode
Issue: Support comments in UI editors (settings and keyboard shortcuts)
Labels: feature-request,settings-editor

I prefer using the UI editor for both settings and keyboard shortcuts. However, I often find myself automatically going into the JSON files because they're packed with comments — for both modified and unmodified settings/keyboard rules (example shown below).

### Feature Request

- Support ability to add comments to the UI editors, possibly with an icon next to the setting/keyboard rule (if it has a comment), allowing the comment to be viewed by hovering over the icon.
- Add additional tags that would allow you to further filter the results (e.g. `@commented`, `@modified @commented`, `@unmodified @commented`).

### Note

This would also solve a bug where comments in the JSON file are removed (without any indication) when making changes in the UI editor. See #75599.

### Example

Here's an example `settings.json` file that has comments for both modified and unmodified settings:

```jsonc
{
  // Disabling validation prevents errors on syntax constructs that aren't supported by the language
  // service (e.g. proposed features such as the pipeline operator). It also prevents duplicate
  // linting errors (from both ts and eslint). However, it also prevents the editor.showUnused
  // (fading of unused variables) option from working.
  // https://github.com/Microsoft/TypeScript/issues/29293)
  // https://github.com/Microsoft/TypeScript/issues/13408
  "javascript.validate.enable": false,
  "typescript.validate.enable": false,

  // Good for disabling annoying tooltips, but nice for eslint error details.
  // Waiting for ability to customize tooltips or place the tooltips at top/bottom.
  // https://github.com/Microsoft/vscode/issues/65996
  // "editor.hover.enabled": false,
}
```
Repository: go
Issue: cmd/go: clarify relative import paths and modules in documentation
Labels: Documentation,NeedsFix,modules

In the documentation for cmd/go, at the end of the section about relative import paths
https://golang.org/cmd/go/#hdr-Remote_import_paths, the text says:

>  To avoid ambiguity, Go programs cannot use relative import paths within a work space.

The documentation should also add that relative import paths don't work with modules.
Repository: TypeScript
Issue: TS doesn't see when we add symbol properties to functions. 
Labels: Bug

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.4.0-dev.20190207

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
function, property, symbol

**Code**

```ts
const mySymbol = Symbol()

interface Foo {
    [mySymbol]: true
    (): any
}

const foo: Foo = () => {} // error: 
// Property '[mySymbol]' is missing in type '() => void' 
// but required in type 'Foo'.
foo[mySymbol] = true
```

**Expected behavior:**
Just like with regular (non-symbol) props, show no error if the symbol property actually has been added .

**Actual behavior:**
There is an error.

**Playground Link:** [link](http://www.typescriptlang.org/play/index.html#src=const%20mySymbol%20%3D%20Symbol()%0D%0A%0D%0Ainterface%20Foo%20%7B%0D%0A%20%20%20%20%5BmySymbol%5D%3A%20true%0D%0A%20%20%20%20()%3A%20any%0D%0A%7D%0D%0A%0D%0Aconst%20foo%3A%20Foo%20%3D%20()%20%3D%3E%20%7B%7D%20%2F%2F%20error%3A%20%0D%0A%2F%2F%20Property%20'%5BmySymbol%5D'%20is%20missing%20in%20type%20'()%20%3D%3E%20void'%20%0D%0A%2F%2F%20but%20required%20in%20type%20'Foo'.%0D%0Afoo%5BmySymbol%5D%20%3D%20true)
Repository: vscode
Issue: Search with non-standard encodings not supported
Labels: feature-request,upstream,search


![screenshot_20190208_122607](https://user-images.githubusercontent.com/444063/52475741-c1555b80-2b9c-11e9-8482-2b9b6387f5f4.png)
Issue Type: <b>Bug</b>

Set worskpace encoding to cp437.
Do a worskspace search for anything.

The search box is surrounded in red, a popup appears underneath it saying "Unknown encoding: cp437".

I had the same problem once and found I had to unset the option search.useRipgrep to have it working. That worked. But now, I have a warning on this preference that says "deprecated" and to use  pcre (which doesn't work).

That's a regression.

VS Code version: Code 1.31.0 (7c66f58312b48ed8ca4e387ebd9ffe9605332caa, 2019-02-06T08:51:24.856Z)
OS version: Linux x64 4.15.0-1032-oem

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 2874)|
|GPU Status|2d_canvas: enabled<br>checker_imaging: disabled_off<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>native_gpu_memory_buffers: disabled_software<br>rasterization: disabled_software<br>surface_synchronization: enabled_on<br>video_decode: unavailable_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|2, 3, 3|
|Memory (System)|15.39GB (1.47GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|

</details><details><summary>Extensions (20)</summary>

Extension|Author (truncated)|Version
---|---|---
project-manager|ale|10.3.2
quitcontrol-vscode|art|3.0.0
better-toml|bun|0.3.2
whitespace-plus|dav|0.0.5
mustache|daw|1.1.1
gitlens|eam|9.5.0
EditorConfig|Edi|0.12.8
githd|hui|2.1.0
rpm-spec|Lau|0.2.3
vscode-duplicate|mrm|1.2.1
indent-rainbow|ode|7.2.4
vscode-subword-navigation|ow|1.2.0
vscode-docker|Pet|0.5.2
rust|rus|0.5.3
whitespace|san|0.0.5
crates|ser|0.3.6
code-settings-sync|Sha|3.2.4
local-history|xyz|1.7.0
plsql-language|xyz|1.7.0
markdown-all-in-one|yzh|2.0.1


</details>
<!-- generated by issue reporter -->
Repository: godot
Issue: Should ARVRController method name match InputEvent nomenclature?
Labels: enhancement,discussion,topic:core,documentation

InputEvent uses "[device](http://docs.godotengine.org/en/3.0/classes/class_inputevent.html#member-variables)" property to let programmer know which input device emitted the event, but ARVRController uses [get_joystick_id()](http://docs.godotengine.org/en/3.0/classes/class_arvrcontroller.html#class-arvrcontroller-get-joystick-id) method to identify it.
It is a bit confusing know that they are the same ID stuff due to different name usage.
Or aren't they the same ID ?
Repository: pytorch
Issue: `nn.Linear` allows 1d input tensors
Labels: module: docs,triaged

## 🐛 Bug

The [docs](https://pytorch.org/docs/master/nn.html#torch.nn.Linear) for `nn.Linear` claim that the input has to be `[N, *, M]`, but it accepts `[M]` as well. This is because `nn.Linear` dispatches (via `functional.linear`) to `addmm` and `matmul`, which perform this kind of broadcasting. It's unclear if it's a bug or a feature, but certainly needs adapting either the code or the docs.

This report is a follow-up to my [answer](https://stackoverflow.com/q/54591124/4280242) on StackOverflow, which traces the root problem.

## To Reproduce
```python
import torch
import torch.nn as nn

n = 5
lin = nn.Linear(n, n)
inp = torch.randn(n)

print(lin(inp))
```

## Expected behavior

Error stating that 2d input was expected and 1d was received.

## Environment

PyTorch version: 1.0.0
Is debug build: No
CUDA used to build PyTorch: None

OS: Ubuntu 18.04.1 LTS
GCC version: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
CMake version: version 3.10.2

Python version: 3.6
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip] Could not collect
[conda] pytorch-cpu               1.0.0               py3.6_cpu_1    pytorch
[conda] torch-dimcheck            0.0.1                     <pip>
[conda] torchvision               0.2.1                     <pip>
[conda] torchvision-cpu           0.2.1                    py36_1    pytorch


cc @brianjo @mruberry
Repository: flutter
Issue: Camera stream image streams frame with wrong number of pixels 
Labels: c: new feature,p: camera,package,team-ecosystem,P2,triaged-ecosystem

CameraImage stream format should be `YUV420`  and 
```
(Y) plane[0].length= Y 
(U) plane[1].length = Y/4 
(V)  plane[2].length= Y/4 .
But it is streaming with 
(U) plane[1].length = Y/2 
(V) plane[2].length = Y/2 and Image format remains same(YUV420 ).
```
Repository: pytorch
Issue: Implement `numpy.random.choice` equivalent
Labels: high priority,module: bootcamp,feature,triaged,module: numpy

## 🚀 Feature
Implement `numpy.random.choice` equivalent.

## Motivation
In some cases, it is useful to get random samples from a torch Tensor efficiently. For instance, during the training of some Region-Based Detectors, it is necessary to control the proportion of positive and negative regions of interest (RoIs) over mini-batches. 

Here is a workaround adopted in maskrcnn-benchmark: https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/maskrcnn_benchmark/modeling/balanced_positive_negative_sampler.py#L49-L50, which can be inefficient if `positive.numel()` is big and `num_pos` is small, for instance.

## Pitch

Implement `torch.random.choice` to have an equivalent behavior to the numpy implementation.
Repository: TypeScript
Issue: Incorrect type for `ClassDecorator`
Labels: Suggestion,Experience Enhancement

The current (3.2.2) type for class decorator function seems to be incomplete:
```ts
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
```
It says that target should extend a Function, but it should be something like `NewableFunction` I guess, since its a class constructor and it can be passed to `new`.