sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Step::steps_between does not distinguish overflow and unimplemented (unstable)
Labels: C-enhancement,T-libs-api

It returns `Option<size>`: https://doc.rust-lang.org/std/iter/trait.Step.html#tymethod.steps_between

And the comment says it uses `None` for overflow: https://doc.rust-lang.org/src/core/iter/range.rs.html#29

But it also uses `None` for unimplemented https://doc.rust-lang.org/src/core/iter/range.rs.html#155

And as a result, `Range` needs to return `(0, None)` when it gets `None`: https://doc.rust-lang.org/src/core/iter/range.rs.html#235-240

It would be nice to either
- Require that the method is implemented accurately (easy for fundamental integers; harder if `Step` is expected to support graph walks, but maybe not harder than `PartialOrd`)
- Change the type to something else, maybe `Option<Option<usize>>` or be more hint-like with `(usize, Option<usize>)`
- Something else

cc https://github.com/rust-lang/rust/issues/42168
Repository: TypeScript
Issue: auto import always uses relative (to the current file) module paths in presense of baseUri
Labels: Suggestion,Awaiting More Feedback

back in a day it used to be different
- at first it was always an absolute path (that is without "./" or "../" in it) relative to the `baseUri`
- then starting at some point it began to always show a popup with 2 options: absolute or relavive
- now (since like a week ago or so) it just always uses a relative path with "./" and "../" to the current file no matter what, without asking, which is very frustrating and annoying


how can i get the auto import to use absolute paths like it was back in the day?
Repository: godot
Issue: [Bullet] Performance monitor for 3D physics not working for Bullet
Labels: bug,topic:editor,confirmed,topic:physics,topic:3d

**Godot version:**
v3.0-stable_x11.64

**Issue description:**
Performance monitor for 3D physics not working for Bullet, all values are 0. This issue was mentioned earlier here, among other issues: https://github.com/godotengine/godot/issues/15975

**Steps to reproduce:**
Run attached project. Monitor values are shown in window title. Cube will fall on surface and sleeping is disabled, so there should be 1 active object/collision pair/island. Run with GodotPhysics to see correct values.

