sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: internal compiler error: encountered incremental compilation error with predicates_of(core[460f]::cmp::PartialOrd)
Labels: I-ICE,T-compiler,A-incr-comp,C-bug

Related to #84970, I'm filling this because cargo asked nicely :)

### Code

Context: this is an excerpt from a roguelike game that uses Legion as its ECS lib. I guess the bug was there, since it's the only place I'm using `.partial_cmp()`. It crashed after I added the `.sort_by(distance)` part.

```Rust
    // Collect all entities into the player's FOV
    let mut entities = <(Entity, &Point, &Renderable, &Name, Option<&CombatStats>)>::query()
        .iter(world)
        .collect::<Vec<(&Entity, &Point, &Renderable, &Name, Option<&CombatStats>)>>();

    // Sort them by distance from the player
    entities.sort_by(|&a, &b| {
        DistanceAlg::Pythagoras
            .distance2d(*a.1, *player_pos)
            .partial_cmp(&DistanceAlg::Pythagoras.distance2d(*b.1, *player_pos))
            .unwrap_or(Ordering::Equal)
    });
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.54.0 (a178d0322 2021-07-26)
binary: rustc
commit-hash: a178d0322ce20e33eac124758e837cbd80a6f633
commit-date: 2021-07-26
host: x86_64-pc-windows-msvc
release: 1.54.0
LLVM version: 12.0.1
```

### Error output

```
thread 'rustc' panicked at 'Found unstable fingerprints for predicates_of(core[460f]::cmp::PartialOrd):
GenericPredicates { parent: None, predicates: [(Binder(TraitPredicate(<Self as std::cmp::PartialEq<Rhs>>), []),
C:\[redacted]\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\cmp.rs:936:43: 936:57
(#80706 (Binder(TraitPredicate(<Self as std::cmp::PartialOrd<Rhs>>), []),
C:\[redacted]\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\cmp.rs:936:1: 1041:2 (#0))] }',
/rustc/a178d0322ce20e33eac124758e837cbd80a6f633\compiler\rustc_query_system\src\query\plumbing.rs:620:9
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<summary><strong>Backtrace</strong></summary>
<p>

```
<sorry no backtrace, I cleaned before that>
```

</p>
Repository: flutter
Issue: FlutterDriver to continue testing after app restarts/crashes
Labels: c: new feature,tool,t: flutter driver,c: proposal,P3,team-tool,triaged-tool

Hello everyone,

Some e2e testing solutions (e.g. Appium) allow for writing integration tests in which you can natively crash the app and test to continue running in order to restart the app and check for any changes. For example: _triggering a native crash and checking if underlying native package generated a crash report on restart._

Currently, if the Flutter app is closed (in any way), seems like FlutterDriver also closes with it. I guess the FlutterDriver is attached to the same VM where the app is running.

It would be good to have a mechanism to keep the FlutterDriver alive even if the app closes, without receiving `Original error: ext.flutter.driver: (112) Service has disappeared`. Hopefully having this will also create a strategy for expecting app crashes – maybe tests will continue until a timeout even if the app stopped.
Repository: thefuck
Issue: Command Format
Labels: question

<!-- If you have any issue with The Fuck, sorry about that, but we will do what we
can to fix that. Actually, maybe we already have, so first thing to do is to
update The Fuck and see if the bug is still there. -->

<!-- If it is (sorry again), check if the problem has not already been reported and
if not, just open an issue on [GitHub](https://github.com/nvbn/thefuck) with
the following basic information: -->

The output of `thefuck --version` (something like `The Fuck 3.1 using Python
3.5.0 and Bash 4.4.12(1)-release`):

    The Fuck 3.31 using Python 3.9.2 and ZSH 5.8

Your system (Debian 7, ArchLinux, Windows, etc.):

    Debian

How to reproduce the bug:
  I was exploring the codebase and was wondering what is the argument format passed here in this code. 
From the docs i could figure out that it takes script, output and script_parts.
It would be a great help if someone can give an example of the command passed in the below function.

```
def match(command):
    if command.script_parts and '&&' not in command.script_parts and command.script_parts[0] == 'sudo':
        return False

    for pattern in patterns:
        if pattern in command.output.lower():
            return True
    return False
