sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Confusing error message when trait is impl'd on &T and bounds are not satisfied
Labels: C-enhancement,A-diagnostics,T-compiler

Example code: https://play.rust-lang.org/?gist=6e7c1a4ad58c82717271ad4d5cef1181&version=stable

The form that I encountered was: 
```
error[E0277]: the trait bound `&Ident: std::cmp::PartialEq<str>` is not satisfied
  --> src/main.rs:22:18
   |
22 |         if ident.eq( "STRING" ) {
   |                  ^^ can't compare `&Ident` with `str`
   |
   = help: the trait `std::cmp::PartialEq<str>` is not implemented for `&Ident`
```

`syn::Ident` implements `PartialEq<T> where T: AsRef<str>` so I know I can compare `Ident` with a `str`.

My first reaction was confusion with `str`. It's so rare to see `str` alone that my first instinct was to ensure that what I have is `&str`. While still confused, I decided to throw an `&` in front of my parameter. To my surprise that fixed the error!

... but now I was even more confused. `ident.eq( &"Static string" )` looks a bit weird - and why would it even make a difference?

After a while I realized that my `ident` was a `ref` of `&Ident` - so essentially a double-borrowed `&&Ident`. But as Rust has auto-(de)ref for method calls, this shouldn't matter. I've had `&&&...Foo` types in the past by being overly eager with `&`'s and these have worked just fine without needing any manual `*`'s.

However I've now concluded that the problem here is the built-in `impl PartialEq<&B> for &A`.

With `let ident : &&Ident`, the `ident.eq(..)` gets resolved to:

```rust
impl<'a, 'b, A (&Ident), B = ?>PartialEq<&B> for &A
where A (&Ident) : PartialEq<B> {
    fn eq( &self, other: &B ) -> bool;
}
```
Where `B` ends up as `str` to make the `eq(..)` signature match `&str`. Thus the error.

In any case the biggest issue here is the "friendly" error message, I feel: `can't compare '&Ident' with 'str'`. Both types here seem wrong.

- On the right side as far as I can tell, `"STRING"` is `&str`, not `str`. 
- On the left side the type should be `&&Ident`, not an `&Ident`.

I guess the parameters are wrong, because Rust does one cycle of derefs. The original types are `&&Ident` and `&str`, but the impl above drops one `&` from each of these.

What purpose does the `PartialEq<&B> for &A` impl serve anyway? If that impl didn't exist, wouldn't rustc do derefs for `&&&A` until it found impl for `A`? Then it would deref the argument. Or is this unwanted behavior in this scenario - even if this is how the auto-deref works everywhere else? Or ~~am I missing~~ I am probably missing some other detail that prevents this from working.
Repository: pytorch
Issue: Make the generator tools data model more explicit
Labels: triaged,module: codegen

Right now, data is passed around in `gen.py` and similar scripts purely as JSON/YAML, with no schema well-defined at any point. This is bad for developers, who need to essentially reread all of the generator scripts to figure out how any given attribute is being used. Let's make it more explicit.  I propose a two pronged approach:

* Named tuples over dictionaries. By pre-declaring the data structures which we fill and pass around, we have an obvious point to hang documentation and format specification

* MyPy for tools only. By adding types, we can machine-check that our structure documentation is up-to-date. MyPy supports a comment syntax which is Python 2 compatible, and is completely optional so non-developers can easily run without any extra installation.
Repository: rust
Issue: Accessing private fields from the def site of a proc macro
Labels: T-compiler,A-macros-2.0,C-bug

