sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Misleading diagnostics when forgetting to add trait bound in impl block
Labels: A-diagnostics,T-compiler,D-confusing

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->

Given the following code: [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e23f8b9715718a9cf5aa433a07575efa)

```rust
trait Foo {}
trait Bar {}

impl<T> Bar for T where T: Foo {}  // <----- This seems to confuse the compiler

struct Baz<T: Bar> {
    bar: T,
}

impl<T> Baz<T> {  // <----------- Notice missing T: Bar
    fn new(bar: T) -> Self {
        Baz {
            bar,
        }
    }
}
```

The current output is:

```
error[E0277]: the trait bound `T: Foo` is not satisfied
  --> src/lib.rs:10:9
   |
10 | impl<T> Baz<T> {
   |         ^^^^^^ the trait `Foo` is not implemented for `T`
   |
note: required because of the requirements on the impl of `Bar` for `T`
  --> src/lib.rs:4:9
   |
4  | impl<T> Bar for T where T: Foo {}
   |         ^^^     ^
note: required by a bound in `Baz`
  --> src/lib.rs:6:15
   |
6  | struct Baz<T: Bar> {
   |               ^^^ required by this bound in `Baz`
help: consider restricting type parameter `T`
   |
10 | impl<T: Foo> Baz<T> {
   |       +++++
```

Ideally the output should look like:

```
error[E0277]: the trait bound `T: Bar` is not satisfied
  --> src/lib.rs:10:9
   |
10 | impl<T> Baz<T> {
   |         ^^^^^^ the trait `Bar` is not implemented for `T`
   |
note: required by a bound in `Baz`
  --> src/lib.rs:6:15
   |
6  | struct Baz<T: Bar> {
   |               ^^^ required by this bound in `Baz`
help: consider restricting type parameter `T`
   |
10 | impl<T: Bar> Baz<T> {
   |       +++++

```

The current message is misleading because `Baz` doesn't *require* `Foo` and suggesting bounding by `Foo` causes the bound to be more restrictive than needed. At first I didn't even realize the bound was missing, I thought I added `Bar: Foo` by accident.
If I, hypothetically, truly wanted `T: Foo`, presumably because of some method implemented on `Foo` the proper error would still show up later, which is good.

Same on nightly.
Repository: pytorch
Issue: "Memory Leak" when creating an iterator from a tensor
Labels: module: memory usage,triaged

### 🐛 Describe the bug

Hello,

if one creates an iterator out of a tensor one will run out of memory very fast. I discussed it in the forum: https://discuss.pytorch.org/t/looping-over-tensor-leaks-memory/141487/5

Example code:
```py
import torch
data = torch.rand(60000000)
it = iter(data)
```

The above is run on a machine (arch linux) with 16 GB of memory. You might have to increase the amount of data generated to reproduce.

My python version is:
```
Python 3.7.12 (default, Dec 2 2021, 11:47:57)
[GCC 11.1.0] on linux
```

I run this in a virtual environment with
```
$ pip list
Package            Version   Editable project location
------------------ --------- ----------------------------------
astropy            4.3.1
beautifulsoup4     4.10.0
cached-property    1.5.2
certifi            2021.10.8
cffi               1.15.0
charset-normalizer 2.0.7
cryptography       35.0.0
cycler             0.10.0
Cython             0.29.24
decorator          5.1.0
gwdatafind         1.0.4
h5py               3.6.0
idna               3.3
importlib-metadata 4.8.1
Jinja2             3.0.2
kiwisolver         1.3.2
lalsuite           7.0
ligo-segments      1.4.0
lscsoft-glue       2.0.0
Mako               1.1.5
MarkupSafe         2.0.1
matplotlib         3.4.3
mpi4py             3.1.3
mpld3              0.5.5
numpy              1.21.2
Pillow             8.4.0
pip                21.3.1
PyCBC              0.0a8210  /home/pascal/venv_thesis/src/pycbc
pycparser          2.20
pyerfa             2.0.0
pyOpenSSL          21.0.0
pyparsing          2.4.7
python-dateutil    2.8.2
requests           2.26.0
scipy              1.7.1
setuptools         60.0.0
six                1.16.0
soupsieve          2.2.1
torch              1.9.1
tqdm               4.62.3
typing-extensions  3.10.0.2
urllib3            1.26.7
zipp               3.6.0
```