```

Thanks
Repository: flutter
Issue: Making NavigationRail scrollable
Labels: framework,f: material design,c: proposal,team-design,triaged-design

## Use case

By default, when a `NavigationRailDestination` inside a `NavigationRail` goes out of the viewport (e.g. the window is resized to be less than the destinations), it will overflow and cause the infamous yellow-and-black-striped error to occur. One way to fix this is to make the `NavigationRail` itself scrollable. Currently, the only way to do this is rather janky.

**Error-causing:**

```dart
Row(
  children: [
    NavigationRail(...),
    ...
  ]
)
```

**The "fix" that makes it scrollable:**

```dart
Row(
  children: [
    LayoutBuilder(
      builder: (context, constraints) {
        return SingleChildScrollView(
          child: ConstrainedBox(
            constraints: BoxConstraints(
              minHeight: constraints.maxHeight,
            ),
            child: IntrinsicHeight(
              child: NavigationRail(...)
            )
          )
        );
      }
    ),
    ...
  ]
)
```

This fix is mentioned in [this StackOverflow answer](https://stackoverflow.com/a/61876930/14021404) and is also used by [Flutter Gallery](https://github.com/flutter/gallery/blob/860b616cea37140e55ee23e92b2e4309ac9a698c/lib/studies/reply/adaptive_nav.dart#L179-L240). However, it is janky and cluttered. It even uses an `IntrinsicHeight` wherein the docs explicitly state that:

_In the [class constructor](https://api.flutter.dev/flutter/widgets/IntrinsicHeight/IntrinsicHeight.html):_
> This class is relatively expensive. Avoid using it where possible.

_In the [class itself](https://api.flutter.dev/flutter/widgets/IntrinsicHeight-class.html):_
> This class is relatively expensive, because it adds a speculative layout pass before the final layout phase. Avoid using it where possible. In the worst case, this widget can result in a layout that is O(N²) in the depth of the tree.

I want to avoid using widgets that the docs itself says not to use. However, I cannot find any other way to make it scrollable to avoid the infamous yellow-and-black-striped error.

## Proposal
I propose a simple solution to this problem:
```dart
Row(
  children: [
    NavigationRail(
      scrollable: true,
      ...
    ),
    ...
  ]
)
```

Not only does this makes things easier and intuitive, but is also easily customizable and less clutter.
Repository: godot
Issue: VR iOS upside down
Labels: bug,platform:ios,topic:rendering,topic:xr,topic:3d

### Godot version

3.3.stable

### System information

iOS14, iPhone 6s, GLES2 + GLES3, Xcode 12.5.1, macOS 11.3.1

### Issue description

When testing the native mobile VR interface on an iPhone, the 3D content appears upside down. It doesn't matter what the orientation settings are (either inside Godot or Xcode), the 3D content is still upside down. For some reason, any 2D nodes overlaying the 3D content do have the right orientation.

The same code works fine on Android.

### Steps to reproduce

Create or open any sample project with mobile VR and build it with Xcode for iOS. Issue is present in GLES2 as well as GLES3.

### Minimal reproduction project

[https://gabrielvictor.itch.io/godot-mobvr](https://gabrielvictor.itch.io/godot-mobvr)
Repository: TypeScript
Issue: A series of nested loops, undefined and `in` checks results in incorrect implicit any
Labels: Needs Investigation,Rescheduled

# Bug Report

A series of nested loops, undefined and `in` checks results in incorrect implicit any.

I don't know what is really causing this. It seems this might be a weird edge case where type inference fails?

### 🔎 Search Terms

noImplicitAny, inference

### 🕗 Version & Regression Information

This changed between versions 4.3.5 and 4.4.2

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgLIE8DyAjAVsgbwChllgATAfgC5kBnMKUAcwG4iBfIo8iBAGzhQUANyHIA9nj5g6tDDlwBtALoAfAK4heMUBHLsiwGMgAUU3DLoBKQiWQwJUMwgkgGyAPqSTq28VJSV3cwZABbOAAHWgIlAGsIdGoGJhBmFVoUlk1tCF0QfQ5kAF5CDkNAhycXNw8LH0lpBFl-e0rgjwoSxtwAOgoAQnZK0mMzLtBwqNaRwI6Jfghe-glmUwprYZGuSp3kLg4gA)

### 💻 Code

```ts
interface MyObj { id?: string; }
declare var objects: MyObj[]|undefined;