Hi.
I'm not sure whether it is a bug or not, that may be an hygiene issue.
But, in the following [repository](https://github.com/antoyo/proc-macro-private-bug), if you run it with `cargo build`, you get the following error:
```
error[E0451]: field `my_field` of struct `MyStruct` is private
  --> src/main.rs:12:5
   |
12 |     pp!(MyStruct);
   |     ^^^^^^^^^^^^^^ field `my_field` is private
```
However, that does not make sense, because the field is declared in the [same module](https://github.com/antoyo/proc-macro-private-bug/blob/master/src/main.rs):
```
struct MyStruct {
    my_field: i32,
}

fn main() {
    pp!(MyStruct); // Error: field `my_field` of struct `MyStruct` is private.
}
```
This only happens when [this feature](https://github.com/antoyo/proc-macro-private-bug/blob/master/Cargo.toml#L10) is enabled.
What makes me think this might be an hygiene issue is that I hard-coded the field name [here](https://github.com/antoyo/proc-macro-private-bug/blob/master/pp/src/lib.rs#L16).
So, if it's a bug, please fix this issue.
Thank you.
Repository: rust
Issue: Compiler incorrectly reports function return type declaration as source of inner type mismatch with conservative_impl_trait
Labels: C-enhancement,A-diagnostics,T-compiler,A-impl-trait,D-confusing

Given a function specified as returning a composite type that incorrectly returns an object with an inner type mismatch, the compiler reports the error as being in the function return type declaration rather than at the point the incorrect item is returned.

A sample git repo can be found here: https://git.neosmart.net/mqudsi/futuretest/src/rust-46644

The code in question:

```rust
fn create_future() -> impl Future<Item=(), Error=()> {
    return future::ok(Ok(()));
}
```

The compiler returns the following;

```rust
   Compiling futuretest v0.1.0 (file:///mnt/d/GIT/futuretest)
error[E0271]: type mismatch resolving `<futures::FutureResult<std::result::Result<(), _>, ()> as futures::Future>::Item == ()`
  --> src/main.rs:17:23
   |
17 | fn create_future() -> impl Future<Item=(), Error=()> {
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
   |
   = note: expected type `std::result::Result<(), _>`
              found type `()`
   = note: the return type of a function must have a statically known size

error: aborting due to previous error

error: Could not compile `futuretest`.

To learn more, run the command again with --verbose.
```
Repository: rust
Issue: Unsatisfied bounds in case of earlier _inner_ type mismatch error
Labels: C-enhancement,A-diagnostics,T-compiler

In case of a type mismatch when chaining/mapping between a `FutureResult<x,y>` and `FutureResult<x,z>`, the compiler also emits (invalid) errors about unsatisfied bounds for any subsequent future operations, even though the type mismatch is only the inner type within the `FutureResult<_,_>` (i.e. in all cases the result of the operation is a future).

Here's an example ([git link](https://git.neosmart.net/mqudsi/futuretest/src/futures-rs-676)):

```rust
    let f = future::result::<(),()>(Ok(()))
        .map_err(|_| "&'static str error")
        .and_then(|_|
             future::result(Ok(())
                .map_err(|()| "String error".to_owned())
            )
        )
        .and_then(|_| future::result::<(), String>(Err("another &'static str error".to_owned())))
```

generating the following errors, the second of which is the point of this issue:

```rust
   Compiling futuretest v0.1.0 (file:///mnt/c/Users/Mahmoud/git/futuretest)
error[E0271]: type mismatch resolving `<futures::FutureResult<(), std::string::String> as futures::IntoFuture>::Error == &str`
  --> src/main.rs:12:10
   |
12 |         .and_then(|_|
   |          ^^^^^^^^ expected struct `std::string::String`, found &str
   |
   = note: expected type `std::string::String`
              found type `&str`

error[E0599]: no method named `and_then` found for type `futures::AndThen<futures::MapErr<futures::FutureResult<(), ()>, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]>` in the current scope
  --> src/main.rs:17:10
   |
17 |         .and_then(|_| future::result::<(), String>(Err("another &'static str error".to_owned())))
   |          ^^^^^^^^
   |
   = note: the method `and_then` exists but the following trait bounds were not satisfied:
           `futures::AndThen<futures::MapErr<futures::FutureResult<(), ()>, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]> : futures::Future`
           `&mut futures::AndThen<futures::MapErr<futures::FutureResult<(), ()>, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]> : futures::Future`

error: aborting due to 2 previous errors

error: Could not compile `futuretest`.

To learn more, run the command again with --verbose.
```

Resolving the type mismatch fixes the first error and makes the second error go away entirely.

As the trait is implemented regardless of the inner type, it should be possible for the compiler to detect that the second error is not real.
Repository: opencv
Issue: errors and warnings in Opencv 3.3.1 compiled by gcc 7.2  
Labels: category: build/install,incomplete

we cross-compile opencv 3.3.1 using gcc 7.2 , some warnings and errors occur:
the warning:
/home/njai/Downloads/gcc720/arm-buildroot-linux-uclibcgnueabihf/include/c++/7.2.0/bits/stl_algo.h:1940:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::ml::PairDI*, std::vector<cv::ml::PairDI> >’ changed in GCC 7.1
/home/njai/Downloads/gcc720/arm-buildroot-linux-uclibcgnueabihf/include/c++/7.2.0/bits/stl_algo.h:1940:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::ml::PairDI*, std::vector<cv::ml::PairDI> >’ changed in GCC 7.1
/home/njai/Downloads/gcc720/arm-buildroot-linux-uclibcgnueabihf/include/c++/7.2.0/bits/stl_algo.h:1954:25: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::ml::PairDI*, std::vector<cv::ml::PairDI> >’ changed in GCC 7.1
    std::__introsort_loop(__cut, __last, __depth_limit, __comp); 

the errors:
/home/njai/Downloads/opencv331/opencv-3.3.1/opencv-3.3.1/modules/ts/include/opencv2/ts/ts_gtest.h:10742:48: error: ‘wstring’ in namespace ‘std’ does not name a type
 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);

