sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Error with static lifetime inference in consts when using types with drop implementation
Labels: A-lifetimes,A-destructors,T-compiler,C-bug,A-const-eval

[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=44020503c30e357166a2ad620627a88a)

The following code

```rust
pub struct Foo<'a, B: ?Sized>(&'a B);

struct Bar;
impl Drop for Bar { fn drop(&mut self) {} }

// work
const BAR0: Bar = Bar;
const BAR1: &'static [Bar] = &[Bar];
// this is equivalent to the not working examples, but works
const BAR2: Foo<'static, [Bar]> = Foo(BAR1);
// don't work
const BAR3: Foo<'static, [Bar]> = Foo(&[Bar]);
const BAR4: Foo<'static, [Bar]> = Foo(&[Bar] as &'static [Bar]);
```
results in these errors
```rust
error[E0493]: destructors cannot be evaluated at compile-time
  --> src/lib.rs:12:40
   |
12 | const BAR3: Foo<'static, [Bar]> = Foo(&[Bar]);
   |                                        ^^^^^- value is dropped here
   |                                        |
   |                                        constants cannot evaluate destructors

error[E0716]: temporary value dropped while borrowed
  --> src/lib.rs:12:40
   |
12 | const BAR3: Foo<'static, [Bar]> = Foo(&[Bar]);
   |                                   -----^^^^^-
   |                                   |    |    |
   |                                   |    |    temporary value is freed at the end of this statement
   |                                   |    creates a temporary which is freed while still in use
   |                                   using this value as a constant requires that borrow lasts for `'static`

error[E0493]: destructors cannot be evaluated at compile-time
  --> src/lib.rs:13:40
   |
13 | const BAR4: Foo<'static, [Bar]> = Foo(&[Bar] as &'static [Bar]);
   |                                        ^^^^^                  - value is dropped here
   |                                        |
   |                                        constants cannot evaluate destructors

error[E0716]: temporary value dropped while borrowed
  --> src/lib.rs:13:40
   |
13 | const BAR4: Foo<'static, [Bar]> = Foo(&[Bar] as &'static [Bar]);
   |                                       -^^^^^------------------- temporary value is freed at the end of this statement
   |                                       ||
   |                                       |creates a temporary which is freed while still in use
   |                                       type annotation requires that borrow lasts for `'static`
```

`BAR2` is semantically the same as `BAR3` and `BAR4`, but while `BAR3` and `BAR4` don't compile, `BAR2` does. That can be used as a workaround for now.
Repository: pytorch
Issue: Pytorch V1.1 runs OK, but Pytorch v1.5 to 1.9 run wrong
Labels: needs reproduction,module: autograd,triaged,module: regression

Dear admin,

I use pytorch V1.1 to run the code, the code runs correctly. When I update pytorch 1.5 or 1.9, something is wrong as below. What is the difference between pytorch v1.1 and v1.5 later?

The errs are below:
```javascript
Traceback (most recent call last):
  File "F:/workdir/pycharm/dev/pafnucy_1/main.py", line 109, in <module>
    loss.backward(retain_graph=True)
  File "D:\soft\Anaconda3\envs\pytorch36\lib\site-packages\torch\_tensor.py", line 255, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "D:\soft\Anaconda3\envs\pytorch36\lib\site-packages\torch\autograd\__init__.py", line 149, in backward
    allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
RuntimeError: Function AddmmBackward returned an invalid gradient at index 1 - got [120, 6912] but expected shape compatible with [120, 87808]
```


Part of code I used in this test:
```javascript
   g_step = 0
    for epoch in range(args.num_epochs):
        print(f'epoch {epoch}')
        data_loader = data_loaders['training']
        tbar = tqdm(enumerate(data_loader), total=len(data_loader), disable=not SHOW_PROCESS_BAR)
        for idx, (data, target) in tbar:
            model.train()
            if args.fp16:
                data = torch.HalfTensor(np.vstack(data))
                target = torch.HalfTensor(target)
            else:
                data = torch.Tensor(np.vstack(data))
                target = torch.Tensor(target)

            data = data.to(device)
            target = target.to(device)

            optimizer.zero_grad()
            output = model(data).cuda()
            loss = loss_function(output.view(-1), target.view(-1)).cuda()
           # with torchsnooper.snoop():
            loss.backward(retain_graph=True)
            optimizer.step()

            tbar.set_description(f' * Train Epoch {epoch} '
                                 f'Loss={loss.item() / (args.batch_size * len(args.rotations)):.3f}')

            if (g_step + 1) % 1000 == 0:
                writer.add_scalar(f'training loss', loss.item() / (args.batch_size * len(args.rotations)),
                                  global_step=g_step)
                writer.add_scalar(f'validation loss',
                                  val(model, data_loaders['validation'], loss_function, device, len(args.rotations)),
                                  global_step=g_step)

                e = test(model, data_loaders['test'], loss_function, device)
                for key in e:
                    writer.add_scalar(key, e[key], global_step=g_step)

            g_step += 1

