sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Calling `borrow_mut` on a `Box`ed trait object and passing the result to a function can cause a spurious compile error
Labels: A-lifetimes,T-compiler,C-bug,T-types,A-trait-objects

This code does not compile:

```rust
use std::borrow::BorrowMut;

pub trait Trait {}
pub struct Struct {}
impl Trait for Struct {}

fn func(_: &mut Trait) {}

fn main() {
    let mut foo: Box<Trait> = Box::new(Struct{});
    func(foo.borrow_mut());
}
```

However, if you use `as` to be clear on what you expect `borrow_mut()` to return:

```rust
    func(foo.borrow_mut() as &mut Trait);
```

It will then compile.

This does not happen when the boxed type is a struct, only a trait. Simple assignments don't seem to trigger it either. (**Edit:** Forgot to add that this happens both on current stable and current nightly.)

Here is the output when compiling on the Playground:

```
   Compiling playground v0.0.1 (file:///playground)
error[E0597]: `foo` does not live long enough
  --> src/main.rs:11:10
   |
11 |     func(foo.borrow_mut());
   |          ^^^ borrowed value does not live long enough
12 | }
   | - `foo` dropped here while still borrowed
   |
   = note: values in a scope are dropped in the opposite order they are created

warning: variable does not need to be mutable
  --> src/main.rs:10:9
   |
10 |     let mut foo: Box<Trait> = Box::new(Struct{});
   |         ----^^^
   |         |
   |         help: remove this `mut`
   |
   = note: #[warn(unused_mut)] on by default

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.
```
Repository: pytorch
Issue: Only one thread is used on macOS (super slow on CPU)
Labels: triaged,module: macos,module: multithreading

## Issue description

Computations on my macbook's CPU are extremely slow.

`torch.get_num_threads()` always says 1, and `torch.set_num_threads(n)` has no effect.

