sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: `where Self: Sized` on trait method doesn't work as expected when implementing for unsized types.
Labels: A-type-system,A-trait-system,T-lang,T-compiler,C-bug,T-types

I've got this code
````
trait Foo {
    fn bar(&self) -> Self where Self: Sized;
}

impl Foo for str {
//    fn bar(&self) -> Self { unimplemented!() }
}
````
the error is:
````
error[E0046]: not all trait items implemented, missing: `bar`
 --> src/lib.rs:5:1
````

However, since `str` is not `Sized`, i don't think `bar`  needs to be implemented. if i remove the "//", i'll got:
````
error[E0277]: the size for values of type `str` cannot be known at compilation time
 --> src/lib.rs:6:22
````
So although this trait fits object safety rules, i still can't implement it for unsized types.
Repository: pytorch
Issue: Python-bound C++ frontend modules don't handle attributes well
Labels: module: cpp,triaged

When we bind C++ frontend modules into Python using `torch::python::bind_module` and load them in Python, we wrap the underlying C++ class with a [wrapper class](https://github.com/pytorch/pytorch/blob/master/torch/nn/cpp.py#L49) that derives from `torch.nn.Module` and copies all methods of the underlying class onto the wrapper class (I can elaborate on design reasons for this).

The issue is that this does not support attributes. As in, if you bind an attribute in C++ using `def_readwrite("x", &MyClass::x)`, and try setting that attribute on the Python wrapper, it will not propagate. This should be handled by intelligently overriding `__getattr__` and `__setattr__`.

CC @yf225 

cc @yf225 @glaringlee
Repository: rust
Issue: Compiler unable to apply trait bound
Labels: A-type-system,A-trait-system,A-associated-items,T-compiler,T-types

Sorry for the vague title, please change. I have found a strange bug that is at the intersection of associated types, trait type parameters, and method type parameters. 

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=8584b2c75acb51a8c6082b668649ad29

```
trait Example {
    type Foo;
    
    fn foo<T: AsRef<Self::Foo>>(&self, t: T);
}

impl <A, B> Example for (A, B) where
    A: Iterator<Item = u32>,
    B: AsRef<A::Item>,
{
    type Foo = ();
    
    fn foo<T: AsRef<Self::Foo>>(&self, t: T) {}

}

   Compiling playground v0.0.1 (/playground)
error[E0277]: the trait bound `B: std::convert::AsRef<u32>` is not satisfied
  --> src/main.rs:14:5
   |
14 |     fn foo<T: AsRef<Self::Foo>>(&self, t: T) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::AsRef<u32>` is not implemented for `B`
   |
   = help: consider adding a `where B: std::convert::AsRef<u32>` bound
   = note: required because of the requirements on the impl of `Example` for `(A, B)`

error[E0277]: the trait bound `T: std::convert::AsRef<()>` is not satisfied
  --> src/main.rs:14:5
   |
14 |     fn foo<T: AsRef<Self::Foo>>(&self, t: T) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::AsRef<()>` is not implemented for `T`
   |
   = help: consider adding a `where T: std::convert::AsRef<()>` bound
   = note: required by `std::convert::AsRef`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `playground`.
```

Commenting out line 10 `B: AsRef<A::Item>` makes the program compile, or changing it to `B: AsRef<u32>` makes it compile (even though `A::Item` is a `u32`).
Repository: TypeScript
Issue: Preferred refactorings
Labels: Suggestion,In Discussion,VS Code Priority

**Problems**
- Refactorings such as `extract function` and `extract constant` may return multiple possible locations where the code could be extracted to. In many cases however, the user would just like to quick extract something to a reliable location and continue on. 

- `extract function` is always returned alongside `extract constant`. However it is often desirable to extract to a constant instead of a function when possible.

**Proposal**
In the TS Server protocol, mark some refactoring as a `preferred` refactorings. Editors could use this information to automatically select the preferred refactoring in the list or even quick apply it without any user input (see https://github.com/Microsoft/vscode/issues/62110 for VS Code's proposal on this)

Preferred refactorings would let users set up actions such as `extract constant` that reliably extract to the nearest scope with a single action or keyboard shortcut. The UX behavior for this type of action:

- If only a single `isPreferred` refactoring is returned, apply it automatically.

- If multiple preferred refactorings are returned, show a list of the preferred refactorings that the user can select from

The normal refactor context menu with full list of refactorings would continue to display the full list of refactorings.

We can start conservative with which refactorings are preferred:

- For `extract constant`, extract to local const
- For `extract function`, extract to function at the scope of the parent function
- For `extract function` in a method, extract to a method


Related to a similar proposal for quick fixes #29450
Repository: vscode
Issue: Unifying "do X on save" functionality
Labels: feature-request,formatting,under-discussion

**Problem**
VS Code ships with multiple actions that can be triggered on save, including:

- Trim trailing whitespace
- Trim trailing new line
- format document
- code actions (such as `organize imports` and `fix all`)

Each of these actions currently has its own setting. Many of the setting names are generic so it may not be clear they apply on save. 

**Goals**
- Make it easier to discover built-in `do X on save` actions
- Give these settings a more consistent names 
- Potentially allow these actions to be used in a more flexible way (such as from the source action menu)

/cc @kieferrm
Repository: godot
Issue: area_entered, area_exited occurs at the same time with Area2D
Labels: enhancement,topic:physics

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if non-official. -->
3.1.beta 973b68f39

**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
Kubuntu 18.10

**Issue description:**
<!-- What happened, and what was expected. -->
`area_entered` and `area_exited` signal is propagated at the same time when setting `Area.monitoring = true [or false]`
only `area_entered` is expected when setting `Area.monitoring = true` and
only `area_exited` is expected when setting `Area.monitoring = false`

probably related to #22889

**Steps to reproduce:**
```gdscript
extends Node2D

func _ready():
	$on.connect("pressed", self, "monitor_on")
	$off.connect("pressed", self, "monitor_off")
	
	$area_ray.connect("area_entered", self, "on_area_entered")
	$area_ray.connect("area_exited", self, "on_area_exited")

func monitor_on():
	$area_box.monitoring = true

func monitor_off():
	$area_box.monitoring = false

func on_area_entered(area):
	printt("on_area_entered", area.name)

func on_area_exited(area):
	printt("on_area_exited", area.name)
```

![area_enter_exit](https://user-images.githubusercontent.com/8281454/51780680-c3a6c700-2153-11e9-8b64-97f4d97b4179.gif)


**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
[area monitor.zip](https://github.com/godotengine/godot/files/2798427/area.monitor.zip)
Repository: vue
Issue: Types of FunctionalComponentOptions breaks
Labels: typescript,has workaround

### Version

vue: 2.5.22

typescript: 3.2.4

### Reproduction link
[https://jsfiddle.net/meteorlxy/9x2ts16a/1/](https://jsfiddle.net/meteorlxy/9x2ts16a/1/)


### Steps to reproduce

```ts
// works with vue 2.5.17
// fails with vue 2.5.18+
import Vue, { FunctionalComponentOptions } from 'vue'

const testFunctionalOptions: FunctionalComponentOptions = {
  functional: true,
}

Vue.component('Test', testFunctionalOptions)
```

### What is expected?
No types error as in v2.5.17

### What is actually happening?
```sh
error TS2345: Argument of type 'FunctionalComponentOptions<Record<string, any>, PropsDefinition<Record<string, any>>>' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>>'.
  Types of property 'render' are incompatible.
    Type '(this: undefined, createElement: CreateElement, context: RenderContext<Record<string, any>>) => VNode | VNode[]' is not assignable to type '(createElement: CreateElement, hack: RenderContext<Record<string,
any>>) => VNode'.
      Type 'VNode | VNode[]' is not assignable to type 'VNode'.
        Type 'VNode[]' is missing the following properties from type 'VNode': isRootInsert, isComment
```

### PS

It seems to be introduced here:

https://github.com/vuejs/vue/commit/bf2e2ed159f680cd4e230427ce94739c657c1b61#diff-23d7799dcc9e9be419d28a15348b0d99R116

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: create-react-app
Issue: Setting a minimum font size in Firefox makes code sections on the website unreadable
Labels: tag: documentation

I would like to report an accessibility issue on the website.

I have a minimum font size set to 15 in Firefox preferences. Most of the website looks okay, except for those animated code sections, e.g. https://facebook.github.io/create-react-app/docs/getting-started

<img width="1552" alt="screen shot 2019-01-26 at 11 36 16" src="https://user-images.githubusercontent.com/2944963/51785397-b5f73e80-215f-11e9-960d-d791cf9c8151.png">
Repository: pytorch
Issue: error with nccl when distributed training on caffe2
Labels: caffe2

The error as follow,I do build caffe2 with flag USE_NCCL=1

WARNING:caffe2.python.workspace:Original python traceback for operator `268` in network `resnet50_init` in exception above (most recent call last):
WARNING:caffe2.python.workspace:  File "resnet50_trainer.py", line 603, in <module>
WARNING:caffe2.python.workspace:  File "resnet50_trainer.py", line 599, in main
WARNING:caffe2.python.workspace:  File "resnet50_trainer.py", line 434, in Train
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 296, in Parallelize
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 1206, in _AllReduceBlobs
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 1370, in _AllReduceBlobsDistributed
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 1337, in allreduce
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 1287, in get_control_and_context
WARNING:caffe2.python.workspace:  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/data_parallel_model.py", line 1805, in _CreateOrCloneCommonWorld
Traceback (most recent call last):
  File "resnet50_trainer.py", line 603, in <module>
    main()
  File "resnet50_trainer.py", line 599, in main
    Train(args)
  File "resnet50_trainer.py", line 439, in Train
    workspace.RunNetOnce(train_model.param_init_net)
  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/workspace.py", line 200, in RunNetOnce
    StringifyProto(net),
  File "/root/miniconda2/lib/python2.7/site-packages/caffe2/python/workspace.py", line 179, in CallWithExceptionIntercept
    return func(*args, **kwargs)
RuntimeError: [enforce fail at no_default_engine_op.h:29] . The operator CreateCommonWorld does not have a default engine implementation. Please specify an engine explicitly for this operator. Error from operator: 
input: "store_handler" output: "allreduce_0_cw" name: "allreduce_0_cw_op" type: "CreateCommonWorld" arg { name: "interface" s: "" } arg { name: "timeout_ms" i: 30000 } arg { name: "transport" s: "tcp" } arg { name: "rank" i: 0 } arg { name: "size" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "NCCL"
Repository: pytorch
Issue: error on cmake_version from tools/build_pytorch_libs.py
Labels: module: build,triaged

## 🐛 Bug

<!-- -->
Cannot  build pytorch due to a error on  cmake_version from the file tools/build_pytorch_libs.py .

## To Reproduce
1. clone repository
2. python setup.py bdist_wheel
3. Error message:
```bash
 python setup.py  bdist_wheel
Building wheel torch-1.1.0a0+41e9b09
-- Building version 1.1.0a0+41e9b09
Traceback (most recent call last):
  File "setup.py", line 722, in <module>
    build_deps()
  File "setup.py", line 280, in build_deps
    build_dir='build')
  File "/data/pytorch/pytorch/tools/build_pytorch_libs.py", line 247, in build_caffe2
    build_dir)
  File "/data/pytorch/pytorch/tools/build_pytorch_libs.py", line 97, in run_cmake
    get_cmake_command(),
  File "/data/pytorch/pytorch/tools/build_pytorch_libs.py", line 54, in get_cmake_command
    bare_version = cmake_version(cmake)
  File "/data/pytorch/pytorch/tools/build_pytorch_libs.py", line 39, in cmake_version
TypeError: a bytes-like object is required, not 'str'
```
## Expected behavior
To configure and build pytorch
## Environment
``` bash
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A

OS: Fedora release 29 (Twenty Nine)
GCC version: (GCC) 7.4.0
CMake version: version 3.12.1

Python version: 3.7
Is CUDA available: N/A
CUDA runtime version: 10.0.130
GPU models and configuration: GPU 0: GeForce GTX 1080
Nvidia driver version: 415.27
cuDNN version: Probably one of the following:
/usr/local/cuda-10.0/lib64/libcudnn.so.7.4.1
```
## Additional context
 Wrapping the result of the check_output function in a `str`  fix the problem. At least on
python 3.7 the result of check_output is of type `bytes` not  `str`.
<!-- Add any other context about the problem here. -->
Repository: electron
Issue: Autoupdater - progress and download choice
Labels: enhancement :sparkles:

**What I did**

I have packaged my electron app with __electron-packager__ and build its installer with __electron-winstaller__. 
I used __autoUpdater__ (from electron) for the update process.

So I got:
*RELEASES
*myapp.exe-1.0.0-full.nupkg
*myappinstaller.exe

I put them in a github release with tag: v1.0.0
Then I did the same with v2.0.0 and the v1.0.0 app updated automatically to v2.0.0 on the next restart.

**The problem and the feature requested**

Altough it worked, I find that it would be useful to have an event in wich we can find the downloading progress to show to the users. Electron apps are indeed quite heavy and take a lot of time to be downloaded. 

In addition, updates are downloaded soon after a new version is found. The problem is that the user does not have a chance to discard the update if he wants to stay with the old version.

**Alternatives**

There is a third part package, __electron-updater__ wich is very powerful and allows to be notified of the download progress and to choose when install the update or wheter install it.
Its only problem is that it works with __electron-builder__ and it does not match my case, because I'm using **electron-winstaller**
Repository: go
Issue: math/big: Mention sign inversion in the (*Int).Not documentation
Labels: Documentation,NeedsInvestigation

I would expect that this:

```go
i = big.NewInt(-2)
log.Println(new(big.Int).Not(i).Text(2))
```

prints `-1`, but actually it prints `1`. The `(*Int).Not` documentation simply says:

> Not sets z = ^x and returns z.

I think that it's not obvious from this sentence that the sign is inverted.
Repository: TypeScript
Issue: Issues trying to auto-import across project boundaries 
Labels: Suggestion,In Discussion

<!-- 🚨 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:**  3.2.2, 3.3.0-rc

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** autoimport, project references, autocomplete

**Code**
Full minimal repro: https://github.com/MLoughry/typescript-repro

See _src/a/lib/index.ts_
```typescript
// If another file in the project already has an import from the other project,
//   then attempting to auto-import `bar` will prompt you to import from 'obj/b/lib'
// If no other import is found within the project, no auto-import suggestions are found
console.log(bar);
```

**Expected behavior:**
Auto-import should work across project boundaries when an `outDir` is specified (with or without `paths` specified in `tsconfig.json`)

**Actual behavior:**
* **If there is already a cross-project import within the project**: The auto-import attempts to import from the outDir.
![image](https://user-images.githubusercontent.com/20823465/51791587-46cb1b80-215a-11e9-9fde-cea50bb335de.png)
* **If there is no other cross-project import within the project**: No import suggestions are found.
![image](https://user-images.githubusercontent.com/20823465/51791581-35820f00-215a-11e9-9829-ab78323a4942.png)
Repository: rust
Issue: Implementing a trait for an associated type causes 'overflow evaluating the requirement' error
Labels: A-type-system,A-trait-system,A-associated-items,T-lang,T-compiler,C-bug,T-types

Implementing a trait for an associated type of something that implements the same trait causes the compiler to emit an overflow evaluating the requirement  error. I read the error explanation and it makes reference to trait bounds causing an endless list of things to check, it's not clear to me why this case would produce that. 

```
trait Convertable {
    type ResultType;
}

trait SomethingElse {}

struct A {}

struct B {}

struct C {}

impl Convertable for A {
    type ResultType = B;
}

// The addition of the following causes a compiler error[E0275]: overflow evaluating the requirement `<A as Convertable>::ResultType`:
impl Convertable for <A as Convertable>::ResultType {
    type ResultType = C;
}

// Implementing any other trait for the associated type works fine with no errors.
impl SomethingElse for <A as Convertable>::ResultType {}
```

I  expected to see this happen:
No compiler errors and the `Convertable` trait implemented for B as the following:
```
// What I wanted to happen.
impl Convertable for B {
    type ResultType = C;
}
```
Instead, this happened:
```
error[E0275]: overflow evaluating the requirement `<A as Convertable>::ResultType`

error: aborting due to previous error
```

## Meta
```
rustc --version --verbose
rustc 1.32.0 (9fda7c223 2019-01-16)
binary: rustc
commit-hash: 9fda7c2237db910e41d6a712e9a2139b352e558b
commit-date: 2019-01-16
host: x86_64-apple-darwin
release: 1.32.0
LLVM version: 8.0
```
Repository: godot
Issue: Convert To Mesh Library "Merge with existing" option causes confusion
Labels: enhancement,topic:editor,usability

**Godot version:** v3.1.beta2.official

![mergewithexisting](https://user-images.githubusercontent.com/15337628/51793672-15b12080-2218-11e9-922d-29f97f7278db.png)

-The "Merge with Existing" text and "ON" are so far apart that the option was invisible to me and it doesn't register in your mind as something important. This is definitely a new-user-experience issue as anyone experienced will know that it's there after they've noticed it once.
-It defaults to ON, which goes against common sense of how saving files usually works. Anyone would expect their files to normally overwrite when they save a file in Windows.
-When you save over a mesh library file with the setting on it still asks "File Exists, Overwrite?" but it should ask "Merge?". This is a very important thing to implement I think, as it would have helped me realize that I need to look for the "Merge with existing" option.
-It doesn't remember the OFF setting if you close Godot.

This has been a headache, call me blind if you wish but it took me days to even realize this option existed. I thought it was a bug with Godot that it wouldn't let me overwrite meshlib files. I had unwanted entries in my Gridmap that I was unable to remove, I was deleting the meshlib file and saving a new one in order to get around this issue, haha.

I also found a second person who most likely had the same issue: https://godotengine.org/qa/30146/problems-with-blender-export-godot-import-meshlib-gridmap?show=30146
"The only thing that seems to work is exporting the meshlib with a different name each time."
Repository: rust
Issue: [Universes] Indirection allows calling of invalid trait method
Labels: A-lifetimes,A-trait-system,E-needs-test,T-compiler,T-types

The following code has different behaviour depending on whether the associated function is called directly or through a method call. For example:

```rust
trait X {
    type G;
    fn make_g() -> Self::G;
}

impl<'a> X for fn(&'a ()) {
    type G = &'a ();

    fn make_g() -> Self::G {
        &()
    }
}

fn indirect<T: X>() {
    let x = T::make_g();
}

fn call_indirect() {
    indirect::<fn(&())>(); // OK
}

fn direct() {
    let x = <fn(&())>::make_g(); //~ ERROR
}
```

cc @nikomatsakis
Repository: vscode
Issue: [json] jsonValidation fileMatch is confusing when used with URIs
Labels: bug,json,debt

- VSCode Version: 1.30.2
- OS Version: macOS 10.14.3

Steps to Reproduce:

1. Create an extension that [registers a text document content provider](https://code.visualstudio.com/api/references/vscode-api#2290) for a custom scheme, say `custom`.  Implement the provider to return a json object as text.
2. Declare a jsonValidation in package.json with a `fileMatch` of `custom://*.todo`.
3. [Open](https://code.visualstudio.com/api/references/vscode-api#2246) a text document for a uri under that custom scheme with path ending in something.todo, and also a defined query or fragment [1], then [set text document language](https://code.visualstudio.com/api/references/vscode-api#2319) to 'json', and [show it](https://code.visualstudio.com/api/references/vscode-api#2074).
4. Expect the json schema validation to occur on the virtual file.
5. Note that it does not.

It appears the `fileMatch` matches on the entire uri, including the query and the fragment!  You can verify this by changing the `fileMatch` to `custom://*.todo?*`

It should probably only match on the path.

[1] e.g. `custom:/path/to/something.todo?foo`