sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Confusing error when a zero-parameter React component is given a parameter
Labels: Suggestion,Experience Enhancement

# Bug Report

When you try to pass a param using JSX to a component that doesn't take any params, you get a confusing message about `IntrinsicAttributes`. When you pass in a really complicated type, this error can easily get lost in the noise from the type itself.

Context: [tweet](https://twitter.com/danvdk/status/1359938481254846473) in response to @mjbvz's request for confusing error messages.

### 🔎 Search Terms

- IntrinsicAttributes
- does not exist on type IntrinsicAttributes
- 2322

maybe related to #33476 and #35253

### 🕗 Version & Regression Information

Version 4.1.2 (full details below)

<details><summary><b>Compiler Options</b></summary>

```json
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": 2,
    "target": "ES2017",
    "jsx": "React",
    "module": "ESNext"
  }
}
```
</details>

### ⏯ Playground Link

**Playground Link:** [Provided](https://www.typescriptlang.org/play?ssl=1&ssc=1&pln=16&pc=52#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wG4AoczAVwDsNgJa4AxCCACgEo4BvcuILhEY1KM1rUANlIoBfSmiYBneADcUUuAF4+IAJ4AuPkvBSkAD2O9aSVUgAm11VGoYxSawHdgMABYA+tZwyriecADa+ChQUCj6yvgAunKpaRRUdAxMcACy+gDKMND63HwCQiJizAA8bBBwYDEoINq8GlJycAD0AHwUQj3dgyNwAH4TExWC3cMAKvpgSAS8jc0gwQbBpmDmVnxwtvZOBy5uokTBPv5Bp2HGLsC0AOYRSaRwch9fn99-v598HBgMpDhB4ChlMpgM9aCgAEbmODFZGLZb4ACStBgUCe0LQAEEYDjgPDqDA7PgAHTTIZCAAKOCWsH0BCacRAQIcEDsYPglhB8ByMDRBCxJNo+KJJLJFMSVLgHAATABmJVKrjkBTkWZwAlweFIYlIKBwE04U0gGF+eCG4z1ZEoADWvNoDXZLSNJuUQA)

### 💻 Code

```ts
import React from 'react';

function Foo() {
    return null;
}

const val = {my: {complex: {nested: {structure: {with_: { some: ['arrays']}}}}}};

function MyStory() {
    return <Foo param={val} />;
    //          ~~~~~
    // Type '{ param: { my: { complex: { nested: { structure: { with_: { some: string[]; }; }; }; }; }; }; }' is not assignable to type 'IntrinsicAttributes'.
    //   Property 'param' does not exist on type 'IntrinsicAttributes'. (2322)
}
```

### 🙁 Actual behavior

It's not clear that the error is that a parameter is being incorrectly passed via JSX.

Here's the example from the Tweet. Note how large the type is compared to the real error:

![image](https://user-images.githubusercontent.com/98301/107862107-74a25c00-6e18-11eb-908c-41a65202d070.png)

### 🙂 Expected behavior

A better error might be:

    Foo takes no parameters
Repository: go
Issue: regexp/syntax: add Cut
Labels: Proposal,Proposal-Accepted

**Note**: Current proposal is https://github.com/golang/go/issues/44254#issuecomment-892834119

- - -

Regular expressions are often embedded in other languages, and the current regexp package makes it difficult to correctly parse such regexps. Common examples of such embedding include awk, Perl, and Javascript, all of which have a `/regexp/` expression syntax. In Go, this appears in the `testing` package's "-test.run" flag, which is a sequence of `/`-separated regexps; in benchstat v2's filter syntax; and in at least one other place @rsc mentioned that's now slipping my mind.

In general, this is difficult to implement outside `regexp` itself because the delimiter may appear nested in the regexp. For example, in the `testing` package, the run expression `a[/]b/c` matches subtest `c` of top-level tests matching `a[/]b`. The first slash is not a separator because it does not appear at the top level of the regexp. The `testing` package implements a simple, ad hoc parser for this (`splitRegexp`) but it doesn't get every corner case.

Since this is now a pattern, the `regexp` package (or perhaps `regexp/syntax`) should itself implement a "parse until delimiter" function, which would make it easy to parse regular expressions embedded in a larger syntax.

To make a concrete proposal, I propose we add the following function to `regexp/syntax`:

```go
// ParseUntil parses a regular expression from the beginning of str
// until the string delim appears at the top level of the expression.
// It returns the regular expression prefix of str and the remainder of str.
// If successful, rest will always begin with delim.
// If delim does not appear at the top level of str, it returns str, "", ErrNoDelim.
func ParseUntil(str, delim string) (expr, rest string, err error)
```

I propose this should return the split input string, rather than the parsed regexp, so it can be composed with any other regexp parsing entry point (e.g., `regexp/syntax.Parse` or `regexp.Compile`).

I don't think this operation needs to take `Flags`, but I'm not positive.

/cc @rsc
Repository: pytorch
Issue: [docs] Bad docs SEO
Labels: module: docs,triaged,module: doc infra

Query `masked_fill_`:


Lot's of "spam" copy-paste sites like programmersthought, gitmemory, codesuche, kite, even github issues and the PyTorch one even does not highlight or scroll to https://pytorch.org/docs/stable/tensors.html?highlight=masked_fill_#torch.Tensor.masked_fill_ and the snippet is very bad

Maybe it would be best to have single-page per function just for SEO needs (even if the giant summary one continues to exist)


![image](https://user-images.githubusercontent.com/1041752/107863539-822a0700-6e55-11eb-9308-65331a6fca30.png)
![image](https://user-images.githubusercontent.com/1041752/107863542-8b1ad880-6e55-11eb-9746-f46ffdd6b47c.png)
![image](https://user-images.githubusercontent.com/1041752/107863547-9241e680-6e55-11eb-97c6-e307f772b233.png)



cc @ezyang @zou3519 @jlin27 @brianjo @mruberry
Repository: rust
Issue: Actually deprecate `collections::Bound`
Labels: A-lints,T-libs-api

In https://github.com/rust-lang/rust/commit/f2c7917402ebd858f5b517a3406bec8ef187bfb1 , `intrinsics::drop_in_place` was supposedly deprecated in favor of `ptr::drop_in_place`:
```rust
#[rustc_deprecated(
    reason = "no longer an intrinsic - use `ptr::drop_in_place` directly",
    since = "1.18.0"
)]
pub use crate::ptr::drop_in_place;
```
However, this function does not show up as deprecated in the library docs (https://doc.rust-lang.org/nightly/std/intrinsics/fn.drop_in_place.html), nor does it trigger the deprecation warning in the following program:
```rust
fn main() {
    let x = &mut 42 as *mut i32;
    unsafe { core::intrinsics::drop_in_place(x); }
}
```
Presumably this is an unforeseen inability of `#[rustc_deprecated]` to operate on re-exports. Regardless it means that this function was never actually deprecated in practice, and it will need be deprecated for real with an updated `since` value.

This can be resolved by simply making `intrinsics::drop_in_place` into an actual function that merely wraps and calls `ptr::drop_in_place`, then and then applying `#[rustc_deprecated]` to it. Alternatively one could fix `#[rustc_deprecated]` to work when applied to re-exports, but that seems far more involved.

---

Edit: I've also discovered another example of this, which is `collections::Bound`:
```rust
#[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.26.0")]
#[doc(hidden)]
pub use crate::ops::Bound;
```
The problem in this case is a bit more difficult than with `drop_in_place` and requires a bit more care. To wit, function items aren't nominal types, so redefining `intrinsics::drop_in_place` as a wrapper over `ptr::drop_in_place` isn't a breaking change. However, redefining `collections::Bound` as a newtype over `ops::Bound` would create a new nominal type, and would be a breaking change. Furthermore, type aliases via `type` aren't fully at parity with "real" types, so there *might* be potential for breakage if one were to simply do `pub type Bound = ops::Bound;` (I can confirm that the `#[deprecated]` attribute does work on type aliases). However, I think in practice it should(?) be alright to use a type alias here (the only disparity I can think of with type aliases is that they can't be used as constructors for unit structs, but I'd like second opinions).
Repository: rust
Issue: Add more information to E0599 for small changes that would make the trait bounds be satisfied
Labels: A-diagnostics,A-trait-system,T-compiler,D-terse

Given

```
use std::io::{BufRead, BufReader, Read, Write};

fn issue_81421<T: Read + Write>(mut stream: T) {
    let initial_message = format!("Hello world");
    let mut buffer: Vec<u8> = Vec::new();
    let bytes_written = stream.write_all(initial_message.as_bytes());
    let flush = stream.flush();

    loop {
        let mut stream_reader = BufReader::new(&stream);
        //~^ ERROR the trait bound `&T: std::io::Read` is not satisfied [E0277]
        //~| HELP consider removing the leading `&`-reference
        //~| HELP consider changing this borrow's mutability
        stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed");
        //~^ ERROR the method `read_until` exists for struct `BufReader<&T>`,
    }
}

fn main() {}
```

we currently emit

```

error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its trait bounds were not satisfied
  --> $DIR/suggest-change-mut.rs:16:23
   |
LL |         stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed");
   |                       ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds
   | 
  ::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL
   |
LL | pub struct BufReader<R> {
   | ----------------------- doesn't satisfy `BufReader<&T>: BufRead`
   |
   = note: the following trait bounds were not satisfied:
           `&T: std::io::Read`
           which is required by `BufReader<&T>: BufRead`
```

It would be nice if we mentioned _anywhere_ that `BufReader<&mut T>: BufRead` _is_ satisfied.

CC https://github.com/rust-lang/rust/pull/81990
Repository: pytorch
Issue: Unlucky batch->device split by DataParallel causes an exception
Labels: triaged,module: data parallel

I have a batch shape of `[36, 4, 147, 64, 64]` and 7 devices used. Somehow it cuts it into exactly 6 slices, and the last device gets an empty input tuple (confirmed by manual inspection of `inputs` by stepping with debugger into parallel_apply), so makes a nasty exception. If the tuple is empty it should not simply call the replica instead of trying to unpack the tuple anway.

I think I already commented on a related problem somewhere, but can't find the issue right now (I think I hit the case where number of examples in the batch was 3 with 4 GPUs available, then it was crashing as well)

```
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 161, in forward
    outputs = self.parallel_apply(replicas, inputs, kwargs)
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 171, in parallel_apply
    return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 39, in parallel_apply
    if kwargs_tup is not None:
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/_utils.py", line 428, in reraise
    raise self.exc_type(msg)
TypeError: Caught TypeError in replica 6 on device 6.
Original Traceback (most recent call last):
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
    output = module(*input, **kwargs)
  File "/vadim/prefix/miniconda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'x'
```
Even a workaround would be helpful...
Repository: flutter
Issue: VideoPlayer doesn't accept self signed SSL certificates on HTTPS URLs on Android
Labels: platform-android,platform-ios,p: video_player,package,team-ecosystem,has reproducible steps,P3,found in release: 2.10,found in release: 2.13,triaged-ecosystem

## Steps to Reproduce

1. Use VideoPlayer to load a HTTPS media asset that has a self signed certificate.

**Expected results:** 
1. https://localhost:8080/my/test/playlist.m3u8 would work in VideoPlayer

**Actual results:**

1. https://localhost:8080/my/test/playlist.m3u8 causes exception because it is self signed.

```
PlatformException: Video player had error com.google.android.exoplayer2.ExoPlaybackException: Source error
```
Repository: material-ui
Issue: [Select] How to hide the popup on scroll?
Labels: new feature,component: select

- [x] The issue is present in the latest release.
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Current Behavior 😯
When the `Select ` component is open scrolling is disabled. This works on desktop but not on mobile (ios). So when scrolling the page the selectbox stays open and does not move along with the scrolled content.

## Expected Behavior 🤔
It would be really nice if the `Select` used more of the native select features. Instead of disabling the scroll of the body the open selectbox should be closed when scrolling. On mobile, if not closing the selectbox when scrolling the body, it should at least move along with the content.

## Steps to Reproduce 🕹
Steps:

1. Visit https://material-ui.com/components/selects/ on computer.
2. Open one of the selectboxes and scroll the page. Scrolling is NOT allowed and the selectbox stays open.
3. Visit https://material-ui.com/components/selects/ on iOS device.
4. Open one of the selectboxes and scroll the page. Scrolling IS allowed and the selectbox stays open but does not move along with the content.

## Context 🔦
I feel like this is an unfinished component in that sense that as a user I'm not expecting this behavior to occur, either on desktop or mobile. 

## Your Environment 🌎
<details>
  <summary>`npx @material-ui/envinfo`</summary>
  
```
  System:
    OS: Windows 10 10.0.19041
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 7.5.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 88.0.4324.150
    iOS Safari: 12.4.8
  npmPackages:
    @material-ui/core: ^4.11.3 => 4.11.3
    @material-ui/icons: ^4.11.2 => 4.11.2
    @material-ui/styles:  4.11.3
    @material-ui/system:  4.11.3
    @material-ui/types:  5.1.0
    @material-ui/utils:  4.11.2
    @types/react:  17.0.1
    react: ^16.0.0 => 16.12.0
    react-dom: ^16.0.0 => 16.12.0
    typescript: ^3.7.5 => 3.7.5
```
</details>
Repository: pytorch
Issue: tolist called on torch scalar does not return a list => proposal to support new arg force = True to provide a work around
Labels: module: docs,triaged,module: numpy

I think it's better if it returned a single-element list instead. This matches more `tolist()` method name and makes return type more reliable.

```python
import torch
torch.tensor(1).tolist()
# 1
```

cc @brianjo @mruberry @rgommers @heitorschueroff
Repository: go
Issue: x/pkgsite: go.mod for cmd is not the right go.mod
Labels: NeedsDecision,pkgsite

https://pkg.go.dev/cmd is pointing to the `src/go.mod`
https://go.googlesource.com/go/+/go1.15.8/src/go.mod

It needs to be `src/cmd/go.mod` 
https://go.googlesource.com/go/+/go1.15.8/src/cmd/go.mod
Repository: godot
Issue: Swapping textures between animations in AnimationPlayer shows frame 0 for a split second before playing the animation
Labels: topic:core,documentation

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
v3.2.3

**Issue description:**
<!-- What happened, and what was expected. -->
Explained in this link, still happens today.
https://godotengine.org/qa/26173/swapping-textures-animations-animationplayer-animation
Repository: rust
Issue: repr(C, align) is unsound on enums
Labels: T-lang,C-bug,A-repr,A-align,A-enum

repr(align) on enums is implemented as described in the reference:

>The align modifier can also be applied on an enum. When it is, the effect on the enum's alignment is the same as if the enum was wrapped in a newtype struct with the same align modifier.

But this is not how aligned enums work in Clang, GCC, and MSVC

- GCC ignores alignment requests on enums.
- Clang sets the alignment to the requested alignment even if this decreases the alignment. The size is unaffected.
- MSVC increases the alignment to the requested alignment. The size is unaffected.
Repository: youtube-dl
Issue: Discovery + How to download using new format?
Labels: question

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions
- Search the bugtracker for similar questions: http://yt-dl.org/search-issues
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm asking a question
- [ ] I've looked through the README and FAQ for similar questions
- [x] I've searched the bugtracker for similar questions including closed ones


## Question

<!--
Ask your question in an arbitrary form. Please make sure it's worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient.
-->

I want to use discovery+ however it isn't as clear to directly download a source due to the url sticking to in my case
https://www.discoveryplus.co.uk/show/chasing-classic-cars but can't find the individual listing of the url.
How do i get the individual listing?
Repository: youtube-dl
Issue: Windows platform: Consider using %APPDATA% or %LOCALAPPDATA% for application-generated files
Labels: request

## Checklist

- [X] I'm reporting a feature request
- [X] I've verified that I'm running youtube-dl version **2021.02.10**
- [X] I've searched the bugtracker for similar feature requests including closed ones


## Description

When downloading files from certain URLs on the Windows platform, youtube-dl (or one of its libraries?) will generate a ".cache" directory directly in the root of the user's profile directory (e.g. `C:\Users\<username>\.cache`).

Example:

`youtube-dl --no-check-certificate https://soundcloud.com/laurence_chapman/heavens-vault`

will create a file called `C:\Users\<username>\.cache\youtube-dl\soundcloud\client_id.json`


Unlike on *nix platforms, file and directory names starting with a dot are not hidden by default on the Windows platform. Using multiple applications that exhibit this behaviour thus clutters up the user's profile directory.

On Windows, application-specific data should usually be placed in the profile directory's _AppData\Roaming_ subdirectory (%APPDATA%) for "permanent" data that would also be considered in a roaming profile, or the _AppData\Local_ subdirectory (%LOCALAPPDATA%) for mere temporary files.

Please consider using these directories instead (if feasible).
Repository: pytorch
Issue: 'TypeError: expected CPU (got CUDA)' when placing a CUDA tensor on a class that is inheriting torch.Tensor
Labels: triaged,module: tensor creation

## 🐛 Bug

Trying to place a CUDA tensor into a class that is inheriting `torch.Tensor` causes an error.


## To Reproduce

Running this code snippet will cause the error:

```
import torch

class TestTensor(torch.Tensor):
    def test(self):
          print('test')

x = torch.ones(1,3,4,4).cuda()

x_out = TestTensor(x)
```

And the resulting error message:

```
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-2-3f89b4e74d63> in <module>()
      7 x = torch.ones(1,3,4,4).cuda()
      8 
----> 9 x_out = TestTensor(x)

TypeError: expected CPU (got CUDA)
```


## Expected behavior

Not sure what is supposed to happening in this situation? But [I was advised to make an issue post here](https://discuss.pytorch.org/t/typeerror-expected-cpu-got-cuda-when-sublcassing-inheriting-torch-tensor-class/110489/2?u=progamergov).  @albanD


## Environment

Collecting environment information...
PyTorch version: 1.7.0+cu101
Is debug build: True
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.12.0

Python version: 3.6 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: Tesla T4
Nvidia driver version: 460.32.03
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.7.0+cu101
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.3.1
[pip3] torchvision==0.8.1+cu101
[conda] Could not collect


cc @gchanan @mruberry