I also tried building from source using the workaround described [here](https://github.com/pytorch/pytorch/issues/6328#issuecomment-383290539) in order to enable libomp support, but nothing changed.


## System Info
PyTorch version: 0.5.0a0+cf0c585
Is debug build: No
CUDA used to build PyTorch: None

OS: Mac OSX 10.13.4
GCC version: Could not collect
CMake version: version 3.11.0

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:
[pip3] numpy (1.14.3)
[pip3] torch (0.5.0a0+cf0c585)
[pip3] torchvision (0.2.1)
[conda] Could not collect
Repository: angular
Issue: Calling formGroup.updateValueAndValidity() does not update child controls that have `onUpdate` set to `'submit'`
Labels: type: bug/fix,freq1: low,area: forms,state: needs more investigation,P4

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
Calling formGroup.updateValueAndValidity() does not update child control and therefore form.value with data pending in child controls if child controls onUpdate is set to 'submit' .


## Expected behavior
The **formGroup.updateValueAndValidity()** should raise child validation and update values. What would also be acceptable is **formhooks** having a 'manual' value that if a control's **onUpdate** is set to this, **formGroup.updateValueAndValidity()** would update it. 

## Minimal reproduction of the problem with instructions
the demo has instructions
https://stackblitz.com/edit/angular-rx-validation-form-bug-demo

## What is the motivation / use case for changing the behavior?
calling **formGroup.updateValueAndValidity()** should mean that regardless of what **onUpdate** is, the child controls should be validated and updated.

## Environment
<pre><code>
Angular version: 5.2.0

Browser:
- [x ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
</code></pre>
Repository: vscode
Issue: Support syntax highlighting with tree-sitter
Labels: feature-request,languages-basic,tokenization

Please consider supporting [tree-sitter](https://github.com/tree-sitter/tree-sitter) grammars in addition to TextMate grammars. TextMate grammars are incredibly difficult to author and maintain and impossible to get right. The over 500 (!) issues reported against https://github.com/Microsoft/TypeScript-TmLanguage are a living proof of this.

This presentation explains the motivation and goals for tree-sitter: https://www.youtube.com/watch?v=a1rC79DHpmY

tree-sitter already ships with Atom and is also used on github.com.
Repository: go
Issue: x/build/maintner: growing files are not cleaned up
Labels: help wanted,Builders,NeedsFix

When the full file is downloaded, the corresponding growing file is not removed, so over time growing files accumulate. For example this is my cache directory at the moment:

```
[...]
0033.7b5b6f92e2eecdbfcfb06d7ed7a4f95f66092b2bb3693f41407bb546.mutlog
0034.435067e2842b0a7363a09a259e5aa1a2006787d95fae3a14a33b79b2.mutlog
0034.growing.mutlog
0035.f59248bfa6248f1cd081601c2d0331c97ecfd7807c3a4805d8fb65a8.mutlog
0035.growing.mutlog
0036.growing.mutlog
```

/cc @bradfitz
Repository: TypeScript
Issue: [SALSA] @callback's @param tags should not require names
Labels: Suggestion,Awaiting More Feedback,Domain: JavaScript

<!-- 🚨 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 `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  2.9.0-dev.20180518

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** 
`@callback` `@params` duplicate identifier error
**Code**

```js
/**
 * @callback ModuleSortPredicate
 * @param {Module} a
 * @param {Module} b
 * @returns {-1|0|1}
 */

/**
 * @callback ModuleFilterPredicate
 * @param {Module}
 * @param {Chunk}
 * @returns {boolean}
 */

/**
 * @callback ChunkFilterPredicate
 * @param {Chunk} c
 * @returns {boolean}
 */

```

**Expected behavior:**
No errors, or syntax highlighting errors.
**Actual behavior:**
```
lib/Chunk.js:44:18 - error TS1003: Identifier expected.
44  * @param {Chunk}
lib/Chunk.js:44:18 - error TS2300: Duplicate identifier '(Missing)'.
44  * @param {Chunk}
```
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> 

**Related Issues:** <!-- Did you find other bugs that looked similar? -->

Here is an image of it in action. I'm not sure if it is interaction with other things at the same time. I'm happy to pull information for you @sandersn. If you goto webpack/webpack#feature/type-compiler-compilation-save branch you can go to those lines of the code and test it as well.


![image](https://user-images.githubusercontent.com/3408176/40265228-3c7f5188-5ae9-11e8-9282-e8c36af1f9a3.png)
Repository: opencv
Issue: I hope 2 features could be added into opencv 4.0.
Labels: feature,category: ocl,RFC

1. Can set OpenCL device by thread in program. Like cuda::setDevice().
2. Adapt more functions for CUDA or OpenCL device, e.g. findHomography, findContours...
Repository: angular
Issue: [Feature] Allow to clear Service Worker cache
Labels: feature,area: service-worker,feature: under consideration

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
As a developer, I clear the cookies, data and relevant user information from the browser when the user logs out.
For privacy and security reasons and to avoid keeping relevant data in the browser's cache, I delete all the relevant data of the user from the cookies and localStorage.
However I cannot do the same from the service worker cache.


## Expected behavior
I'd like to be able to clear the Service Worker cache whenever a user logs out, to make sure no other user has access to the cache in any way.

This could be added as a function in the Service Worker provider.

## What is the motivation / use case for changing the behavior?

A problem is that if a user [bob] does log in with his/her user account after a logout from another user [alice], the cache of the Service Worker might answer with data from alice's requests, having a privacy problem here... The only difference between the requests is the access Token, and is set in the header, which is not taken in account when caching in the service worker. Thus a properly made request while being offline, would be able to answer the data from another user.

Another problem is that a user could access the cache from the browser web tools and check the contents of the cache, even after the user has logged out.


## Environment

<pre><code>
Angular version: 6.0.2
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- All
Repository: TypeScript
Issue: Wrong createElementNS() type definitions
Labels: Bug,Help Wanted,Domain: lib.d.ts

`Document.createElementNS()` allows to create a few nonexistent SVG elements. In particular, this function has signatures that allow creating `componentTransferFunction`, `textContent` and `textPositioning`, but these correspond to SVG interfaces which do not have any real element associated.

This can be easily verified by running:
```ts
document.createElementNS('http://www.w3.org/2000/svg', 'textContent') instanceof SVGTextElement; // false
document.createElementNS('http://www.w3.org/2000/svg', 'text') instanceof SVGTextElement; // true
```
(Note that [SVGTextElement](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextElement) implements [SVGTextContentElement](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement).)
Repository: rust
Issue: Bogus note with duplicate function names in --test / --bench mode and elsewhere.
Labels: A-diagnostics,T-compiler,C-bug

This file:

```
#[test]
pub fn test() { }

#[test]
pub fn test() { }
```

When run with `rustc --test`.

Produces this error:

```
error[E0428]: the name `test` is defined multiple times
 --> t.rs:5:1
  |
2 | pub fn test() { }
  | ------------- previous definition of the value `test` here
...
5 | pub fn test() { }
  | ^^^^^^^^^^^^^ `test` redefined here
  |
  = note: `test` must be defined only once in the value namespace of this module

error[E0252]: the name `test` is defined multiple times
  |
  = note: `test` must be defined only once in the value namespace of this module
help: You can use `as` to change the binding name of the import
  |
1 |  as other_test#[test]
  |  ^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors occurred: E0252, E0428.
For more information about an error, try `rustc --explain E0252`.
```

The note is producing bogus syntax, possibly from the reexport magic that makes testing work.

Tested on

```
rustc 1.26.0 (a77568041 2018-05-07)
rustc 1.27.0-beta.5 (84b5a46f8 2018-05-15)
rustc 1.27.0-nightly (2f2a11dfc 2018-05-16)
```
Repository: TypeScript
Issue: Suggestion: Allow interfaces to "implement" (vs extend) other interfaces
Labels: Suggestion,Awaiting More Feedback

## Search Terms

interface, implements

## Suggestion

Allow declaring that an interface "implements" another interface or interfaces, which means the compiler checks conformance, but unlike the "extends" clause, no members are inherited:

```
interface Foo {
  foo(): void;
}

interface Bar implements Foo {
  foo(): void; // must be present to satisfy type-checker
  bar(): void;
}
```

## Use Cases

It is very common for one interface to be an "extension" of another, but the "extends" keyword is not a universal way to make this fact explicit in code.  Because of structural typing, the fact that one interface is assignable to another is true with or without "extends," so you might say the "extends" keyword serves primarily to inherit members, and secondarily to document and enforce the relationship between the two types.  Inheriting members comes with a readability trade-off and is not always desirable, so it would be useful to be able to document and enforce the relationship between two interfaces without inheriting members.

Consider code such as:

```
import { GestureHandler } from './GestureHandler'
import { DropTarget } from './DropTarget'

export interface DragAndDropHandler extends GestureHandler {
  updateDropTarget(dropTarget: DropTaget): void;
}

function createDragAndDropHandler(/*...*/): DragAndDropHandler {
  //...
}
```

While this code is not bad, it is notable that DragAndDropHandler omits some of its members simply because it has a relationship with GestureHandler.  What are those members?  What if I would like to declare them explicitly, just as I would if GestureHandler didn't exist, or if DragAndDropHandler were a class that implemented GestureHandler?  I could write them in, but the compiler won't check that I have included all of them.  I could omit `extends GestureHandler`, but then the type-checking will happen where DragAndDropHandler is used as a GestureHandler, not where it is defined.

What I really want to do is be explicit about — _and have the compiler check_ — that I am specifying all members of this interface, and also that it conforms to GestureHandler.

I would like to be able to write:

```
export interface DragAndDropHandler implements GestureHandler {
  updateDropTarget(dropTarget: DropTaget): void;
  move(gestureInfo: GestureInfo): void
  finish(gestureInfo: GestureInfo, success: boolean): void
}
```

## Examples

See above

## 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. new expression-level syntax)
Repository: neovim
Issue: extended registers: associate more info with a register
Labels: enhancement

This might be a bit of a stretch, but would you consider making available certain information about the buffer the contents of a register were copied from, so that it may be retrieved at the time the buffer contents are pasted?

Use case: copy text from buffer a and paste it into new buffer b, and since there is no ft in buffer b, deduce ft from that of buffer a and apply it to buffer b?

I can understand if it's just not happening :)

Cheers!
Repository: rust
Issue: Highlighting still assumes a dark background
Labels: O-windows,A-diagnostics,T-compiler,C-bug,D-papercut

Like #7737.

![rustc_invisible_error](https://user-images.githubusercontent.com/1146478/40163521-4c634132-59b7-11e8-80b1-fce92add92fd.png)
I'm using Git's MINGW64 with a white background, and the error message is not visible at all. Using the verbose flag didn't show any further information but that `rustc` failed with exit code 101. It wasn't until I tried to copy the terminal output into a bug report that I realised there actually was some text.
```
   Compiling cortex-m-demo v0.1.0 (file:///C:/Users/…/cortex-m-quickstart)
error: language item required, but not found: `panic_fmt`

error: aborting due to previous error

error: Could not compile `cortex-m-demo`.

To learn more, run the command again with --verbose.
```
Repository: flutter
Issue: flutter doctor issue with symbolic links ?
Labels: tool,t: flutter doctor,P3,team-tool,triaged-tool

my /opt is linked to /data/opt and flutter doctor see 2 installations, which are the same path, and one is failing

my emulators shows up in flutter and not in android studio (which has plugin)


```
flutter doctor -v
[✓] Flutter (Channel beta, v0.3.2, on Linux, locale en_CA.UTF-8)
    • Flutter version 0.3.2 at /data/opt/flutter
    • Framework revision 44b7e7d3f4 (il y a 4 semaines), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /data/opt/android-sdk
    • Android NDK at /data/opt/android-sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /data/opt/android-sdk
    • Java binary at: /data/opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.1)
    • Android Studio at /data/opt/android-studio
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Android Studio
    • Android Studio at /opt/android-studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5556 • android-x86 • Android 8.1.0 (API 27) (emulator)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

```
Repository: TypeScript
Issue: Generics; ReturnType<Foo> != ReturnType<typeof foo>
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 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 `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  Version 2.9.0-dev.20180516

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** generic function returntype

I couldn't think of a good title for this,

**Code**

```ts
type Delegate<T> = () => T;

function executeGeneric<
    X,
    DelegateT extends Delegate<X> 
>(delegate: DelegateT): ReturnType<DelegateT> {
    //Type 'X' is not assignable to type 'ReturnType<DelegateT>'.
    const x: ReturnType<typeof delegate> = delegate();
    //Type 'X' is not assignable to type 'ReturnType<DelegateT>'.
    const y: ReturnType<DelegateT> = delegate();
    //Type 'X' is not assignable to type 'ReturnType<DelegateT>'.
    return delegate();
}
```

**Expected behavior:**

Return successfully.

Intuitively, to me,

1. `delegate` is of type`DelegateT`.
1. `ReturnType<DelegateT>` and `ReturnType<typeof delegate>` should be the same

However, 

**Actual behavior:**

`Type 'X' is not assignable to type 'ReturnType<DelegateT>'.`

**Playground Link:** [Here](http://www.typescriptlang.org/play/#src=type%20Delegate%3CT%3E%20%3D%20()%20%3D%3E%20T%3B%0D%0A%0D%0Afunction%20executeGeneric%3C%0D%0A%20%20%20%20X%2C%0D%0A%20%20%20%20DelegateT%20extends%20Delegate%3CX%3E%20%0D%0A%3E(delegate%3A%20DelegateT)%3A%20ReturnType%3CDelegateT%3E%20%7B%0D%0A%20%20%20%20%2F%2FType%20'X'%20is%20not%20assignable%20to%20type%20'ReturnType%3CDelegateT%3E'.%0D%0A%20%20%20%20const%20x%3A%20ReturnType%3Ctypeof%20delegate%3E%20%3D%20delegate()%3B%0D%0A%20%20%20%20%2F%2FType%20'X'%20is%20not%20assignable%20to%20type%20'ReturnType%3CDelegateT%3E'.%0D%0A%20%20%20%20const%20y%3A%20ReturnType%3CDelegateT%3E%20%3D%20delegate()%3B%0D%0A%20%20%20%20%2F%2FType%20'X'%20is%20not%20assignable%20to%20type%20'ReturnType%3CDelegateT%3E'.%0D%0A%20%20%20%20return%20delegate()%3B%0D%0A%7D)

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Repository: nvm
Issue: Add a new command nvm local which creates a .nvmrc in the cwd
Labels: feature requests

This is a simple feature request - add a new command nvm local <version> which creates a new .nvmrc file with the version provided.
Repository: godot
Issue: Scaled Controls don't align properly
Labels: bug,confirmed,topic:gui

**Godot version:** 3.0

**OS/device including version:**

**Issue description:**
Margins ignore the scale of the control.
The top-left corner is set as if the node was not scaled.

Scale: 1x1, Anchor: center right
![selezione_025](https://user-images.githubusercontent.com/33575693/40283718-055fa90a-5c83-11e8-839b-d2deba659c69.png)

Scale: 2x2, Anchor: center right (the transparent panel is also scaled 2x2, but the textureRect didn't align to it's center right)
![selezione_026](https://user-images.githubusercontent.com/33575693/40283742-55711b0e-5c83-11e8-86a5-5bacb5e62c01.png)

What was expected: (with Anchor: center left)
![selezione_028](https://user-images.githubusercontent.com/33575693/40283810-c30328a0-5c84-11e8-8952-2985e5345dc5.png)

**Steps to reproduce:**
Add a Control to a parent Control.
Change the child's scale.
Change the child's anchor from the Layout menu (to a layout different from top left).

**Minimal reproduction project:**
[align-scaled-issue.zip](https://github.com/godotengine/godot/files/2020719/align-scaled-issue.zip)
Repository: neovim
Issue: Numeric prefixes not always rehighlighted when arabicshape is off
Labels: bug,vimscript,syntax

- `nvim --version`: #8421, 60dae5a9efe6c8b928ebc278ac4aa9d87bafa660
- Vim (version: ) behaves differently? no such feature in Vim

### Steps to reproduce

```
# nvim -u NONE -i NONE --cmd 'set noarabicshape' --cmd 'syntax on'
i<C-r>=0x1F<BS>
```

### Actual behaviour

`0x` is highlighted the same before and after typing `1F`, but gets rehighlighted as numeric prefix once `<BS>` is typed.

### Expected behaviour

`0x` is highlighted as error before typing `1` and as numeric prefix after that event.