**Minimal reproduction project:**
[BUgTest.zip](https://github.com/godotengine/godot/files/1713657/BUgTest.zip)
Repository: go
Issue: x/tools/go/ast/astutil: Apply: extraneous comma after replaced parameter
Labels: Tools

Not sure if this is a bug in `astutil.Apply` or `format.Node`. 
This function:
```
func applyBug() {
    src := `                                                                                                                                                                                                                                  
package p                                                                                                                                                                                                                                     
import foo "bar"                                                                                                                                                                                                                              
func f(x foo.t) {}                                                                                                                                                                                                                            
`
    fset := token.NewFileSet()
    file, err := parser.ParseFile(fset, "", src, 0)
    if err != nil {
        panic(err)
    }
    pre := func(c *astutil.Cursor) bool {
        if sel, ok := c.Node().(*ast.SelectorExpr); ok {
            if id, ok := sel.X.(*ast.Ident); ok && id.Obj == nil && id.Name == "foo" {
                c.Replace(&ast.Ident{Name: "foo_t"})
            }
        }
        return true
    }
    astutil.Apply(file, pre, nil)
    var buf bytes.Buffer
    if err := format.Node(&buf, fset, file); err != nil {
        panic(err)
    }
    fmt.Println(buf.String())
}
```
yields this output:
```
package p

import foo "bar"

func f(x foo_t,) {}
```
Note the comma at the end of the function param list.

Reparsing the result with a new FileSet and then re-formatting fixes the problem.
Repository: rust
Issue: closure return type inference doesn't consider coercions
Labels: C-enhancement,T-compiler,A-inference,T-types

The title is a guess as to why this code doesn't compile:

```rust
fn foo(x: Option<&mut i32>) -> Option<&i32> {
    x.map(|x| x)
}
```

```
error[E0308]: mismatched types
 --> src/main.rs:3:5
  |
3 |     x.map(|x| x)
  |     ^^^^^^^^^^^^ types differ in mutability
  |
  = note: expected type `std::option::Option<&i32>`
             found type `std::option::Option<&mut i32>`
```

while given the tiniest of type hints, it does:

```rust
fn foo(x: Option<&mut i32>) -> Option<&i32> {
    x.map(|x| -> &_ { x })
}
```

It seems that the type inference sees the closure returning `&mut i32` but doesn't consider that that coerces to the desired type. Is this unintended and/or fixable?
Repository: opencv
Issue: Design flaw of Widget in the viz module
Labels: category: viz

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => master

##### Detailed description
By design, `cv::viz:: Widget` is implicitly shared.

https://github.com/opencv/opencv/blob/e2a99d24ec8f48ca56ead3a6beb7fe38fc067a12/modules/viz/include/opencv2/viz/widgets.hpp#L90-L92

That is, the actor (i.e., Prop) is shared between widgets.
https://github.com/opencv/opencv/blob/e2a99d24ec8f48ca56ead3a6beb7fe38fc067a12/modules/viz/src/widget.cpp#L60-L64

This is very efficient while copying widgets, since it only needs to copy a pointer.

Widgets are saved in a dictionary
https://github.com/opencv/opencv/blob/e2a99d24ec8f48ca56ead3a6beb7fe38fc067a12/modules/viz/src/precomp.hpp#L161
where the key is the widget name and the value is the prop associated with the widget.

To display a widget, its actor is added to the renderer
https://github.com/opencv/opencv/blob/601e3aaf988b8450634b931c10900633622bad04/modules/viz/src/vizimpl.cpp#L250-L251

**The problem** is that when two widgets share the same actor, `renderer_->AddActor()`
filters duplicates and only one actor is added. If one widget is removed,
https://github.com/opencv/opencv/blob/601e3aaf988b8450634b931c10900633622bad04/modules/viz/src/vizimpl.cpp#L396
the actor of the other widget is also removed from the renderer, but it remains in the widgets
dictionary.

The consequence is that we cannot see the widget, since its actor is not added to the renderer,
but we can use `getWidget`, `setWidgetPose` or other operations to modify the properties of
the widget.

##### Steps to reproduce
A minimal example is as follows:

```.cpp
#include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/viz.hpp>

int main()
{
    cv::viz::Viz3d win("test window");
    cv::viz::WLine line(cv::Point3d(0,0,0), cv::Point3d(1,1,0));
    cv::viz::WLine line2(line);
    win.showWidget("my line", line);
    win.showWidget("my line2", line2);
    win.spinOnce(3000, true);
    win.removeWidget("my line");
    // At this point, my line2 is not visible
    // since its actor is removed from the renderer
    // but we can still access it.
    // Expected result: my line2 should still be visible.
    std::cout << win.getWidgetPose("my line2").matrix << "\n";
    win.spinOnce(3000, true);

    return 0;
}
```

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->
Repository: opencv
Issue: Name mismatch for widgets.hpp and widget.cpp in the viz module.
Labels: priority: low,category: viz

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => master


##### Detailed description
The header file is called [widgets.hpp][1], whereas
the source file is named as [widget.cpp][2].

[2]: https://github.com/opencv/opencv/blob/master/modules/viz/src/widget.cpp
[1]: https://github.com/opencv/opencv/blob/master/modules/viz/include/opencv2/viz/widgets.hpp

<!-- your description -->


<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->
Repository: vscode
Issue: Option to disable font ligatures in strings
Labels: feature-request,font-rendering

Sometimes you have to list a bunch of characters in a string containing a regular expression and you don't want the characters to merge in order to more easily read the expression.
Repository: rust
Issue: Multiple output files created with -o foo --emit=bar -C codegen-units=1 when incremental compilation is enabled
Labels: C-enhancement,T-compiler,A-incr-comp

rustc will not warn that the requested value for codegen-units is ignored when incremental compilation is enabled.  If also using ```-o foo --emit=bar```, this results in multiple foo.bar files being created.

It would be useful to have a warning message that codegen-units is being overridden.

There is a similar warning present today that can be triggered with ```-C codegen-units=2 -o ir --emit=llvm-ir ``` at [config.rs#L1740-L1768](https://github.com/rust-lang/rust/blob/afa8acce251cda7ab1548640fdb769139a45f839/src/librustc/session/config.rs#L1740-L1768).

```rust
        match codegen_units {
            Some(n) if n > 1 => {
                if matches.opt_present("o") {
                    for ot in &incompatible {
                        early_warn(error_format, &format!("--emit={} with -o incompatible with \
                                                         -C codegen-units=N for N > 1",
                                                        ot));
                    }
                    early_warn(error_format, "resetting to default -C codegen-units=1");
```

#### Example - With Incremental Compilation
I expect this to create a single .ll file, but instead four are received
```bash
$ cargo new --bin cgu-ignored && cd cgu-ignored
$ cargo rustc -- -o ir --emit=llvm-ir -C codegen-units=1

    warning: ignoring emit path because multiple .ll files were produced

    Finished dev [unoptimized + debuginfo] target(s) in 0.44 secs

$ ls *.ll
ir-a806d54fb39b2862.1y16o1qfye96o7m0.rcgu.ll  ir-a806d54fb39b2862.3rngp6bm2u2q5z0y.rcgu.ll
ir-a806d54fb39b2862.3yvk9x00s7w2trum.rcgu.ll  ir-a806d54fb39b2862.4xq48u46a1pwiqn7.rcgu.ll
```
#### Example - Without Incremental Compilation
With incremental compilation turned off, a single file is created as expected
```bash
$ CARGO_INCREMENTAL=0 cargo rustc -- -o ir --emit=llvm-ir -C codegen-units=1

    Finished dev [unoptimized + debuginfo] target(s) in 0.31 secs

$ ls *.ll
ir-a806d54fb39b2862.ll
```

Issue recreated on rustc 1.25.0-nightly (45fba43b3 2018-02-10)
Repository: rust
Issue: #[repr(align(4))] struct has 8 byte alignment
Labels: A-diagnostics,T-compiler,C-feature-request,A-repr,A-align

[See it live](https://play.rust-lang.org/?gist=b53af41209b9a45e5e4c180d54018d7f&version=undefined):

```rust
#![allow(non_camel_case_types)]
pub enum c_void {}

type uintptr_t = usize;
type int16_t = u16;
type uint16_t = int16_t;
type uint32_t = u32;
type intptr_t = uintptr_t;

#[repr(C)]
#[repr(align(4))]
pub struct kevent {
    pub ident: uintptr_t,
    pub filter: int16_t,
    pub flags: uint16_t,
    pub fflags: uint32_t,
    pub data: intptr_t,
    pub udata: *mut c_void,
}

fn main() {
    assert_eq!(::std::mem::align_of::<kevent>(), 4); // ERROR: 8 != 4
}
```

No warning, no error, nu nothing.

This is https://github.com/rust-lang/libc/issues/914
Repository: opencv
Issue: Integration with oss-fuzz
Labels: RFC

According to [meeting notes](https://github.com/opencv/opencv/wiki/2017#minutes-17) from 2017-05-16, there was a plan to integrate OpenCV into [oss-fuzz](https://github.com/google/oss-fuzz).

However it seems to have never happened.

What would help you getting started (beyond the cash reward from Google)?
Repository: rust
Issue: Ship a custom LLDB with Rust support
Labels: A-LLVM,T-infra,C-tracking-issue

I hear that @tromey has been doing some awesome work with Rust-specific support in LLDB, and we should enable easily shipping that work to users! This is intended to be a checklist/tracking issue of sorts of the work needed to be done to enable this.

* [x] One of the first things we'll need to do is to add it to the Rust source tree (off by default). This will probably involve adding a submodule and adding rustbuild logic to build LLDB. This will currently, as of this writing, require syncing the LLDB work to get based off the same LLVM version we have in tree, presently the `release_60` branch.
* [x] Next up we'll want to confirm that LLDB works with `sccache` and is being cached properly when using sccache. The change here would basically be ensuring that `--enable-ccache` works for LLDB locally.
* [x] After that we'll want to build LLDB on the dist bots, but not upload it yet. This'll help us evaluate impacts on cycle time, if any. The change here should mostly just be tweaking flags in travis/appveyor/dockerfiles
* [x] Next we'd add rustbuild support for creating a new LLDB component that we'd publish on the dist bots. This would probably look similar to the support for RLS (ish).
* [ ] And finally we'd teach rustup.rs about the LLDB component, allowing `rustup component add lldb` (or whatever the name is), but this is much farther down the line!
Repository: rust
Issue: Support returning elements from an array by-value
Labels: C-enhancement,A-borrow-checker,T-compiler,A-array

This works:

```rust
fn test_vec() -> String {
    let mut z = vec![String::from("foo"), String::from("bar")];
    z.remove(0)
}
```

But this fails:

```rust
fn test_array() -> String {
    let mut z = [String::from("foo"), String::from("bar")];
    z[0]
}
```

with a "cannot move out of" error.

(#rust-beginners advised me that this "should" intuitively work and that I should file here)
Repository: go
Issue: proposal: cmd/go: allow test binaries to identify as uncacheable
Labels: Proposal,GoCommand

The new test caching stuff is neat, except when a test has an external dependency (e.g. it is testing code that hits a web service), and we don't want the test's result to be cached (so that we're always exercising the code against the real world).

There are ways to disable the test caching from the user's perspective (e.g. passing `-count=1`), but not from the test itself from what I can tell. It'd be nice if tests in this position could do something to indicate to the `go` tool that its result and output should not be cached.

Some ideas:
   * Have a method on `*testing.T` that can be invoked to signal this.
   * Have a specified file to touch (e.g. `$GOCACHE/something`).
   * Have a naming convention for such tests (e.g. must have an `External` substring).
Repository: vscode
Issue: Feature Request - Make possible to undo (redo) changes in code after VS Code's been restarted
Labels: feature-request,editor-core,undo-redo

<!-- Do you have a question? Please ask it on https://stackoverflow.com/questions/tagged/vscode. -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.21.0-ins
- OS Version: win7x64

It would be great to undo (Ctrl+Z) and redo (Ctrl+Y) changes in the code we've done, **after** VS Code's been closed and restarted.

Is it hard to implement?
Repository: go
Issue: proposal: math/rand/v2: add function for random bool
Labels: Proposal,Proposal-Hold

I want to be able to call `rand.Bool()` and receive a pseudo-random bool when I import `math/random`
Repository: go
Issue: proposal: cmd/go: add transitive Deps for TestImports and XTestImports
Labels: Proposal,Proposal-Hold

`go list` provides a `.Deps` which has the recursive list of dependencies for `.Imports`. This is important because it provides the complete list of dependencies that must be fulfilled to run `go build`

Unfortunately there is no recursive dependency provided for `TestImports` or `XTestImports`. Those have a dependency tree that needs to be fulfilled in order to `go test` but it's non-trivial to retrieve that dependency list. (especially when trying to filter out stdlib entries)

### Currently

```go
// Dependency information
Imports      []string // import paths used by this package
Deps         []string // all (recursively) imported dependencies
TestImports  []string // imports from TestGoFiles
XTestImports []string // imports from XTestGoFiles
```

### What's expected?

```go
// Dependency information
Imports      []string // import paths used by this package
Deps         []string // all (recursively) imported dependencies
TestImports  []string // imports from TestGoFiles
TestDeps     []string // all (recursively) imported dependencies from TestGoFiles
XTestImports []string // imports from XTestGoFiles
XTestDeps    []string // all (recursively) imported dependencies from XTestGoFiles
```

This would allow a command like the following to output the complete set of dependencies needed to run `go build` or `go test`.

```bash
go list -f '{{join .Deps "\n"}}{{if len .TestDeps}}{{"\n"}}{{end}}{{join .TestDeps "\n"}}{{if len .XTestDeps}}{{"\n"}}{{end}}{{join .XTestDeps "\n"}}' | sort | uniq
```

Currently you have to run `go list '{{join .Deps "\n"}}' $import_path` on each import path from `.TestImports` and `.XTestImports`.
Repository: pytorch
Issue: Weird error message in torch.split_size_or_sections
Labels: triaged,module: numpy

Hi everyone,

I wanted to use the new function torch.split with a list of integer.

I have a input vector of dim X (let's say 100) and a list of integer where the sum is less or equal (Y <= X). If Y <= X, an error is raised saying "Sum of split sizes exceeds tensor dim", which is not the case.

`
def split(tensor, split_size_or_sections, dim=0):

    if dim < 0:
        dim += tensor.dim()
    dim_size = tensor.size(dim)
    if isinstance(split_size_or_sections, int):
        split_size = split_size_or_sections
        num_splits = (dim_size + split_size - 1) // split_size
        last_split_size = split_size - (split_size * num_splits - dim_size)

        def get_split_size(i):
            return split_size if i < num_splits - 1 else last_split_size
        return tuple(tensor.narrow(int(dim), int(i * split_size), int(get_split_size(i))) for i
                     in range(0, num_splits))

    else:
        if dim_size != sum(split_size_or_sections):
            raise ValueError("Sum of split sizes exceeds tensor dim")
        split_indices = [0] + split_size_or_sections
        split_indices = torch.cumsum(torch.Tensor(split_indices), dim=0)

        return tuple(
            tensor.narrow(int(dim), int(start), int(length))
            for start, length in zip(split_indices, split_size_or_sections))
`

In this case, either we should have if dim_size <= sum(split_size_or_sections), either we should split the tensor is chuncks where the sum is lower than dim_size.


OS: Mac OS X
PyTorch version: From source (https://github.com/pytorch/pytorch/commit/2b2d56d8460d335daf5aa79774442a111d424f90)
How you installed PyTorch (conda, pip, source): pip
Python version: 3.6

cc @mruberry @rgommers
Repository: javascript
Issue: (question) eslint rule / plugin for guideline 7.15
Labels: pull request wanted,editorial,needs eslint rule change/addition

is there an eslint rule or plugin that enforces [7.15](https://github.com/airbnb/javascript#functions--signature-invocation-indentation)?
Repository: react-native
Issue: Android native UI components are not re-layout on dynamically added views
Labels: Ran Commands,Issue: Author Provided Repro,Platform: Android,Resolution: Backlog,Bug,Never gets stale

### Is this a bug report?

Yes.

### Have you read the [Contributing Guidelines](https://facebook.github.io/react-native/docs/contributing.html)?

Yes.

### Environment

Environment:
  OS: macOS High Sierra 10.13.2
  Node: 8.9.4
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4

### Description

The issue can be noticed if you bridge to React Native the following views:

A view with elements that have a visibility to `gone` on the **initial render** won't be displayed after you've set is visibility to `visible`. `view.isShown()` will return `true`, but it will not be there or it will be there but not really re-layout.

A view with elements that are dynamically added, simply by `view.addView()` or let's say you want to load an image with Fresco it will only work if it was loaded on the initial render.

I've noticed that native components are re-layout on hot reloading, but `this.forceUpdate()` or changing props won't trigger a re-layout. As an ugly workaround, if we interact with the native component height or width it will trigger a re-layout, so every time you want to toggle a visibility from gone to visible or dynamically adds views you can alter his size.

I've also implemented `needsCustomLayoutForChildren` without notable change.

### Expected Behavior (Native)

Here's the native implementation directly inflated inside an Activity.

<img src="https://user-images.githubusercontent.com/7189823/36165758-95c1b2ce-10be-11e8-85dc-8b801a0a3705.gif" height="400" />

### Actual Behavior (React Native)

Here's the exact same layout as above, but bridged to react native and inflated inside `SimpleViewManager`.

<img src="https://user-images.githubusercontent.com/7189823/36165505-bf90ddf6-10bd-11e8-8983-f351c7be2c00.gif" height="400" />

### Reproducible Demo

https://github.com/charpeni/react-native-android-visibility-issue

Related to #5531 (Already flagged in RN 0.18).
Repository: go
Issue: runtime: always log GC details in-memory
Labels: NeedsFix,compiler/runtime

Whenever a user reports a potential issue with the GC, the first thing we ask for is a GC trace (GODEBUG=gctrace=1). We rarely get it.

gctrace=1 is cheap enough to leave on all the time, but spamming stderr is poor form. Instead, the runtime could log it in memory somewhere, either as text or structured data, and expose it in a /debug handler or something. Then it'd be much easier to pull on demand.

This might also be useful for GODEBUG=sched{detail,trace} but I haven't seen that come up as often.