sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Unable to Utilize `unsafe {}` Blocks as an Expression
Labels: A-grammar,A-diagnostics,A-parser,T-compiler,D-terse

I tried this code:

```rust
fn predicate() -> bool {
    unsafe { std::str::from_utf8_unchecked(&[65]) } == "A"
}

fn main() {}
```

I expected to see this happen: compilation succeeds.

Instead, this happened: two errors are emitted.

```
error: expected expression, found `==`
 --> src/main.rs:2:49
  |
2 | unsafe { std::str::from_utf8_unchecked(&[65]) } == "A"
  |                                                 ^^ expected expression

error[E0308]: mismatched types
 --> src/main.rs:2:10
  |
2 | unsafe { std::str::from_utf8_unchecked(&[65]) } == "A"
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;`
  |          |
  |          expected `()`, found `&str`
```

### 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.63.0-nightly (ca122c7eb 2022-06-13)
binary: rustc
commit-hash: ca122c7ebb3ab50149c9d3d24ddb59c252b32272
commit-date: 2022-06-13
host: x86_64-pc-windows-msvc
release: 1.63.0-nightly
LLVM version: 14.0.5
```

</p>
</details>

Even though I know that I can simply wrap the entire `unsafe` block with parentheses, but this still doesn't seem right when an `if` block can be combined with boolean expressions in a similar fashion:
```rust
if true && if true { true } else { false } { }
```

I know that the `if` case seem to be very spaghetti, but I feel like `unsafe` blocks should exhibit this same behaviour during compilation.
Repository: vscode
Issue: Should diff editor revert icon change?
Labels: diff-editor,under-discussion

I would think something like the one we already use for inline diff matches better:

![image](https://user-images.githubusercontent.com/900690/173566281-c84dfd9e-c625-43b7-8657-ba7c90db35ba.png)

I think this conveys better that the action will result in a partial revert of a change.
Repository: PowerToys
Issue: List of all registered hotkey Shortcuts
Labels: Idea-New PowerToy

### Description of the new feature / enhancement

I remember having seen a Windows Tool to list all the global Shortcuts.
Example: If I created a file link in Explorer and assigned a Shortcut to it, that Shortcut got listed in the overview.

I can't find this feature in Windows 10 itself nor do I find a tool.

When noticing the existence of Keyboard Manager and the Shortcut overview in Power Toys, I assumed one of those would provide this feature. Unfortunately, none of them does.

Feature request:
Whenever I would think of setting up a shortcut in my system using e.g. AutoIt, PowerToys, File Links, etc... I want to pull up PowerToys, check the list of globally registered hot keys/shortcuts to see 

1. what's registered 
2. for which purpose.

### Scenario when this would be used?

Whenever I would think of setting up a shortcut in my system using e.g. AutoIt, PowerToys, File Links, etc... I want to pull up PowerToys, check the list of globally registered hot keys/shortcuts to see what's registered for which purpose.

### Supporting information

_No response_
Repository: opencv
Issue: zlib issue on MAC 
Labels: duplicate

Hello,

I get the following error while compiling the code on macbook. ( I had installed zlib using brew install zlib)

[ 33%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/exif.cpp.o
make[2]: *** No rule to make target `zlib', needed by `lib/libopencv_imgcodecs.4.5.5.dylib'.  Stop.
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make: *** [all] Error
Repository: terminal
Issue: Collapsible Regions
Labels: Issue-Feature,Area-UserInterface,Area-TerminalControl,Product-Terminal

Writing notes on GH for posterity


### Reference

* Collapsable regions [terminal-wg/specifications#3](https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/3)
* https://github.com/xtermjs/xterm.js/issues/1875
* Semantic markers for prompts [terminal-wg/specifications#4](https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/4)

Nested trees is super hard / probably a bad idea.

The cool idea is syncing this up with marks #11000, and how those two work together. We could collapse individual commands. 

### Implementation 

Rendering a collapsed region might need a dev spec 
- I'm not sure the right way for us to just... remove the line from the buffer. It has to be there, but we need to skip it essentially. How do we do that performantly? Track in the first line of the region "I'm a collapsed region of N lines", and have the renderer then skip ahead N to read the next line? _that might work..._ 
- But what about when the very first row of the mutable viewport is part of a region that's collapsed? we'd need to work back up to the row that the region started on. Unless we track the row that this collapsed row belongs to...
- Of course, how does this work with reflow?
- Circling the buffer?
- Collapsed text in the mutable viewport is still writable. That's maybe weird - `^[H` could take the cursor inside a collapsed region

Furthermore, how do we communicate these regions up to the control layer, for it to overlay UI? 

### UI Design 

We might definitely need to have a gutter on the left to provide a UI for this. I've already been thinking about using the gutter for marks. Should the `padding` be used for the gutter? Or should the gutter be _in addition to_ `padding`? Cause 1dip of padding on the left is not gonna be enough for these UI elements

We should probably do the UI elements in XAML, in TermControl.
Repository: rust
Issue: inline assembly accepts invalid assembly, changing it
Labels: A-LLVM,A-inline-assembly,T-compiler,C-bug

<!--
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.
-->

The following code

```rust
pub unsafe fn lea_sub(x: usize) -> usize {
    use std::arch::asm;

    let y: usize;

    asm!(
        "xor rax, rax",
        "lea rax, [rax - 8 * rdx]",
        in("rdx") x,
        out("rax") y,
    );

    y
}
```

creates the following assembly

```asm
example::lea_sub:
        push    rax
        mov     rdx, rdi

        xor     rax, rax
        lea     rax, [rax + 8*rdx]

        mov     qword ptr [rsp], rax
        mov     rax, qword ptr [rsp]
        pop     rcx
        ret

__rustc_debug_gdb_scripts_section__:
        .asciz  "\001gdb_load_rust_pretty_printers.py"
```

Note that `[rax - 8 * rdx]` turned into `[rax + 8*rdx]`. The former version is illegal, since registers can only be added, not subtracted when calculating an address. Given that gcc rejects a similar attempt with its inline assembly, as well as the general confusion anyone uninitiated to the specifics of `lea` might get, I highly doubt that this behaviour is intentional.

### Meta

Godbolt printed the same assembly for rustc versions 1.59, 1.60, 1.61, beta and nightly.
Repository: opencv
Issue: OpenCV fails to import ONNX model: error: (-215:Assertion failed) !isDynamicShape in function 'cv::dnn::dnn4_v20220524::ONNXImporter::parseShape'
Labels: feature,category: dnn,category: dnn (onnx)

##### System information (version)
- OpenCV => 4.5.5
- Operating System / Platform => Windows 10 64 bit
- Compiler => Python 3.10.4
- Installed packages:
> numpy                 1.22.3
>opencv-contrib-python 4.5.5.64
>pip                   22.0.4
>setuptools            58.1.0

##### Detailed description
When importing https://github.com/onnx/models/blob/main/vision/object_detection_segmentation/faster-rcnn/model/FasterRCNN-12.onnx into OpenCV the ONNXImporter fails.

I wrote a Python script in a different venv to check the model with onnx and infer with the model with onnxruntime. The model imports and executes fine. This is not a problem with the models, but with the importer.

Error message:
```
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:928: error: (-2:Unspecified error) in function 'cv::dnn::dnn4_v20211220::ONNXImporter::handleNode'
> Node [ReduceMin@ai.onnx]:(2090) parse error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\dnn.cpp:621: error: 
(-2:Unspecified error) Can't create layer "2090" of type "ReduceMin" in function 'cv::dnn::dnn4_v20211220::LayerData::getLayerInstance'  
>
```
##### Steps to reproduce
- Reproducible: yes
- Enforceable: yes

Import the model using
```
model = cv2.dnn.readNetFromONNX(model_path)
```

##### Issue submission checklist

 - [x] I report the issue, it's not a question
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found any solution
 - [x] I updated to the latest OpenCV version and the issue is still there
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
Repository: react
Issue: New hook; useForwardRef
Labels: Type: Feature Request,Status: Unconfirmed

When working with React.forwardRef it can be kind of a hassle to make it work, since it can be either a callback ref or object ref.

I propose adding a new hook; useForwardRef that handles this.

Example on how to implement it with React:

```
const useForwardRef = <T,>(
  ref: ForwardedRef<T>,
  initialValue: any = null
) => {
  const targetRef = useRef<T>(initialValue);

  useEffect(() => {
    if (!ref) return;

    if (typeof ref === 'function') {
      ref(targetRef.current);
    } else {
      ref.current = targetRef.current;
    }
  }, [ref]);

  return targetRef;
};

const InputField = React.forwardRef<HTMLInputElement, InputFieldProps>(
  (props, ref) => {
   const forwardedRef = useForwardRef<HTMLInputElement>(ref);
   // Cool code....
  }
 );
```
Repository: node
Issue: npm prefix not in PATH after installation
Labels: windows,install

### Version

v16.15.1

### Platform

Microsoft Windows NT 10.0.19044.0 x64

### Subsystem

_No response_

### What steps will reproduce the bug?

1. Install NodeJS using winget: `winget install OpenJS.NodeJS.LTS `
2. Install gulp globally:  `npm install --global gulp-cli`
3. Log as user without admin rights
4. In Terminal write `gulp --version`

### How often does it reproduce? Is there a required condition?

_No response_

### What is the expected behavior?

NodeJS installator should add npm prefix `%USERPROFILE%\AppData\Roaming\npm` to path

### What do you see instead?

```
'gulp' is not recognized as an internal or external command,
operable program or batch file.
```

### Additional information

This is necessary if user without admin rights installs npm package, such as gulp, and wants to execute it. Because the npm prefix is not in path, the executable is not found. User without admin rights cannot change system variables so this should be done during NodeJS installation.
Repository: godot
Issue: Textures specified in a Decal are not detected as used in 3D
Labels: bug,topic:rendering,topic:import,topic:3d

*Related to https://github.com/godotengine/godot/issues/62032.*

### Godot version

4.0.alpha (184709427)

### System information

Fedora 36, GeForce GTX 1080 (NVIDIA 510.68.02)

### Issue description

Unlike textures specified in a BaseMaterial3D, textures specified in a Decal are not detected as used in 3D. This causes 3 issues of varying importance:

- VRAM compression is not used, which wastes memory for high-resolution textures.
- Normal map compression (RGTC) is not used, which wastes memory for textures that could use VRAM compression.
- The roughness filter on import is not used, which increases the amount of visible specular aliasing.

### Steps to reproduce

- Add a MeshInstance3D node with a BoxMesh (to see the Decal on top).
- Add a Decal node.
- Specify four *different* textures in its Albedo, Normal, ORM and Emission properties.
- Notice how textures are never detected as used in 3D, and are never reimported with VRAM compression enabled.

### Minimal reproduction project

[test_decal_detect_3d.zip](https://github.com/godotengine/godot/files/8900185/test_decal_detect_3d.zip)
Repository: godot
Issue: Textures specified in an OmniLight3D or SpotLight3D projector are not detected as used in 3D
Labels: bug,topic:rendering,topic:import,topic:3d

*Related to https://github.com/godotengine/godot/issues/62031.*

### Godot version

4.0.alpha (184709427)

### System information

Fedora 36, GeForce GTX 1080 (NVIDIA 510.68.02)

### Issue description

Unlike textures specified in a BaseMaterial3D, textures specified in an OmniLight3D or SpotLight3D's **Projector** property are not detected as used in 3D. This means VRAM compression is not used, which wastes memory for high-resolution textures.

**Note:** [Projector rendering is currently broken](https://github.com/godotengine/godot/issues/59488), but 3D detection can still be fixed in the meantime.

### Steps to reproduce

- Add a MeshInstance3D node with a BoxMesh (to see the lights affecting it).
- Add a OmniLight3D node and enable shadows on it.
- Specify a projector texture in the OmniLight3D properties.
- Add a SpotLight3D node and enable shadows on it.
- Specify a projector texture in the OmniLight3D properties.

### Minimal reproduction project

[test_projector_detect_3d.zip](https://github.com/godotengine/godot/files/8900218/test_projector_detect_3d.zip)
Repository: pytorch
Issue: Display a "reference" link for ops that points to primTorch implementations
Labels: module: docs,triaged,better-engineering,module: primTorch

Users have often requested a more readable way to understand PyTorch's operators. See https://github.com/pytorch/pytorch/pull/79413#issuecomment-1153988754 for a recent reiteration of this suggestion. 

cc @svekars @holly1238 @ezyang @mruberry @ngimel
Repository: material-ui
Issue: [material-ui][Backdrop] aria-hidden is set by default
Labels: accessibility,breaking change,package: material-ui,component: backdrop

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Current behavior 😯

When running the backdrop example with child components as shown on https://mui.com/material-ui/react-backdrop/#example, the backdrop div has `aria-hidden="true"` set. This is problematic IMO, esp when the child element is for example a loading spinner with the role progressbar. 

Wouldn't aria-hidden="true" block screenreaders from announcing those child elements?
On the other hand aria-hidden on the backdrop without any child elements makes sense.

### Expected behavior 🤔

IMO backdrops with child elements should avoid `aria-hidden="true"`

### Steps to reproduce 🕹

Steps:

1. open https://mui.com/material-ui/react-backdrop/#example
2. inspect backdrop with dev tool


### Context 🔦

Using the backdrop with a loading (progressbar) indicator.

### Your environment 🌎

<details>
  <summary>`npx @mui/envinfo`</summary>

```
 
  System:
    OS: macOS 12.4
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 102.0.5005.61
    Edge: Not Found
    Firefox: 100.0.2
    Safari: 15.5
  npmPackages:
    @emotion/react: 11.9.0 => 11.9.0 
    @emotion/styled: 11.8.1 => 11.8.1 
    @mui/base:  5.0.0-alpha.82 
    @mui/icons-material: 5.8.0 => 5.8.0 
    @mui/lab: 5.0.0-alpha.83 => 5.0.0-alpha.83 
    @mui/material: 5.8.1 => 5.8.1 
    @mui/private-theming:  5.8.0 
    @mui/styled-engine:  5.8.0 
    @mui/system: 5.8.1 => 5.8.1 
    @mui/types:  7.1.3 
    @mui/utils:  5.8.0 
    @mui/x-date-pickers:  5.0.0-alpha.1 
    @types/react: 17.0.45 => 17.0.45 
    react: 17.0.2 => 17.0.2 
    react-dom: 17.0.2 => 17.0.2 
    styled-components: 5.3.5 => 5.3.5 
    typescript: 4.6.4 => 4.6.4 
```
</details>
Repository: TypeScript
Issue: Optional chaining operator infers `never` in a loop
Labels: Bug,Help Wanted

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

- optional chaining 

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->


It's broken in all tested versions of typescript (3.7 until 4.8 nightly in TS playground). Versions prior 3.7 do not support optional chaining. 

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.8.0-dev.20220614&ssl=2&ssc=1&pln=3&pc=1#code/GYVwdgxgLglg9mABMOcAUMwAcRQFyIBGqANgKYCGYA2gLoCUiA3gFACQ5UiFEEBYIEiUQAfZoiwAnOFgLE45KogC+iALyIBQ9ikmI0EBAGcuMKGQC2iOMESYcURqzZtDYExMlkAbgDUKJCBkcqSUSGLgACZkwJhkkercvAD8AHRSMgDc7K7GXADuFEYAKpJBIQphiVI+-oFkiMnJyAFGZNkuPBCJTJ4yBGaWomKFJWUNyuyTk0A)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
function foo(input: boolean[]) {
	let acc: null | { prop?: boolean } = null
	for (const item of input) {
		acc = { prop: item || acc?.prop } // <- Property 'prop' does not exist on type 'never'.
	}
}
```

### 🙁 Actual behavior

It infers `never` for `acc` variable, thus gives an error:
> Property 'prop' does not exist on type 'never'.


<!-- What happened, and why it was wrong -->
```ts
function foo(input: boolean[]) {
	let acc: null | { prop?: boolean } = null
	for (const item of input) {
		acc = { prop: item || acc?.prop } // <- Property 'prop' does not exist on type 'never'.
	}
}
```

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->

To work and not to give an error (infer `boolean` for `prop` property) - the same way as does this equivalent code:

```ts
function foo(input: boolean[]) {
	let acc: null | { prop?: boolean } = null
	for (const item of input) {
		acc = { prop: item || (acc !== null ? acc.prop : undefined) }
	}
}
```
Repository: terminal
Issue: Command Palette background color doesn't update correctly when toggling with keyboard
Labels: Help Wanted,Issue-Bug,Product-Terminal,Priority-3,Area-CmdPal

### Windows Terminal version

1.13.11432.0

### Windows build number

10.0.25136.0

### Other Software

_No response_

### Steps to reproduce

1. `Ctrl+Shift+P` to open command palette
2. type `color` to select color scheme
3. toggle color schemes using up/down keys
4. the command palette background color doesn't update accordingly (scroll on the mouse scrollwheel seems to force it to update and you can see the difference)


### Expected Behavior

_No response_

### Actual Behavior

![a](https://user-images.githubusercontent.com/42881734/173605342-9a029f4e-919b-4708-819b-57ca00fae24a.gif)
Repository: pytorch
Issue: test_ops.py extremely slow on cuda11.3
Labels: triaged

Since the merge of #78304, our Linux 11.3 CUDA tests have increased in test time by 3 hours. @0x00b1's PR introduces several OpInfos that are culprit.

![image](https://user-images.githubusercontent.com/31798555/173619363-3ddd8433-30f9-4c16-b8da-5e8440e0011d.png)
Before the change, our total test time was averaging around 7.5 hrs. After, it was consistently 10.5hrs.
Repository: transformers
Issue: Add Flax implementation for BLOOM
Labels: New model

### Model description

I'm interested in adding an implementation of BLOOM in Flax. 

The implementation shouldn't be too bad since the pytorch implementation can serve as a guide and a way to check correctness. 



### Open source status

- [X] The model implementation is available
- [X] The model weights are available

### Provide useful links for the implementation

@younesbelkada @stas00 @patrickvonplaten 

If someone is already planning to work on this then no worries, but if not I will start on this as soon as I have time!
Repository: vscode
Issue: Using folder picker on vscode.dev overwrites input
Labels: bug,simple-file-dialog

https://user-images.githubusercontent.com/35271042/173631303-7e9342fc-bc29-4b9b-8cbc-c8d7419d0e23.mp4

Steps to Reproduce:

1. open a repo in vscode.dev
2. open workspace trust
3. add folder
4. removing text using alt/option + backspace, start typing text
5. :bug: input will get overwritten as you are typing

Version: 1.69.0-insider
Commit: d8823e67a907b3fa176068ad802682ccd74f8083
Date: 2022-06-14T10:33:55.418Z
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.78 Safari/537.36
Repository: go
Issue: runtime: `fatal: systemstack called from unexpected goroutine` testing runtime/trace on freebsd-386-12_3
Labels: NeedsInvestigation,compiler/runtime

```
freebsd-386-12_3 at 4afb0b9e533767f788252816c4b79ee29a1952a7
…
fatal: systemstack called from unexpected goroutine
FAIL	runtime/trace	7.741s
```

(CC @golang/freebsd)

This may or may not be related to #51001 (CC @golang/runtime, @prattmic, @aclements):

`greplogs -l -e 'fatal: systemstack called from unexpected goroutine\nFAIL\s+runtime'`
[2022-06-08T15:47:58-4afb0b9/freebsd-386-12_3](https://build.golang.org/log/eadab6daabfc0797d3379e4e07d3d2de2f8b07ad)
[2022-05-20T22:30:37-2b0e457/android-arm64-corellium](https://build.golang.org/log/3080e82db577e4c5be2b2cf7f7052360bb6570c6)
[2022-05-03T19:48:07-bccce90/android-arm64-corellium](https://build.golang.org/log/b0616a0bde53c5ae0039bc12934102683961ab2e)