sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Use #[repr(C)] HList's to infer type-erased fmt fn pointers in format_args!'s static data.
Labels: C-enhancement,T-libs-api,I-heavy,A-fmt

Right now `format_args!` uses, e.g. `ArgumentV1::new(&runtime_data, Debug::fmt)` (for `{:?}`), at runtime, using up *two* pointers per argument at runtime instead of just one (`&runtime_data`).

With `allow_internal_unsafe` and #44240, we can place the (e.g. `Debug::fmt`) `fn` pointers in (rvalue-promoted) `'static` data, the remaining hurdle is how to infer the type of the runtime data.
That is, `Debug::fmt` is really `<_ as Debug>::fmt` and that `_` is right now inferred because of `ArgumentV1::new`'s signature typing them together. If they're separate, we need something new.

I propose using the `HList` pattern (`struct HCons<H, T>(H, T); struct HNil;` - so for 3 elements, of types `A`, `B` and `C` you'd have `HCons<A, HCons<B, HCons<C, HNil>>>`), with `#[repr(C)]`, which would give it a deterministic layout which matches that of an array, that is, these two:
* `&'static HCons<fn(&A), HCons<fn(&B), HCons<fn(&C), HNil>>>`
* `&'static [unsafe fn(*const Opaque); 3]`

have the same representation, and the latter can be unsized into a slice. This transformation from `HList` to array (and then slice) can be performed *on top* of a safe, rvalue-promoted `HCons`, which is a necessary requirement for moving the `fn` pointers into `'static` data at all.

For inference, we can simply insert some function calls to match up the types, e.g. to infer `B` we could do`fmt::unify_fn_with_data((list.1).0, &b)`, which would make`B` into `typeof b`.

It might actually be simpler to have a completely safe "builder" interface, which combines the `HList` of formatters with a `HList` of runtime references, unifying the types, but I'm a bit worried about compile-times due to all the trait dispatch - in any case, the impact should be measured.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"m-ou-se"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: Updating dependency caused type inference to fail on unrelated code
Labels: C-enhancement,A-diagnostics,T-compiler

Note: This is not a bug. This is a case that I ran into that was difficult to debug, and extremely confusing. In the interest of the ergonomics initiative, I wanted to report it. However, rustc is behaving as expected. Feel free to close this at your leisure. 

At some point last night, Diesel's builds suddenly started failing for no apparent reason. [This line](https://github.com/diesel-rs/diesel/blob/8b9326511100334b48ee73d300633535f2c9b8f7/diesel_tests/tests/select.rs#L99) was failing to infer that the `_` there is `bool` (the `Vec` annotation is cruft from back when there needed to be a `collect` call as well). It was especially baffling, because the test above it is nearly identical, and [this line](https://github.com/diesel-rs/diesel/blob/8b9326511100334b48ee73d300633535f2c9b8f7/diesel_tests/tests/select.rs#L84) was compiling just fine.

Eventually after cleaning up some build output and diffing it, we found that the only thing that had changed was a new version of `serde_json` being released. That led us to [this commit](https://github.com/serde-rs/json/commit/7fbf18e95e1f85a8654534385931818d5135db7b), which made the reason for the failure much more obvious.

Nobody really did anything wrong here. Implementing a non-fundamental trait is defined as a minor breaking change in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md). However, the failure was extremely non-local and confusing. We were convinced this was a bug in rustc for a few hours until we finally tracked it down.

While there is no bug, I think two things could have improved this situation. First, I think we should consider amending that RFC so that implementing a trait which is not part of your crate for a type which is not part of your crate to be considered a major breaking change, as any code it breaks will be code which does not interact with that crate.

Secondly, I wonder if the error message could give some more diagnostic output here. If the message listed the impls of `PartialEq` for `bool`, this would have been immediately clear what had happened.
Repository: TypeScript
Issue: Allow to extract code containing `return` statement if it's at the end of a function
Labels: Suggestion,Domain: Refactorings,Experience Enhancement

**TypeScript Version:**  nightly (2.6.0-dev.20170904)

**Code**

```ts
export function f() {
    if (1) {
        return 1;
    }
    
    ...do stuff...
}

export function g() {
    ...do stuff...

    if (1) {
        return 1;
    }
}
```

**Expected behavior:**

Able to extract the `if` statement out of `g`.
Not able to extract from `f` because that would change the control flow.

**Actual behavior:**

Not able to extract in either case. (But somehow it works in #18091?)
Repository: TypeScript
Issue: Disable formatting a region of code using directives
Labels: Suggestion,Domain: Formatter,Awaiting More Feedback,VS Code Tracked

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

From: https://github.com/Microsoft/vscode/issues/33772

**TypeScript Version:**  2.4.0 / nightly (2.5.0-dev.201xxxxx)

**Feature Request**
Add a way to disable formatting of a region of code. An example of this is js beatuify's [preserve  directive](https://github.com/beautify-web/js-beautify#directives-to-ignore-or-preserve-sections-javascript-only):

```js
// Use preserve when the content is not javascript, but you don't want it reformatted.
/* beautify preserve:start */
{
    browserName: 'internet explorer',
    platform:    'Windows 7',
    version:     '8'
}
/* beautify preserve:end */
```
Repository: vscode
Issue: introduce "pathMapping" as a more powerful replacement for "remoteRoot/localRoot"
Labels: feature-request,debug

Currently the node/chrome debuggers support two models of mapping paths between the backend/runtime and the VS Code workspace:
- Node Debug: "remoteRoot/localRoot" 
- Debugger for Chrome: "pathMapping"

Since the "pathMapping" supports multiple mappings and users are asking for it, we should support this across the board.

/cc @roblourens
Repository: rust
Issue: Expose min and max values in benchmarks
Labels: T-dev-tools,C-feature-request,A-libtest

Currently, `cargo bench` prints output along these lines:

```
test bls12_381::bench_pairing_final_exponentiation ... bench:   1,753,823 ns/iter (+/- 30,711)
test bls12_381::bench_pairing_full                 ... bench:   2,641,309 ns/iter (+/- 35,774)
test bls12_381::bench_pairing_g1_preparation       ... bench:      13,801 ns/iter (+/- 293)
test bls12_381::bench_pairing_g2_preparation       ... bench:     233,722 ns/iter (+/- 11,857)
test bls12_381::bench_pairing_miller_loop          ... bench:     618,548 ns/iter (+/- 26,680)
test bls12_381::ec::g1::bench_g1_add_assign        ... bench:       1,189 ns/iter (+/- 53)
```

The values are derived [here](https://github.com/rust-lang/rust/blob/7f054990b6bb19e15750a4442a24941cc157acb6/src/libtest/lib.rs#L844-L845), from which we can determine that the key value is a median, which is good! Unfortunately, the other value given is a range, which is not particularly useful:

- As-printed, it looks like [an error or standard deviation](https://en.wikipedia.org/wiki/Plus-minus_sign#In_statistics); either mis-interpretation would mean that the uncertainty is overstated by at least a factor of two!
- The range itself, in the context of a `+/-`, only makes sense if the underlying benchmark has a normal (Gaussian) distribution. But depending on the benchmark, that may not be the case. Say the output is `100 +/- 20`: there is no way to distinguish between a `(min, max)` of `(81, 101)` versus `(99, 119)`, which should be interpreted very differently by the programmer.

I would personally like to gain access to the min and max values for the purpose of CI benchmarks (e.g. [here](https://speed.z.cash/timeline/?exe=1&base=1%2B9&ben=time+solveequihash&env=1&revs=50&equid=off&quarts=on&extr=on)), so I'd like to see those values exposed either by default, or accessible via a flag. Alternatively (or in addition), the range should be replaced with a standard deviation or standard error.
Repository: youtube-dl
Issue: I would like to ask you can download the video to support the crooked website
Labels: site-support-request

Is it possible to support the download of crooked video?
http://www.yy.com/x/15012_147125102_54880976_1504611031651
http://www.yy.com/x/15012_147125102_54880976_1504265354742
Repository: react-native
Issue: View will lost background color when set borderRadius and height is large enough on Android device
Labels: Help Wanted :octocat:,Platform: Android,Priority: Low,Bug

### Is this a bug report?

Yes


### Have you read the [Contributing Guidelines](https://facebook.github.io/react-native/docs/contributing.html)?

No

### Environment

@mjmasn's environment:

```
Environment:
  OS: Linux 4.13
  Node: 8.11.0
  Yarn: 1.7.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: N/A
  Android Studio: 3.1 AI-173.4670197

Packages: (wanted => installed)
  react: ^16.4.1 => 16.4.1
  react-native: ^0.55.4 => 0.55.4
```

@beiming's environment:

```
Environment:
  OS: macOS
  Node: 7.7.1
  npm: 4.1.2

Packages: (wanted => installed)
  react-native: ^0.47.2 => 0.47.2

Target Platform: 
  Android
  Android version: 4.4.4
  Screen resolution: 720 x 1280
```

### Steps to Reproduce


```
// index.android.js

import React, {Component} from 'react';
import {AppRegistry, View, Text, ScrollView} from 'react-native';

class App extends Component {
    render() {
        return (
            <ScrollView>
                <View style={{
                    // if `borderRadius` > 0 and `height` is large enough like 3000 (2000 is ok on my android device), `backgroundColor` will disappear.
                    borderRadius: 1,
                    height: 3000,
                    backgroundColor: 'red',
                    alignItems: 'center',
                    justifyContent: 'center'
                }}>
                    <Text>Test</Text>
                </View>
            </ScrollView>

        );
    }
}

AppRegistry.registerComponent('App', () => App);
```

Run `react-native run-android` on a device, it does not reproduce on an AVD.

### Expected Behavior

It will be show a long view, with red background, and scroll view show `Test` in center.

### Actual Behavior

It will be show a long view, but no background color (white, maybe transparent), and scroll view show `Test` in center.
Repository: rust
Issue: Meta issue for FIXMEs that reference closed issues
Labels: C-cleanup,metabug,T-libs-api,T-compiler,E-help-wanted

@Eh2406 compiled this awesome list. I think it should be a meta issue. So here it is

https://gist.github.com/Eh2406/b92f034f8adc193894482e19c79d80f1
Repository: angular
Issue: HttpParams doesn't accept array
Labels: feature,area: common/http,P4,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 -->
[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
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
<pre><code>
 let payload = new HttpParams();
payload.set('ids', [1,2,3,4]);
</pre></code>
This is not accepted and compiled by ts because set method accepts just string.
## Expected behavior
<!-- Describe what the desired behavior would be. -->
To be able to set array, and the serializer to make like this ids[]=1&ids[]=2&ids=[]3&ids[]=4

## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->


## Environment

<pre><code>
Angular version: X.Y.Z
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [x] Chrome (desktop) version XX
- [x] Chrome (Android) version XX
- [x] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [x] Safari (iOS) version XX
- [x] IE version XX
- [x] Edge version XX
 
For Tooling issues:
- Node version: 6.9.12  <!-- run `node --version` -->
- Platform:  Mac <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>
Repository: TypeScript
Issue: JSDoc Parser breaks with a complex `@pattern` tag
Labels: Bug,Help Wanted,Domain: JSDoc

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  2.5.2

**Code**

```ts
  /**
   * @pattern ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$
   */
  public emailPattern: string;
```

**Expected behavior:**
expected '^[a-zA-Z0-9_.+-]+' to equal '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$'
  
**Actual behavior:**

This is parsed  -^[a-zA-Z0-9_.+-]+ 
This is expected      +^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

Maybe I am doing something stupid or the parser is broken.
Repository: every-programmer-should-know
Issue: What are some of the best resources on Software/Code Design?
Labels: Needs some ❤️
Repository: every-programmer-should-know
Issue: What are some of the best resources on Engineering Processes?
Labels: Needs some ❤️
Repository: every-programmer-should-know
Issue: What are some of the best resources on Development Methodologies? 
Labels: Needs some ❤️

Ideally, something referencing current and historical methodologies: 
- Kanban
- Lean
- Scrum 
- RUP 
- V-Model
- XP
etc
Repository: every-programmer-should-know
Issue: What are some of the best resources on Code Construction?
Labels: Needs some ❤️

- Refactoring
- Debugging
- Design
Repository: TypeScript
Issue: Allow class inheritance in ambient contexts, even with a base private constructor
Labels: Suggestion,Help Wanted,Committed

**TypeScript Version:**  nightly (2.5.0-dev.20170902)

**Code**

```ts
declare namespace Foo {
    class Bar {
        private constructor();
        Box: string;
    }
    class Baz extends Bar {
        private constructor();
    }
    function generator(): Baz;
}

let x = Foo.generator();
x.Box = 'abcd';
```

**Expected behavior:**
Compile without error.

**Actual behavior:**
error TS2675: Cannot extend a class 'Foo.Bar'. Class constructor is marked as private.

**Use case**
This would allow declaring the types of host-supplied objects, with the following features:
1. can inherit members from each other
2. cannot be inherited from using standard Typescript/Javascript classes
3. cannot be assigned to from an object literal with matching members
4. cannot be constructed, only returned from a factory method

```ts
declare namespace com.sun.star.text {
    class XTextTablesSupplier {
        private constructor();
        private typekey: XTextTablesSupplier;
        readonly TextTables: any;
    }
    class GenericTextDocument extends XTextTablesSupplier {
        private constructor();
        private typekey1: GenericTextDocument;
        CharacterCount: number;
    }
}
declare function createInstance(typename: 'com.sun.star.text.GenericTextDocument'): com.sun.star.text.GenericTextDocument;

let x = createInstance('com.sun.star.text.GenericTextDocument'); // OK

x = new com.sun.star.text.GenericTextDocument(); // Error

let y = x.TextTables; // OK

// The following would be an error
x = {
    TextTables: '',
    CharacterCount: 5
};
```
Repository: TypeScript
Issue: Array.prototype.sort make compareFn required in lib.d.ts
Labels: Suggestion,Domain: lib.d.ts,Experimentation Needed

This is a suggestion to change the signature declaration of Array sort in lib.d.ts from

```ts
sort(compareFn?: (a: T, b: T) => number): this;
```
to
```ts
sort(this: string[], compareFn?: (a: string, b: string) => number): this;
sort(compareFn: (a: T, b: T) => number): this;
```
i.e. make compareFn non-optional for non-string arrays. This would result in errors in cases such as
```ts
[2, 10].sort() // returns [10, 2], i.e. sorted lexicographically, which is very unintuitive.
```

While this is strictly speaking a breaking change, it wouldn't be the first time the typings are stricter than the actually definitions.
Repository: youtube-dl
Issue: Running inside docker container from non root user
Labels: external-bugs

When i try to run youtube-dl inside docker container from non root user i recieve this error:

failed to import the site module traceback (most recent call last): file "/usr/lib/python3.6/site.py", line 544, in  main() file "/usr/lib/python3.6/site.py", line 530, in main known_paths = addusersitepackages(known_paths) file "/usr/lib/python3.6/site.py", line 282, in addusersitepackages user_site = getusersitepackages() file "/usr/lib/python3.6/site.py", line 258, in getusersitepackages user_base = getuserbase() # this will also set user_base file "/usr/lib/python3.6/site.py", line 248, in getuserbase user_base = get_config_var('userbase') file "/usr/lib/python3.6/sysconfig.py", line 601, in get_config_var return get_config_vars().get(name) file "/usr/lib/python3.6/sysconfig.py", line 558, in get_config_vars _config_vars['userbase'] = _getuserbase() file "/usr/lib/python3.6/sysconfig.py", line 205, in _getuserbase return joinuser("~", ".local") file "/usr/lib/python3.6/sysconfig.py", line 184, in joinuser return os.path.expanduser(os.path.join(*args)) file "/usr/lib/python3.6/posixpath.py", line 247, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir keyerror: 'getpwuid(): uid not found: 1000'


I believe this problem is described here: 
http://blog.dscpl.com.au/2015/12/unknown-user-when-running-docker.html
Repository: TypeScript
Issue: The language service does not resolve symbolic links
Labels: Bug,API

The LS does not provide a mechanism for LS hosts to resolve symbolic links, which can result in build errors when using _gulp-tsb_ or other tools to compile a project that uses symbolic links.

To support this, we need to add a `realpath` optional method to the `LanguageServiceHost` interface to allow an LS host to specify a `realpath` implementation to resolve symbolic links.
Repository: opencv
Issue: Zooming in Viz3d not possible after camera rotation
Labels: bug,category: viz

##### System information (version)
- OpenCV => 3.3
- Operating System / Platform => Ubuntu 16.04 (x86-64) with QT 5.5
- Compiler => g++ 5.4.0

##### Detailed description

For 3-D reprojections and the like, it is sometimes necessary to rotate or flip the camera around. However, when doing this with Viz3d, one loses the ability to zoom using the mouse's scroll wheel. The following code illustrates the issue:

##### Steps to reproduce

```
#include <cmath>
#include <opencv2/viz.hpp>

using namespace std;
using namespace cv;
using namespace viz;

int main()
{
  Viz3d visualization;
  visualization.showWidget("Test object", WCone(1000, 1000, 100));
  visualization.spinOnce(1, true); //Required to work around another bug
  //Uncomment to lose the ability to zoom by scrolling
  /*auto pose = visualization.getViewerPose();
  pose = pose.rotate(Vec3f(M_PI, 0, 0));
  visualization.setViewerPose(pose);*/
  visualization.spinOnce(1, true);
  while (!visualization.wasStopped())
    visualization.spinOnce(1, true);
  return 0;
}
```

This seems to be an issue that is different from the others that I reported previously - none of those impact the user's control abilities over the camera with the mouse.
Repository: rust
Issue: #[thread_local] from windows DLLs gets duplicated by inlining.
Labels: T-compiler,O-windows-msvc,A-thread-locals,C-bug

This is most likely responsible for the windows failures from #43931 when the `__getit` function, which may return a reference to a `#[thread_local] static`, was `#[inline]` (cc @alexcrichton):
```rust
// a.rs
#![crate_type = "dylib"]
#![feature(thread_local)]

#[thread_local]
static FOO: u32 = 25;

pub fn addr() -> *const u32 {
    &FOO
}

#[inline]
pub fn addr_inline() -> *const u32 {
    &FOO
}
```
```rust
// b.rs
extern crate a;

fn main() {
    assert_eq!(a::addr(), a::addr_inline());
}
```
Running `b`, on x64 MSVC (thanks, @bcata6!) results in:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `0x134cb61ace4`,
 right: `0x134cb6139c0`', b.rs:4:4
```
Repository: godot
Issue: Translation snapping should have individual settings for the x, y and z axes
Labels: enhancement,topic:editor,usability,topic:3d

Humans are not cubes, we are tall and thin. We made our hallways tall, our doorways tall, the houses we live in, and the closets we hang our clothes in.
The editor's translation snap however assumes that the entire world is made of uniformly-sized cubes. (or squares, in case of the 2D editor)

I would enjoy the ability to work on a different y-level without having to fiddle with the snap settings every time i want to go back down a level.