if (objects) {
  for (const _ of []) {
    const map: {[key:string]: string|undefined} = {};

    for (const obj of objects) {
      //       ~~~ 'obj' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)
      const id = obj.id!;
      //    ~~ 'id' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)
      if (id in map) {
        console.log(id);
      }
    }
  }
}
```

### 🙁 Actual behavior

In version 4.4.2 the above code fails to compile with the 2 errors.

Any of the following changes cause it compile without errors:

- Remove `|undefined` from the `objects` type.
- Remove the outer `for (const _ of [])` loop
- Remove `if (id in map)`
- Add a type annotation to the id variable: `const id: string = obj.id!`

### 🙂 Expected behavior

The code should compile without errors as it did in version 4.3.5.
Repository: flutter
Issue: Cannot sign in with google with unverified scopes on Android
Labels: platform-android,p: google_sign_in,package,P2,team-android,triaged-android

When adding restricted scopes to unverified oauth, google sign in loads forever on Android.  Works in iOS. 

Steps to reproduce: 
1) Add unverified restricted scope in Google Console
2) Add unverified restricted scope in app
3) Sign in with Google on Android (result: loads forever)

Unverified scopes should show unverified oauth screen and allowed to proceed with sign in.
Repository: pytorch
Issue: PyTorch public API cleanup
Labels: high priority,triaged,better-engineering

## 🚀 Feature

We should clean up things that are exposed in the public torch (and other) namespaces but aren't actually intended to be exposed. Examples include torch.batch_norm/torch.group_norm (we only document F.batch_norm and F.group_norm, noticed by @samdow ) and when @soulitzer refactored gradcheck and noted that folks were directly calling gradcheck helper functions.

## Motivation

Tensor extension writers are confused by functions like `torch.batch_norm` because they are overridable but do not appear in the PyTorch docs. Furthermore, these functions can be subtly different from their documented variants (F.batch_norm).

## Pitch

Step 1: Make it so that new functions added to PyTorch are private by default
- We should move all of PyTorch Python source files into a `_src` folder to indicate that they are all private and expose only the APIs that are meant to be exposed. This way, if a dev adds a new helper function inside a file in the _src directory, they are not accidentally exposing it for users to see.
- PyTorch codegenned operators should have the same treatment: they should be a part of a private namespace initially and a user who is adding a new operator must manually expose it.

Step 2: Deprecate all the things we don't want to support
- like torch.batch_norm, torch.group_norm

## Alternatives

N/A


cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411
Repository: pytorch
Issue:  Complex recurrent layers produce NaN as grad 
Labels: module: nn,triaged,module: complex,module: NaNs and Infs

## 🐛 Bug

I am trying to run the most basic single-layer RNN with complex inputs on the current nightly build of PyTorch (1.10.0-CPU). The problem is that the gradient always evaluates to NaN. I’ve tried all recurrent layers (RNN, GRU, LTSM) with the same result.

## To Reproduce

Here is the model:

```
class CRNN(torch.nn.Module):
    def __init__(
        self,
        input_dim: int,
        output_dim: int,
        **kwargs
    ):
        super().__init__(**kwargs)
        self.model = torch.nn.RNN(input_dim, output_dim,
                                  batch_first=True,
                                  dtype=torch.cfloat)
        self.loss = torch.nn.L1Loss()
        self.optimizer = torch.optim.Adam(self.parameters())

    def forward(self, x):
        x = torch.unsqueeze(x, 0)
        return self.model(x)[0]

    def fit(self, x, y):
        self.optimizer.zero_grad()
        z = torch.squeeze(self(x), 0)
        loss = self.loss(z, y)
        loss.backward()
        self.optimizer.step()
        return loss.item()