``` 

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7
Repository: react
Issue: Bug: Picture elements fail to update to appropriate source image on window resize in Safari
Labels: Type: Bug,Browser: Safari,Component: DOM,Status: Unconfirmed

Using Safari 14.0.3 on macOS Big Sur 11.2.2, `<picture>` elements rendered using React fail to update to the correct image source when the window is resized.

If fixing this bug would be considered a good first ticket and some guidance is provided, I'd be happy to fix it.

React version: 17.0.2

## Steps To Reproduce

1. Resize window across picture's breakpoint (768px)

Link to code example: [https://codesandbox.io/s/dazzling-nobel-bh3gh](https://codesandbox.io/s/dazzling-nobel-bh3gh)

## The current behavior

The first image (rendered using React) continues to render the initial source image.

## The expected behavior

The first image should behave the same as the second (rendered statically inside index.html) and switch to the correct source image when a media condition applies.
Repository: rust
Issue: proc macro invoked by normal macro has weird call_site
Labels: A-macros,T-lang,T-compiler,C-bug,T-libs,A-proc-macros

When supplying a proc macro invocation to a normal macro as `tt`, `Span::call_site()` seems to be wrong.

I tried this code:
https://github.com/anuejn/proc_macro_scope_confusion/tree/125356cf4b6e7d54930031710cb3db20307b4b71

I expected to see this happen: 
The code compiles without error since the call-site of the proc macro lays in the code generated by the normal macro.

Instead, this happened: 
The call-site of the proc macro points to the invocation of the normal macro, leading to symbols being resolved in the wrong scope and generating a borrow-checker error. 

### Meta

`rustc --version --verbose`:
```
rustc 1.55.0-nightly (a1411de9d 2021-06-26)
binary: rustc
commit-hash: a1411de9de38e0fed728874580218338160eb185
commit-date: 2021-06-26
host: x86_64-unknown-linux-gnu
release: 1.55.0-nightly
LLVM version: 12.0.1
```
Repository: storybook
Issue: Vite + Storybook 6.3 + Jest: "global is not defined"
Labels: bug,builder-vite

**Describe the bug**
I am trying to get Vite + Storybook 6.3 working with some existing stories. These stories use `jest.fn()` as mocks. I previously added this in `preview.js` to get `jest.fn()` working within storybook:
```
import jest from "jest-mock";
window.jest = jest;
```

But when using the Vite integration I am now getting an error when running storybook:
```
Uncaught ReferenceError: global is not defined
    at ../node_modules/jest-mock/build/index.js (index.js:948)
    at __require2 (chunk-IHTDASF6.js?v=3b66b68d:17)
    at dep:jest-mock:1
```

**To Reproduce**
I am trying `vite` with storybook 6.3 and npm 7.19 workspaces. My repro repo is here: https://github.com/adiun/vite-monorepo:
1. Ensure you have `npm 7.19` installed for the workspaces functionality
2. In the root, run `npm i`
3. In the `app` folder, run `npm run storybook`. 
4. In the browser console for storybook you will see:
```
Uncaught ReferenceError: global is not defined
    at ../node_modules/jest-mock/build/index.js (index.js:948)
    at __require2 (chunk-IHTDASF6.js?v=3b66b68d:17)
    at dep:jest-mock:1
```

**System**
```
Environment Info:

  System:
    OS: macOS 11.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    npm: 7.19.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Edge: 91.0.864.48
    Firefox: 88.0.1
    Safari: 14.1
  npmPackages:
    @storybook/addon-docs: 6.3.0 => 6.3.0 