Maybe the error comes from the g++ configure or something else, I am not sure.  the warning seems coming from gcc 7.1(or above) change .
Repository: rust
Issue: Avoid O-notation for String operations
Labels: C-enhancement,T-libs-api,A-docs

A couple of places in the `String` docs states that an operation is `O(n)`, usually when discussing a method that needs to shift elements over. However, this is not helpful to users who do not know O-notation, and `n` is generally either misleading or undefined.

 [`String::insert_str`](https://doc.rust-lang.org/std/string/struct.String.html#method.insert_str): The operation is really `O(n-idx+k)`, where `n` is the length of `self`, and `k` is the length of `string`. In fact, that's not even true if the String needs to be resized. If we wanted to cover that, we'd need to include the "amortized" qualifier in there. `O(n)` is insufficient in part because if `k` is large and `n` is small, `k` is much more important. We probably want to ditch the O-notation here entirely, and just explain that it needs to shift everything after `idx` over, and copy in the characters from `string`, and that this operation may be slow because of it.

[`String::insert`](https://doc.rust-lang.org/std/string/struct.String.html#method.insert) and [`String::remove`](https://doc.rust-lang.org/std/string/struct.String.html#method.remove): These are less egregious since `O(n)` is correct. However, the smaller bound of `O(n-idx)` can be given, and the difference might be significant. Here too, it'd be better to just get rid of the O-notation altogether and explain what happens instead.
Repository: go
Issue: cmd/go: get should always send go-get parameter, even after redirects
Labels: NeedsFix

### What version of Go are you using (`go version`)?
`go version go1.9.2 linux/amd64`

### Does this issue reproduce with the latest release?
:white_check_mark: 

### What operating system and processor architecture are you using (`go env`)?
```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/terin/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build604286265=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
```

### What did you do?
Ran `go get -v -insecure example.org/pkg/foo` whilst "example.org" was directed to a local HTTP server (via host file).

### What did you expect to see?
Code downloaded from a VCS at $GOPATH/src/example.org/pkg/foo.

### What did you see instead?
```
Fetching https://example.org/pkg/foo?go-get=1
https fetch failed: Get https://example.org/pkg/foo?go-get=1: http: server gave HTTP response to HTTPS client
Fetching http://example.org/pkg/foo?go-get=1
Parsing meta tags from http://example.org/pkg/foo?go-get=1 (status code 500)
package example.org/pkg/foo: unrecognized import path "example.org/pkg/foo" (parse http://example.org/pkg/foo?go-get=1: no go-import meta tags ())
```

The behavior of the server is as follows:
* If the request method is not GET or HEAD, responds with a 405 Method Not Allowed
* If the request URL path does not end in a slash, it responds with a 301 Moved Permanently to the URL path with the slash appended
* If the request URL contains the query parameter "go-get=1", it responds with a basic HTTP page with the go-imports meta tag
* If the request URL does not contain the query parameter, it responds with a 303 See Other redirect to godoc.org

Due to an issue in the server's HTTP muxer implementation[^1], the query parameters during the 301 redirect are lost. `go get` dutifully follows the redirect, and as the request no longer contains the "go-get" parameter, it gets and follows the redirection to godoc.org, which responds with a 500 HTTP error.

This seems to be allowed behavior from the HTTP specification; the server should include the query parameters in the Location header to preserve semantics. However, I still found the behavior of `go get` surprising, both that it will sends requests without the "go-get" query parameter, and that it silently follows redirects off the import path domain.

I propose change the behavior of `go get` to always include the "go-get" query parameter, even after redirects, and to log the redirections when the "-v" flag is provided.

---
[^1]: Fortunately, it looks like that HTTP muxer is getting fixed sometime soon [CL#61210](https://go-review.googlesource.com/c/go/+/61210). Now that this author knows about it, he can work around it.
Repository: react
Issue: React does not call onBlur callback
Labels: Type: Bug,Component: DOM

**Do you want to request a *feature* or report a *bug*?**
**Bug**

**What is the current behavior?**
When input control becomes disabled, React does not call onBlur callback

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal https://jsfiddle.net/c22pez5z/

**What is the expected behavior?**
1. Focus on input element
2. Press Enter button (it makes input disabled)
3. `Blur counter` and `Native blur counter` should be equal.
Repository: puppeteer
Issue: fullPage screenshot duplicates page (doubles/tripples page length)
Labels: bug,upstream,chromium,confirmed,P3

So I'm having a weird problem with certain websites that I am trying to screenshoot. Essentially the page is shot and then replicated a number of times down in the png to make a really long screenshot that contains all these replications. Its like somebody copy pasted the page a couple of times onto the bottom of the original.

I have not been able to figure out which sites cause it, but the example below is an example- I can supply more if needed.

### Steps to reproduce

**Tell us about your environment:**

* Puppeteer version: 0.13.0
* Platform / OS version: Ubuntu 17.04
* URLs (if applicable): https://bonobos.com/shop/tops

**What steps will reproduce the problem?**

Sample code with fullPage=True, i.e:
```
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://bonobos.com/shop/tops');
  await page.screenshot({path: 'example.png', fullPage: true});

  await browser.close();
})();
```

**What is the expected result?**
A pull page screenshot- not just the visible part

**What happens instead?**
A very long image that contains multiple copies of the full page screenshot.

<details>

![example](https://user-images.githubusercontent.com/2863673/33840312-6e5752d4-de8c-11e7-8be1-ea655c18e664.png)
Don't think the example will be visible, but worth a shot.

</details>
Repository: rust
Issue: missing_debug_implementations lint is ignored for extern_types
Labels: A-lints,C-bug,F-extern_types

```Rust
#![feature(extern_types)]

#![warn(missing_debug_implementations)]

pub enum Foo {}
extern "C" {
    pub type Bar;
}

```

`Foo` gets a warning, but `Bar` doesn't:
```
warning: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
 --> foo.rs:5:1
  |
5 | pub enum Foo {}
  | ^^^^^^^^^^^^^^^
  |
note: lint level defined here
 --> foo.rs:3:9
  |
3 | #![warn(missing_debug_implementations)]
  |  
```
Repository: TypeScript
Issue: Unable to destructure TypedArrays
Labels: Suggestion,Committed

**TypeScript Version:**  2.6.2

**Code**
```ts
const [ foo, bar ] = new Float64Array([42, -42])
```

**Expected behavior:**
`foo` and `bar` are destructured correctly
All JS engine with support for TypedArrays and destructuring handles this code without any problem

**Actual behavior:**
Error:` error TS2461: Type 'Float64Array' is not an array type.`
Repository: pytorch
Issue: Use the int64 version of MKL calls
Labels: module: internals,triaged,module: mkl

then if MKL is present, we can ~~remove~~ avoid the inefficient code in https://github.com/pytorch/pytorch/blob/master/aten/src/TH/generic/THBlas.c .

cc @ezyang @bhosmer @smessmer @ljk53
Repository: vscode
Issue: Minimap Enhancement: Show Preview Tooltip
Labels: feature-request,editor-minimap

Using VS Code 1.18.1
[This is an idea for a new feature, not an issue]

Visual Studio's enhanced scrollbar allows you to hover the minimap and get a full sized preview of the 7-8 lines under your cursor. I would love to see this feature added to the minimap in VS Code. Or perhaps, as some others have suggested, an API for the minimap so extension developers could add this functionality.

Thanks!

Here's what it looks like in VS2017.

![image](https://user-images.githubusercontent.com/811177/33853611-c3053ac8-de7b-11e7-8f91-2563f3985f01.png)
Repository: rust
Issue: allow "NO NOTE" annotations, stop requiring NOTE annotations to be exhaustive
Labels: A-testsuite,E-hard,C-enhancement,T-bootstrap,A-contributor-roadblock,A-compiletest,E-needs-design

From https://github.com/rust-lang/rust/pull/46641:

I've been very much enjoying the fact that UI tests check for ERRORs. I like being able to add minimal annotations to the test that give the kind of "overall parameters" for what the test is testing (that errors occur here, here, and here) and then having the stderr files capture the full behavior.

But there are times when I want to document a subset of the NOTEs that are present. i.e., so that I can outline "other variations in the stderr output may be acceptable, but if this NOTE disappears, that's a big problem". Note that I say subset -- often there are many notes, but it's just one piece I want to guarantee is present.

Before, we required that if you document any note, you must document all notes. The result is that it discourages me from annotating these notes that I want to be present.

(On the other hand, if you can't declare that the set of notes is exhaustive, you can't document that a note should not appear. I don't find this to be something I want to document very often, but it's certainly possible. But we could easily have a "NO_NOTE" annotation or something then.)

What I do for now is to leave comments, but I fear that future people will not read them.

cc @oli-obk @petrochenkov @estebank
Repository: go
Issue: go/types: support cgo semantics
Labels: NeedsInvestigation,FeatureRequest

I was thinking about https://github.com/golang/go/issues/975.
My idea is guessing argument types and making specialized wrappers.
For example, 
We can convert following code
```
package main

// #include <stdio.h>
import "C"

func main() {
	C.printf(C.CString("hello: %d"), 10)
	C.fflush(C.stdout)
}
```
into
```
package main

// #include <stdio.h>
// int call_printf_with_int(const char* s, int i) {
//   return printf(s, i);
// }
import "C"

func main() {
	C.call_printf_with_int(C.CString("hello: %d"), 10)
	C.fflush(C.stdout)
}
```

I'd like to leave these translations to cgo.

To promote this idea, we have to make `go/types` understand some special cgo semantics.

* all cgo objects are exportable even if the first letter is lower case (e.g. `C.char`, `C.int`, ...)
* cgo functions behave like `unsafe.Pointer` in the expression context (e.g. `var xxx unsafe.Pointer = C.puts`)
* cgo functions can return the optional `error` argument in the assignment context (e.g `_, err := C.puts(C.CString("x"))`

Is this acceptable?

FWIW, https://go-review.googlesource.com/c/go/+/83215 is the attempt.
Repository: godot
Issue: Changing node parent produces Area2D/3D signal duplicates
Labels: bug,confirmed,topic:physics

Godot 2.1.4, Godot 3.0 beta 1
Windows 10 64 bits

I found that if you teleport-away and reparent a node which is inside an Area2D, you will get an `area_exit`, but ALSO extras notifications `body_enter` and `body_exit`, two in my case, even though the object is not anymore in the area.

This gave me headaches for several hours in my game until I narrow it down to this, because this behavior causes my teleport system to trigger everything multiple times, and I can't find a way to avoid this so far without atrocious hacks...
It does this wether I teleport from `fixed_process` or not, and emptying layer/collision masks before teleport has no effect.

Here is a demo project reproducing it:
2.1.4: [TeleportArea2D.zip](https://github.com/godotengine/godot/files/1549727/TeleportArea2D.zip)
3.0b1: [TeleportArea2D_Godot3b1.zip](https://github.com/godotengine/godot/files/1549767/TeleportArea2D_Godot3b1.zip)

Repro:
1) Launch main scene, notice you get one `body_enter` because the body overlaps with the area, wich is expected
2) Press any key, this teleports the body and reparents it (in code, the node is removed from tree, translated, and then added to the tree)
3) Notice you get an expected `body_exit`, but also two unexpected pairs of `body_enter` and `body_exit`