```

I used `torch.autograd.set_detect_anomaly(True)` and it gave the following results:
- For RNN, the first NaN appears in `AddmmBackward`
- For GRU and LSTM, the first NaN appears in `L1LossBackward`

## Expected behavior

The gradients should be finite

## Environment

 - PyTorch Version (e.g., 1.0): 1.10.0
 - OS (e.g., Linux): Linux
 - How you installed PyTorch (`conda`, `pip`, source): conda
 - Python version: 3.8
 - GPU models and configuration: Currently running on CPU

cc @albanD @mruberry @jbschlosser @ezyang @anjali411 @dylanbespalko @Lezcano @nikitaved
Repository: pytorch
Issue: Uniformly test that defaulted Tensor arguments appropriately handle __torch_function__
Labels: module: tests,triaged,module: __torch_function__

Devise a way to test all cases of https://github.com/pytorch/pytorch/issues/63435 are done correctly

This is a bit nontrivial because we don't "know" which arguments take Tensors versus which do not. Maybe can get it out of type annotations? Note that you also need to test each argument position individually, because otherwise you might trigger `__torch_function__` anyway even if the particular argument you were interested in didn't actually get checked.

cc @mruberry @VitalyFedyunin @walterddr @hameerabbasi @rgommers @peterbell10
Repository: TypeScript
Issue: A[] form works, but Array<A> breaks
Labels: Bug,Help Wanted,Effort: Moderate

# Bug Report

### 🔎 Search Terms

`site:github.com inurl:/microsoft/TypeScript/issues/ Array` `[]` `normalization` `syntactic sugar`

### 🕗 Version & Regression Information

This [works in 3.9.7](https://www.typescriptlang.org/play?ts=3.9.7#code/C4TwDgpgBASgPAYQHxQLxQNoIDRQHQHzIYC6JUAPlAHYCuAtgEYQBOA3ALABQokUAyohTosuAngCCLFgEMQcQciTkqdJq05duAYwD21AM7AoLAFyw4AIhkATG5eGZrdy7gBMuAIwlNew8YNzQWd7RwwQ1ygPKG9NIA), [broke in 4.0.5](https://www.typescriptlang.org/play?ts=4.0.5#code/C4TwDgpgBASgPAYQHxQLxQNoIDRQHQHzIYC6JUAPlAHYCuAtgEYQBOA3ALABQokUAyohTosuAngCCLFgEMQcQciTkqdJq05duAYwD21AM7AoLAFyw4AIhkATG5eGZrdy7gBMuAIwlNew8YNzQWd7RwwQ1ygPKG9NIA), and [remains broken in Nightly](https://www.typescriptlang.org/play?ts=Nightly&ssl=1&ssc=1&pln=3&pc=1#code/C4TwDgpgBASgPAYQHxQLxQNoIDRQHQHzIYC6JUAPlAHYCuAtgEYQBOA3ALABQokUAyohTosuAngCCLFgEMQcQciTkqdJq05duAYwD21AM7AoLAFyw4AIhkATG5eGZrdy7gBMuAIwlNew8YNzQWd7RwwQ1ygPKG9NIA).

- This changed between versions 3.9.7 and 4.0.5

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/C4TwDgpgBASgPAYQHxQLxQNoIDRQHQHzIYC6JUAPlAHYCuAtgEYQBOA3FJ1wPTdQDuAexYBrAM64AhmKgQAHpADGwCABMAsAChQkKAGVEKdFlwE8AQRYtJIOAeRJyVOk1YdeUAGaSAlgBsZWmp5JRVVPxAoAFooMQALQVo-VQFhESgfVQhqYB9FST8IqElqFOZYkBzJZTzY2gBzSRYvYShgOOhPYXpWLS1FQWoxYCgWAC5YOAAiSVVVKaNMGbmp3AAmXABGEjZ+weHYiYNl+cWME9WoDaht3c0gA)

### 💻 Code

```ts
type R<C> = [C, ...R<C>[]] | number;      // works, as expected
type S<C> = [C, ...Array<S<C>>] | number; // fails unexpectedly - should work identically

const r: R<"add"> = ["add", 2, 1];
const s: S<"add"> = ["add", 2, 1];
```

### 🙁 Actual behavior

The `A[]` form in the first line works, but the otherwise-identical `Array<…>` form on the second line breaks with the warning `Type alias 'S' circularly references itself.(2456)`.

### 🙂 Expected behavior

Both of these should work, and behave identically, as they are merely syntactic sugar for each other.
Repository: rust
Issue: Tracking Issue for `tcp_linger`
Labels: T-libs-api,C-tracking-issue,A-io

Feature gate: `#![feature(tcp_linger)]`

This is a tracking issue for the `TcpStream::linger` and `TcpStream::set_linger` methods that get/set the `SO_LINGER` option on the socket. Behavior works as expected on both Unix and Windows.

### Public API

```rust
impl TcpStream {
    pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()>;
    pub fn linger(&self) -> io::Result<Option<Duration>>;
}
```