```
Repository: angular
Issue: No documentation on running ngc (@angular/compiler-cli)
Labels: area: compiler,P3

Refiling #29623 as the bytes apparently have rotted.

There is zero documentation on how to run the Angular CLI compiler.

* Nothing on https://angular.io, including https://angular.io/guide/aot-compiler
* No help from the executable itself; ngc -h and ngc --help hang forever.
* No README in @angular/compiler-cli package
* No README at package homepage https://github.com/angular/angular/tree/master/packages/compiler-cli

ngc is probably the first undocumented compiler in history.
Repository: godot
Issue: Parts of editor not visible when adding a TextEdit control
Labels: bug,platform:windows,topic:rendering,needs testing,topic:2d

### Godot version

3.3.2.stable.official

### System information

Windows 7 GLES2 Intel(R) Q45/Q43 Express Chipset Batching On

### Issue description

I created a new project and was making a UI scene. I added some containers and went to add a `TextEdit`. When I added it, suddenly parts of the editor got their colors turned to the default 2d scene background color. Ctrl + Z (to remove TextEdit) makes it all good again.

BEFORE:
![image](https://user-images.githubusercontent.com/85806407/123562535-45640a00-d77d-11eb-8f97-b54367b030bb.png)

AFTER:
![image](https://user-images.githubusercontent.com/85806407/123562550-590f7080-d77d-11eb-8dda-31cdf3398587.png)

Menus are still clickable just the toolbar buttons aren't visible.
When it first happened, I tried to quit to project list and reopen project. No luck.

I did some testing afterwards and found that zooming in to the UI scene fixes it.

Using just the mouse wheel, the zoom level that is ok:
![image](https://user-images.githubusercontent.com/85806407/123562605-bdcacb00-d77d-11eb-8043-2493e1aa0bf2.png)

I also tried to close editor and restart it. No luck.

I did some more testing and found out the zoom may not have exactly fixed it.
Basically, if a certain part of the left side of the scene is visible, it will cause the issue and it only happens in the UI scene.
___
Console:
![image](https://user-images.githubusercontent.com/85806407/123562740-9f190400-d77e-11eb-9119-e2d8969e65a8.png)
That error is always visible for me tho since the beginning when I started using godot. It is what prevents me from making 3d games. If it helps, godot says my GPU drivers don't support GLES3.

### Steps to reproduce

1. Create a new GLES2 Project
2. Add a 2d scene and save it
3. Add a user interface scene with a HBoxContainer containing a VBoxContainer
4. Add a TextEdit to the VBoxContainer

### Minimal reproduction project

_No response_
Repository: pytorch
Issue: PyTorch's last 1 year update became unfriendly due to the lack of examples
Labels: module: docs,triaged

PyTorch updates should add more base layer and project examples rather than deploying APIs. C ++ and OnNX are more suitable for inference deployment.

For example, the PaddlePaddle has Gather_nd, Scatter_nd, Slice layer, and PyTorch does not.

Example of the project, the paddlepaddle at https://github.com/PaddlePaddle/PaddleNLP/tree/develop/examples introduces how to use layer, but pytorch example very lack, It takes a lot of time for developers to learn how to use layers.

Until now, I can't find an example of PyTorch's Transformer Layer usage on GitHub.

cc @brianjo @mruberry
Repository: pytorch
Issue: How to release CPU memory cache in Libtorch JIT ?
Labels: oncall: jit

## ❓ Questions and Help
Hi every one, I would like to know to release CPU memory cache in Libtorch JIT? If there is no such way, can I set percentile of maximum memory used as cache ?  And I want to know if each torchscript::jit::module has its own memory cache , or all modules share one global memory cache ? Thanks.


cc @gmagogsfm
Repository: transformers
Issue: A model or a config like 'transformer_iwslt_de_en' for machine translation
Labels: New model

# 🌟 New model addition

Does huggingface have some models like `transformer_iwslt_de_en` or `transformer_wmt_en_de`  in fairseq for machine translation? 

I plan to write a model for machine translation on huggingface. It would be great to be able to compare directly with the baseline model on huggingface.

@patil-suraj
Repository: pytorch
Issue: Fail to build with gcc11
Labels: module: build,triaged,module: xnnpack

The error message says
```
pytorch/third_party/XNNPACK/src/xnnpack/intrinsics-polyfill.h:27:6: error: conflicting types for '_mm_storeu_si32'; have 'void(const void *, __m128i)'
```

https://github.com/google/XNNPACK/commit/042cdaf1c24c675fca5e79eb4d2665839d7df2c2

It seems that this commit fixed the compile issue.

cc @malfet @seemethere @walterddr
Repository: opencv
Issue: Cmake Could NOT find CUDNN
Labels: question (invalid tracker),category: build/install

I wanted to use cuda to speed up opencv, but during the cmake process cudnn could not be found:

**_NVIDIA CUDA:                   YES (ver 11.3, CUFFT CUBLAS FAST_MATH)
    NVIDIA GPU arch:             70 75
    NVIDIA PTX archs:

  cuDNN:                         NO_**

I have merged the bin, include and lib folders together. And I have also passed the bandwidthTest. 

Please give some suggestions to me, thx.
Repository: angular
Issue: No documentation about way critical css inlining works.
Labels: P3,area: docs

### Description
There is lack of information about that how the critical css inlining works, what kind of styles getting inlined, on which styles we should focus to get the best results. From our research we have figure out that only styles to elements which are within index.html are inlined. Is that expected behaviour?
Repository: flutter
Issue: Nonce parameter is missing in Google SignIn?
Labels: c: new feature,p: google_sign_in,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

## Use case

My application requires nonce verification.

In web browser - I can attach "clientid=xxx..&nonce=abcd123..." as query parameter to google auth url .

Google sign in returns "code" -> processing the code returns access token and idToken

So that i can get & verify the nonce value from idToken.

But nonce key is missing in idToken returned from flutter google SignIn. (because there is no way to attach nonce key to GoogleSignIn())

## Proposal

### Is there any way to add "nonce" value to GoogleSignIn();
Repository: go
Issue: x/crypto/ssh: return error if other side version is older
Labels: NeedsFix

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16.5 linux/amd64
</pre>

### Does this issue reproduce with the latest release?
yes


### What operating system and processor architecture are you using (`go env`)?

linux amd64

### What did you do?
Dial to an SSH device with SSHv1 on board.
<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?
An error which says that SSHv1 and SSHv2 incompatible


### What did you see instead?
That error: `ssh: handshake failed: ssh: invalid packet length, packet too large`

---

To get this, in [readVersion func](https://github.com/golang/crypto/blob/master/ssh/transport.go#L311), add check like this before return version (it's very close to how paramiko does that):
```go
version := bytes.Split(versionString, []byte("-"))[1]
// RFC 4253, section 5.1 says that version '1.99' used to
// identify compability with older versions of protocol.
if !bytes.Equal(version, []byte("1.99")) && !bytes.Equal(version, []byte("2.0")) {
    return nil, fmt.Errorf("ssh: incompatible versions (%s and 2.0)", version)
}
```

Also, as I understand, RFC4253, section 5.2 says that client with newer version should close the connection to the older server when it happens.

I try to can send it to Gerrit with a test if you want.

Thanks.
Repository: godot
Issue: Mono errors with exported variables
Labels: bug,needs testing,topic:dotnet

### Godot version

3.3.2 stable mono

### System information

w10 64

### Issue description

Two errors I get when pressing "build".
![Captura](https://user-images.githubusercontent.com/19652075/123618003-147ce700-d808-11eb-94e4-5939d4b82863.PNG)

![Captura](https://user-images.githubusercontent.com/19652075/123618164-3aa28700-d808-11eb-8301-4bc14862c893.PNG)

Due to these errors, some of my exported variables do not appear in the editor.
This has crashed my project because I don't have access to some exported variables and misbehaviors occur in some items / enemies etc ...

A bit strange, if I comment this line in one of my scripts:
![Captura2](https://user-images.githubusercontent.com/19652075/123617943-07f88e80-d808-11eb-8c28-8b4993805602.PNG)

"Unicode error: invalid skip" message does not appear
Likewise, that exported variable is never shown in the editor.

[2021-06-28_12.06.29_6532.log](https://github.com/godotengine/godot/files/6725358/2021-06-28_12.06.29_6532.log)


### Steps to reproduce

...

### Minimal reproduction project

_No response_
Repository: TypeScript
Issue: Narrowing types with private functions with `this` return type fails
Labels: Needs Investigation,Rescheduled

# Bug Report

I found that a generic type may be evaluated as incompatible while in fact it should be compatible. In my particular case I have    a few generic types / classes that have a type argument constrained to `MyClass`.
I also have a conditional type with a generic argument that is "less" constrained to a union type of `MyClass` and a different class that has a generic.
```ts
// Conditional type with a generic constrained to either MyClass or something else
type ConditionalType<T extends MyClass | string> =
  T extends MyClass ? MyGenericType<T> : T;