### Versions

```
PyTorch version: 1.9.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Arch Linux (x86_64)
GCC version: (GCC) 11.1.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.2.5

Python version: 3.7.12 (default, Dec  2 2021, 11:47:57)  [GCC 11.1.0] (64-bit runtime)
Python platform: Linux-5.15.11-arch2-1-x86_64-with-arch
Is CUDA available: True
CUDA runtime version: 11.5.119
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1650 SUPER
Nvidia driver version: 495.46
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.21.2
[pip3] torch==1.9.1
[conda] Could not collect
```
Repository: vscode
Issue: Language detection is ignoring file extension for untitled files
Labels: bug,languages-guessing

Maybe this isn't the best way to do it, but I open this untitled file with an explicit .md extension using the extension API:

```
const doc = await vscode.workspace.openTextDocument(vscode.Uri.from({ scheme: 'untitled', path: `Inspect ${basename(uri.path.replace(/\.png$/, ''))}.md` }))
```

Notice in the below gif that markdown is correctly selected initially, but then the language detection incorrectly changes it to Dart. The fact that it thinks it's Dart is a little weird but expected in a way since it's using ML, what's not expected it to overwrite an already explicitly set language mode.

![Recording 2022-01-13 at 05 19 51](https://user-images.githubusercontent.com/2193314/149350377-ab66b358-28c2-4893-9103-fd1e3dcc5148.gif)

Also saw this happen with Rust if that's of any use.
Repository: rust
Issue: incorrect "reinitialization might get skipped" error
Labels: A-borrow-checker,C-bug

I tried this code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=b6fe50e5acdd6b8c1e5f4d3603b60c0a

```rust
#![feature(nll)]

struct DB;
impl DB {
    fn contains(&self, _: &str) -> bool {
        true
    }
    fn resolve(&self, _: &str) -> Result<&'static str, String> {
        Ok("".into())
    }
}

fn f() -> (DB, &'static str) {
    let locked_rev = Some("abc");
    let mut maybe_db = Some(DB);
    if let (Some(rev), Some(db)) = (locked_rev, maybe_db) {
        if db.contains(rev) {
            return (db, rev);
        }
        maybe_db = Some(db);
    }
    if let (None, Some(db)) = (locked_rev, maybe_db) {
        if let Ok(rev) = db.resolve("abc") {
            return (db, rev);
        }
        maybe_db = Some(db);
    }
    (maybe_db.unwrap(), "")
}
```

I expected to see this happen: The code compiles successfully.

Instead, this happened: The code gives an error:

```
error[E0382]: use of moved value: `maybe_db`
  --> src/lib.rs:24:44
   |
15 |     let mut maybe_db = Some(DB);
   |         ------------ move occurs because `maybe_db` has type `Option<DB>`, which does not implement the `Copy` trait
16 |     if let (Some(rev), Some(db)) = (locked_rev, maybe_db) {
   |                                                 -------- value moved here
...
22 |         maybe_db = Some(db);
   |         ------------------- this reinitialization might get skipped
23 |     }
24 |     if let (None, Some(db)) = (locked_rev, maybe_db) {
   |                                            ^^^^^^^^ value used here after move
```

This error is incorrect; there is no case where `maybe_db` is moved and also control flow can reach line 24 without first reaching line 22. If the `if let` block isn't entered, `maybe_db` isn't moved.

### Meta

`rustc --version --verbose`:
```
1.60.0-nightly (2022-01-12 1bd4fdc943513e1004f4)
```
Repository: create-react-app
Issue: Cite Templates Used In Git Commit
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

Initializing react apps with a template does not mention what template was used.

### Describe the solution you'd like

Append to the initial commit made by create-react-app with a second `-m` option citing the template that was used.

### Describe alternatives you've considered

Uncommitting the Initial Commit from create-react-app and recommitting with the template credited.

### Additional context

I'm unsure if this opens up a security issue with template literals inside `execsync` calls. If not, I'm happy to spin up a PR for it. Thanks.
Repository: three.js
Issue: Add anchor links to docs
Labels: Suggestion,Documentation

<!-- Ignoring this template may result in your feature request getting deleted -->

**Is your feature request related to a problem? Please describe.**

I want to be able to link to a specific section of the documenation.

**Describe the solution you'd like**

All h1, h2,... tags have an id attribute.

**Describe alternatives you've considered**

Linking to just the page.

**Additional context**

n/a
Repository: vscode
Issue: Git - Add Default Commit Message 
Labels: feature-request,git

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

I often make quick one file edits. I'd like for VS Code to add default commit messages when I decide to use VS Code to make a commit.
This is what GitHub Desktop already does.
![image](https://user-images.githubusercontent.com/21298211/149369214-f1983463-82a0-42d5-8870-f7bfd5076461.png)
Repository: vscode
Issue: Activity bar activity indicator is `1px` but configured as `2px`
Labels: bug,layout,confirmed

Recently switched over to Windows and noticed that the activity bar's active indicator is very thin, it's supposed to be 2px wide:

**Insiders**
<img width="158" alt="image" src="https://user-images.githubusercontent.com/35271042/149371753-8f90546b-5e59-474c-bfc8-d48458635a18.png">

And on Web it looks normal:
<img width="165" alt="image" src="https://user-images.githubusercontent.com/35271042/149371862-364c108c-9450-4cd7-bcf8-8f6e7209f84c.png">

Moving sidebar to the right makes it even thinner too:
<img width="131" alt="image" src="https://user-images.githubusercontent.com/35271042/149375144-e3ba2f5d-2da8-4a7a-bb82-31d24637c760.png">
Repository: PowerToys
Issue: add an exception for "win+d" for the "Always on top" utility
Labels: Idea-Enhancement,Product-Always On Top

### Description of the new feature / enhancement

Thanks for the great utility..

I have a suggestion to add a feature to choose whether to exclude the pinned window from being minimized at "show desktop (win+d)"..

### Scenario when this would be used?

always when I want to get back to clean desktop after having many windows open, I use the "Wind+d" shortcut. However, when I want to have a certain window always on top (e.g. a note), I don't wanna it to be minimized as well.

### Supporting information

_No response_
Repository: flutter
Issue: [iOS] [google_maps_flutter] Polygons drawn inconsistently between iOS and other platforms
Labels: platform-ios,p: maps,package,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-ios,triaged-ios

## Steps to Reproduce

1. Clone https://github.com/eEQK/bug-example
2. run the project on iOS

**Expected results:** <!-- what did you want to see? -->
Interactive sample can be found here: https://jsfiddle.net/u1tcv4hd/

Here's a screenshot on how it looks like on web (it looks the same on Android):
_Notice the L shaped thingy at the end on the right-hand side_
![image](https://user-images.githubusercontent.com/15970653/149371445-6be203db-979f-4f7b-9340-ca125a545c42.png)

**Actual results:** <!-- what did you see? -->
Interactive sample can be found here: https://github.com/eEQK/bug-example
File with the logic responsible for displaying the map: https://github.com/eEQK/bug-example/blob/master/lib/bug_example.dart

And that's a screenshot from iOS, which is missing a line at the end _(again, on the right-hand side)_

<img src="https://user-images.githubusercontent.com/15970653/149371676-dd41aa48-ce3a-4e80-a950-50a357e31108.png" width ="300">

**Os details**
```
$ flutter --version
Flutter 2.10.0-0.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 628f0e3f3a (2 days ago) • 2022-01-11 19:50:05 -0600
Engine • revision 63ca99584a
Tools • Dart 2.16.0 (build 2.16.0-134.1.beta) • DevTools 2.9.2

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 2.10.0-0.1.pre, on macOS 12.1 21C52 darwin-arm, locale en-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Community Edition (version 2021.3.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!
```
Repository: flutter
Issue: [Flutter Markdown] Parse markdown inside custom blockSyntax
Labels: package,team-ecosystem,has reproducible steps,P3,p: flutter_markdown,found in release: 2.8,found in release: 2.9,triaged-ecosystem

I created a blockSyntax, and I would like that if this one contains markdown, that it is automatically parsed.
If I understood correctly for that my custom element must contain paragraph nodes, but this generates an error:
`Bad state: Too many elements`

Here is my functional block syntax but without the markdown being parsed :
```
class WarningSyntax extends md.BlockSyntax {
  static const String _pattern = r'^\[\[warning\]\](.*)$';
  @override
  RegExp get pattern => RegExp(_pattern);

  WarningSyntax();

  @override
  md.Node parse(md.BlockParser parser) {
    var childLines = parseChildLines(parser);

    var content = childLines.join('\n');

    final md.Element el = md.Element('p', [
      md.Element('warning', [md.Text(content)]),
    ]);

    return el;
  }
}
```

In addition, give you the possibility of creating personal block syntax but we cannot directly return our custom element, it is absolutely necessary that the parent node is in the following list:
```
const List<String> _kBlockTags = <String>[
  'p',
  'h1',
  'h2',
  'h3',
  'h4',
  'h5',
  'h6',
  'li',
  'blockquote',
  'pre',
  'ol',
  'ul',
  'hr',
  'table',
  'thead',
  'tbody',
  'tr'
];
```

**Flutter doctor**

```
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6 20G165 darwin-x64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)

• No issues found!
```
Repository: TypeScript
Issue: TS2302 when using two generics with the same name in JSDoc, but not in TypeScript.
Labels: Bug,Help Wanted,Domain: JSDoc

# Bug Report

### 🔎 Search Terms

ts2302 jsdoc

### 🕗 Version & Regression Information

- This changed between versions `4.4.4` and `4.5.4`

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.5.4&filetype=js#code/PQKhCgAIUgBAXApgWwA4BsCGTIBUCMUMCAnqogCaIBmkA3gQL56YDWiAzgUcOOKBGhwkaLDm5CEKDNkR4ATD3ABjLBw6QAYgHtt9KJEMCDhySJnjCpw8XNi5DNpwIAeAgD5muRdcmpMAE6YyPRMkPBW1sT+QSEM8szwPlG81hzw2ACWypAARoEAFBEANOHyAJT6JpCM4LV8wMCQAKocmADmiABc4DraAHT5AQUARJgjpQCs5QDckI2QAKIBAdoBGpgaiAAe5MpIFL26g4VjE5Bns-NNAHJ6iCtrQA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
/**
 * @template T1
 * @typedef {T1} TakesT1
 */

/**
 * @template T1
 * @template T2
 */
class Foo {
    /**
     * @template T1
     * @template {TakesT1<T1>} T2
     *                    ^^--- Static members cannot reference
     *                          class type parameters.(2302)
     * @param {T1} t1
     * @param {T2} t2
     */
    static bar(t1, t2) {

    }
}
```

### 🙁 Actual behavior

"Static members cannot reference class type parameters." This is wrong because the equivalent typescript for this situation does not give an error: [playground](https://www.typescriptlang.org/play?#code/C4TwDgpgBAKghgawgZxgRgDzoHxQLyxoDcAUCQMYA2cyyUAYgPaNZoA0sATLgN4lQCoyYHGABLclABGcAE6sOMTlAgAPYBAB2AEzrwkqTDmwAKYGgBchDsE5WlASih8A9C8EfPX7z8EA9PwBaKE1GFVlZRll+QQBfEniSNygAVWQ4AHMICxImRgA6GVkTACI4Eo4AVgciKGSAUQiouhoVVUhyDW1c5kK5UvKOMpKauvcAOTCIJtkgA).

### 🙂 Expected behavior

No ts2302 error, `TakesT1<T1>` should use the `T1` generic from the `static bar()` method, rather than from the `Foo` class.
Repository: flutter
Issue: Add API for drawing shaped and laid out text
Labels: c: new feature,engine,a: typography,good first issue,P3,team-engine,triaged-engine

Use case: I have shaped and laid out text offline and would like to draw it at runtime without paying for the machinery of `ParagraphBuilder` and `Paragraph.build` again. In fact, because I shaped it offline, I only have glyph IDs for the font and _can't_ use the existing API.

Caveats: I'll have to make sure the version of the font I'm using is compatible with the version used at layout. 
Caveats: We need to make this API _not work_ for someone trying to draw text that has not been shaped and laid out.

Strawman API:

```
class GlyphRun {
  GlyphRun(this.fontVersion, this.familyName, this.fontSize, this.glyphs);

  final int fontVersion;
  final String familyName;
  final int fontSize;
  final Uint16List glyphs;
}

class Canvas {
  // Draws a run of glyphs
  void drawGlyphRun(GlyphRun run, Offset offset, Paint paint);
}
```

The API should fail if the actual font at runtime does not version match the font I created the run from. The paint should be applied as the foreground paint for the glyphs.

/cc @goderbauer @Hixie @justinmc @jason-simmons
Repository: pytorch
Issue: JIT support for `torch.__version__` & str comparison operations
Labels: oncall: jit,module: bootcamp

### 🚀 The feature, motivation and pitch

Currently using the standard string comparison operators with `torch.__version__` does not work in JIT, and this leads unnecessary code, and requires individuals to use classes instead of functions.


```
import torch

def test_version() -> bool:
    v = torch.__version__ >= "1.6.0"
    print(torch.__version__)
    return v

print(test_version())

jit_test_version = torch.jit.script(test_version)
print(jit_test_version())
```

Gives the following result:


```
1.10.0+cu111
True
1.10.0+cu111
False
```

I propose that JIT should support such comparison operations.

### Alternatives

Currently one needs to perform the version check in the initialization function of a class, if it's needed in the forward function.

### Additional context

_No response_
Repository: PowerToys
Issue: Function to create custom rules or formulas in the unit converter integrated in powertoys
Labels: Idea-Enhancement,Product-PowerToys Run,Needs-Triage,Run-Plugin

### Description of the new feature / enhancement

Most of the time, an experienced web developer needs to convert absolute measurements (px) to relative units that change according to the context (em, rem).

I suggest to include in the integrated unit converter of powertoys, the possibility to customize and create your own rules to convert one unit to another by means of mathematical formulas written by ourselves.

### Scenario when this would be used?

That's the best of all, it could be used for almost anything, from a web developer to convert from pixels to relative units (em or rem) quickly and not always going into the calculator, to a financial accountant creating his own formula to calculate ROI, all from powertoys quickly and easily.

### Supporting information

We would never again have to come to these sites to see the formula for such a thing, just set up the formula in powertoys and type in the data they ask for and that's it....
Easy and fast formula result

https://www.ninjaunits.com/converters/pixels/pixels-rem/
https://www.zoho.com/inventory/break-even-point-calculator/
https://www.calculator.net/roi-calculator.html

¡Thank you for building Powertoys! 🔥
Repository: neovim
Issue: Atomic commands for `ea`, `Ea`, `bi` and `Bi`
Labels: enhancement

### Feature already in Vim?

No

### Feature description

`I` and `A` shortcuts operate with line and they can be repeated using `.`, I would like to have the same shortcuts, which would operate with words, i.e `w` and `W`. Currently, I use `ea`, `Ea`, `bi` and `Bi`, none of them can be repeated with a dot command. Someone told me that `I` and `A` are simply `^i` and `$a` commands, which were made atomic. I though maybe its not hard to add `<A-i>`, `<A-I>`, `<A-a>` and `<A-A>` atomic commands for `ea`, `Ea`, `bi` and `Bi`? Or at least some kind of aliased atomic commands, which I could use in my mappings?

I have asked in stackoverflow.com if its possible to implement these shortcuts:
https://vi.stackexchange.com/questions/36462/how-to-append-to-the-end-of-word-with-one-key-stroke
https://vi.stackexchange.com/questions/36482/how-to-insert-to-the-beginning-of-a-word-with-one-key-stroke

But its only possible for `ea` and `Ea` with `ce<C-r>-` and `cE<C-r>-` commands and not possible for `bi`, `Bi`, even with reapeat.vim plugin help.
Repository: flutter
Issue: Migrate device lab android 64bit tests to use emulators
Labels: a: tests,team,platform-android,t: flutter driver,dependency: android,P2,c: tech-debt,team-android,triaged-android

The flutter recipes now support running android emulators. We currently have a large number of tests/tasks living in the `dev/devicelab` directory that depends on physical devices. Many of these tests can be moved to using emulators.

Running on emulators give us the flexibility of seamless scaling, reduced physical device demand/maintenance, downtime due to hardware issues. We will also be able to run the tests on more android API versions.

Drawbacks are each individual task may take longer to run since the emulator adds a significant startup time and tends to run slowly. However, due to increased parallelism, tasks no longer need to wait for free devices.

The list of tasks are in `dev/devicelab/tasks` and the tasks that run on `DeviceOperatingSystem.android` can be converted. This is because the recipes android emulator currently only supports 64bit versions of the emulator.

To properly support this, the recipes need to be redesigned to call executables in the framework rather than directly run the tests as the current sample emulator tests (Linux android views and Linux deferred components) does.