### Steps / History

- [x] Implementation: #88495
- [ ] Final comment period (FCP)
- [ ] Stabilization PR

### Unresolved Questions

- Should enabling lingering and setting the duration be split out into two operations?
Repository: flutter
Issue: [Flutter Tools] support recursively installing packages
Labels: c: new feature,tool,c: proposal,P2,team-tool,triaged-tool

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case

<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

As a developer, there are often times when a single project has nested packages (eg: [photobooth](https://github.com/flutter/photobooth)). Running `flutter packages get` in the root directory only installs the dependencies for the root application and the dependencies of the nested packages are not installed.

The [VSCode Extension](https://github.com/Dart-Code/Dart-Code) handles this by prompting if you'd like to install all packages and it will run `flutter packages get`/`flutter pub get` respectively in each nested package.

## Proposal

<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->

It would be great if the flutter cli supported a `--recursive` flag on the `packages` command which would allow developers to install the current project's dependencies as well as any nested projects' dependencies.

### Usage

```sh
# Install dependencies for the current project (no changes required)
flutter packages get

# Install dependencies for the current project and all nested projects
flutter packages get --recursive
```
Repository: react
Issue: Bug: Nested ReactDOMServer.renderToString calls cause React hooks to throw invalid hook exception
Labels: Type: Bug,Component: Server Rendering,Type: Needs Investigation

When you make a nested ReactDOMServer.renderToString call (i.e. call ReactDOMServer.renderToString from within a component rendered using ReactDOMServer.renderToString), you can not use any hooks after the second call. Custom hooks work, but React hooks throw a invalid hook call error.
Not sure if this is an acceptable use case for ReactDOMServer, this is how a current project is setup, I am just making some additional hook calls and encountered this error. I have replicated the issue on a fresh React app with nothing else.

React version: 17.0.2

## Steps To Reproduce

1. Createa a component, ComponentA
2. In ComponentA make a call to ReactDOMServer.renderToString, and then use a React hook (useState, useContext etc.)
3. In the main app render ComponentA via ReactDOMServer.renderToString (ReactDOMServer.renderToString(<ComponentA />)

Link to code example: https://codesandbox.io/s/sweet-kate-etr68
## The current behavior
Throws an invalid hook call exception

## The expected behavior
Work as usual, hooks working as normal.
Repository: terminal
Issue: conditional keybindings (alternate screen buffer)
Labels: Issue-Feature,Area-Settings,Product-Terminal

# Description of the new feature/enhancement

there are situations where it would be useful to *conditionally* bind/unbind keys: e.g. the default find `{ "command": "find", "keys": "ctrl+shift+f" }` behavior to search all output text is usually undesirable in editors like emacs.
similarly, other common commands like copying and pane management* can be inappropriate in certain situations, where one would prefer those keys to be unbound from the terminal actions.
(*suspects this one may be up to personal preference/workflow)

the reverse situation also exists: a common hack is to have the terminal remap certain modifier sequences to sequences that can be interpreted safely. consider the mapping:
`{ "command": { "action": "sendInput", "input": "\u001b[27;5;73~" }, "keys": "ctrl+i" }`
where the processed sequence can be understood by emacs and friends for keybinding.

so a proposal is to be able to designate conditional activation for keybindings.

<details> 
  <summary>motivating failed workaround</summary>
   a while back, tried having an settings-emacs.json and a settings-normal.json that on activate/suspend get copied to settings.json. this... technically works... but is bad for a number of reasons, obviously. there's a lot of redundancy, every change has to be made twice, settings editing can't be done from the gui (it'll be overwritten), the swap condition itself has many flaws and inevitably breaks with multiple windows/tabs/panes...
</details>

# Proposed technical implementation details (optional)

for this use case, an acceptable solution is to just have keybinding groups and/or properties that can respect alt buffer state.
but maybe a more generic solution is useful? to be able to listen for arbitrary control sequences. 'enable these commands after CSI 104;93m and disable after CSI 0m.'
...hopefully there are no situations where one needs hacks like that. regardless, it would be very powerful.

can't remember if per-profile bindings are already possible. ignoring the overkill option, it would be good to at least detect profile and altbuf state.

---
maybe duplicate of but proposes alternate/more general solution to:
#9045 ("support alt buffer correctly and pass keys through")
 
sort of related: 
#9534 
#7006
#5857