```
In the given constellation I get the following error:
```
Type 'MyClass & T' does not satisfy the constraint 'MyClass'.
  Property 'fn' is missing in type 'MyClass & T' but required in type 'MyClass'.(2344)
```

I found that these prerequisites have to be met to reproduce the error:
1. The class (`MyClass`) that we constrain the generics arguments to has a function that returns a `this` type.
  *Edit: Or no type annotation, no matter what the inferred type is. Other return type annotations, e.g. `: string` work.*
2. This function is either `protected` or `private`.

### 🔎 Search Terms

this type, generic, conditional types

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about: seems to me that none apply.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?target=5&ts=4.3.4#code/PTAEBUAsFNQYwDYEMDOLQBcD28sDsUMAnJASz0x3MxlAHNo9ojS5MBPAB2hQFgAoRKnQBZdgGFkaUAG8BoXAWIBXONiIAKTsoBGCVqDxIAttABcoQizx0AlLIC+A+aE5EsGaGugATUADM8DVsLDEhSdDl+BQUiaAxlIgowiIBuFyd+TIEQUABBekZmAwwuWAB3UjDQJA5uGqI6ZVM8DEUrMiY-bFAxSWEBUvqxAHEiljhwMoAecFBoAA9PPB9RCSkUAD5QAF4IdP4csHF8HyrSfCQEOoqqyBrCpgn24k7fSnm75l714VAsIiWLCmFI2eYIFDQQZlUAnFbnS4IKbcWbzJaMVY-frSAA+lmI5Do2x2Ljmi2WmL6G1AAH4fmMnqxkdBZtsLOBUkA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
// The class to constrain to in the generic types
class MyClass {
  constructor(public name: string) {}

  protected fn(): this {
    return this;
  }
}

// A generic type with a type argument constrained to MyClass
type MyGenericType<T extends MyClass> = T;

// Conditional type with a generic constrained to either MyClass or something else
type ConditionalType<T extends MyClass | string> =
  T extends MyClass ? MyGenericType<T> : T;
```

### 🙁 Actual behavior

Although the condition in the mapped type constrains the given type to extend `MyClass` it is not compatible as the type here evaluates to `MyClass & T`.

### 🙂 Expected behavior

I would expect that the condition in the type narrows the type as given in the condition.
Repository: TypeScript
Issue: Implement type Require to set specified Optional properties in an interface as Required
Labels: Suggestion,Awaiting More Feedback

# Suggestion
TS interfaces such as `Omit, Pick` are doing great job helping us re-use current interfaces rather than re-writing them. One interface that I needed today was one to help me set specific property of another as `Required`. I did my search and it seems such a thing is not implemented. So, I tried and came up with this:
```typescript

type Require<T, K extends keyof T> = T & { [P in K]: Required<P> };

interface IOptionalProps {
  prop1: string; // required by default
  prop2?: string // optional by default
  prop3?: string // //
}

const foo: Require<IOptionalProps, 'prop2'> = { prop1: 'foo', prop2: 'foo', }; // prop2 can't be left behind
const foobar: Require<IOptionalProps, 'prop2'> = { prop1: 'baz', prop2: 'baz', prop3: 'baz', }; //all props can't be left behind
```

## 🔍 Search Terms

- interface require
- interface required
- transform optional required

## ✅ Viability Checklist
My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion

- Review the provided snippet.
- Add it to TS if it goes well with the TS.

## 📃 Motivating Example

Provided as part of the suggestion.

## 💻 Use Cases

Provided as part of the suggestion.
Repository: flutter
Issue: [in_app_purchase] Incomplete documentation 
Labels: d: api docs,p: in_app_purchase,package,team-ecosystem,P2,triaged-ecosystem

Hi,

I am missing documentation for in_app_purchase behaviour such as:

1) What happens if subscription is auto-renewed a) do I have to restore via ```PurchaseStatus.restored``` or new purchases will arrive via ```PurchaseStatus.purchased```
2) If new purchases will arrive via ```PurchaseStatus.restored``` on subscription renewal but app is turned off? Will it be triggered upon turning app on?
3) Should I run validate expiration date of all existing subscriptions on every app start?