sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: 2021 disjoint capture suggestion breaks macro_rules macro
Labels: A-closures,C-bug,A-suggestion-diagnostics,D-invalid-suggestion,A-edition-2021

I tried this code:

```rust
#![allow(unused)]
#![warn(rust_2021_incompatible_closure_captures)]

macro_rules! foo {
    ($v:ident) => {
        move || {
            println!("{:?}", $v.0);
        }
    };
}

fn main() {
    let x = (vec![1], vec![2]);
    foo!(x);
}
```

The rust_2021_incompatible_closure_captures lint generates a suggestion which causes this to fail to compile:

```rust
macro_rules! foo {
    ($v:ident) => {
        move || {
            let _ = &x;  // ERROR: cannot find value `x` in this scope
            println!("{:?}", $v.0);
        }
    };
}
```

I'm not exactly sure what this should do.  In this particular case, the suggestion is not required.  However, that's a fundamental problem with the `rust_2021_incompatible_closure_captures` lint, as it does not know when it is required.

In general, modifying macros can be prone to failure, so maybe an alternative is to issue a warning with a non-machine-applicable fix when inside a `macro_rules` definition?

This was found in the 2021 crater run for rcodec 1.0.1: https://crater-reports.s3.amazonaws.com/pr-87190-3/try%23a7a572ce3edd6d476191fbfe92c9c1986e009b34/reg/rcodec-1.0.1/log.txt
Note that this has even worse behavior than the example above.  The sample macro:

```rust
macro_rules! forcomp_stmts {
    { $yld:block, $v:ident, $e:expr } => {
        $e.map(move |$v| $yld)
    };
    { $yld:block, $v:ident, $e:expr, $($tv:ident, $te:expr),+ } => {
        $e.and_then(move |$v| {
            forcomp_stmts!($yld, $($tv, $te),+)
        })
    };
}
```

rewrites the map call to:

```rust
        $e.map{ let _ = &decoded; (move |$v| $yld) }
```

which is invalid syntax. 

### Meta

`rustc --version --verbose`:
```
rustc 1.56.0-nightly (ac50a5335 2021-08-27)
binary: rustc
commit-hash: ac50a53359328a5d7f2f558833e63d59d372e4f7
commit-date: 2021-08-27
host: x86_64-apple-darwin
release: 1.56.0-nightly
LLVM version: 13.0.0
```

cc @rust-lang/wg-rfc-2229
Repository: rust
Issue: missing rust_2021_incompatible_closure_captures with async block boxed future thingy
Labels: A-diagnostics,A-closures,T-compiler,C-bug,A-suggestion-diagnostics,A-edition-2021

Given the following code:

```rust
#![allow(unused)]
// #![warn(rust_2021_incompatible_closure_captures)]
#![feature(capture_disjoint_fields)]
use futures::future::BoxFuture;
use futures::FutureExt;

struct Connect {
    host: String,
    insecure: bool,
}

pub struct GremlinContext;

pub enum Command {
    Print(Option<String>),
    Exec(Box<dyn FnOnce(&GremlinContext) -> BoxFuture<'static, Vec<Command>> + Send>),
}

struct ConnectionOptions<'a> {
    host: &'a str,
    insecure: bool,
}

fn handle(args: Vec<String>) -> Vec<Command> {
    let connect = Connect {
        host: "".to_string(),
        insecure: false,
    };
    let task = |_ctx: &GremlinContext| {
        let future = async move {
            let options = ConnectionOptions {
                host: connect.host.as_str(),
                insecure: connect.insecure,
            };
            vec![Command::Print(Some("Connected!".into()))]
        };
        future.boxed()
    };

    vec![Command::Exec(Box::new(task))]
}
fn main() {}
```

With `feature` disabled, and the warning enabled, there is no warning issued.  With the feature enabled, this fails with the error:

```
error[E0597]: `connect.insecure` does not live long enough
  --> src/main.rs:33:27
   |
29 |     let task = |_ctx: &GremlinContext| {
   |                ----------------------- value captured here
...
33 |                 insecure: connect.insecure,
   |                           ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
...
40 |     vec![Command::Exec(Box::new(task))]
   |                        -------------- cast requires that `connect.insecure` is borrowed for `'static`
41 | }
   | - `connect.insecure` dropped here while still borrowed
```

I think it is missing a suggestion for `let _ = &connect` in the closure.

Found in the 2021 crater run for https://crater-reports.s3.amazonaws.com/pr-87190-3/try%23a7a572ce3edd6d476191fbfe92c9c1986e009b34/reg/gremlin-cli-0.1.0/log.txt

```
rustc 1.56.0-nightly (ac50a5335 2021-08-27)
binary: rustc
commit-hash: ac50a53359328a5d7f2f558833e63d59d372e4f7
commit-date: 2021-08-27
host: x86_64-apple-darwin
release: 1.56.0-nightly
LLVM version: 13.0.0
```

cc @rust-lang/wg-rfc-2229 


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"arora-aman"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: vscode
Issue: ctrl+z undo both auto-indentation and default behavior
Labels: bug,editor-core

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version:1.59.1
- OS Version:Linux x64 5.11.0-25-generic

Steps to Reproduce:

1.Press tab. Auto-indentation happens.  
2.Press ctrl+Z. 
Expected Result:  
Cursor back to the position that a tab should do, e.g. 4-spaces.  
Unexpected Result:  
Cursor back to line start.  

Example:  
1. code --disable-extensions. Open a new file as JavaScript.
2. Start with. | is cursor marker, not an actual input.
```
function myFunc(longggggggggggggggggggggggggggggggggggggggggg, arg1,
                                                               arg2) {
|
    let var = 1;
}
```
3. Press tab, auto indentation happens. Actually indentation position does not matter.
```
function myFunc(longggggggggggggggggggggggggggggggggggggggggg, arg1,
                                                               arg2) {
                                                                |
    let var = 1;
}
```
4. Press ctrl+z. Cursor back to line start. It should come back to 4-space, where a tab does by default.
```
function myFunc(longggggggggggggggggggggggggggggggggggggggggg, arg1,
                                                               arg2) {
|
    let var = 1;
}
```

---
*Addition by @hediet:*

Expected outcome (a single tab):
```
function myFunc(longggggggggggggggggggggggggggggggggggggggggg, arg1,
                                                               arg2) {
    |
    let var = 1;
}
```
Repository: godot
Issue: [Linux] Can neither build nor run any project on Mono Stable
Labels: bug,platform:linuxbsd,topic:buildsystem,topic:dotnet

### Godot version

3.3.3.stable.mono.custom_build

### System information

Gentoo Linux, Kernel 5.10.52-gentoo x86_64, Mono 6.12.0.122, Microsoft.NET SDK 5.0

### Issue description

Same as #50486 but on Linux. I can't build, I can't run **any** scene in **any** project. The error is the same:
```
modules/mono/mono_gd/gd_mono_utils.cpp:370 - System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
```

### Steps to reproduce

1. Compile Godot 3.3.3 Stable Mono with Microsoft.NET SDK 5.0.
2. Run any project or create one.
3. Run into the error below.
![image](https://user-images.githubusercontent.com/12483854/131242798-38db78b7-0dea-49cc-88f1-3ba6eedb808e.png)


### Minimal reproduction project

Not needed.
Repository: electron
Issue: [Feature Request]: Read GTK theme colors (system colors on Linux)
Labels: enhancement :sparkles:

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

Electron offers APIs to get system colors (`systemPreferences.getColor`, `systemPreferences.getSystemColor`) for Mac OS and Windows. It seems like there's no such API for Linux.

If we could somehow get the color values of the active GTK theme, we could create applications that would match the system color in a great number of Linux distros (correct me if I'm wrong, but it seems to me like GTK is much more popular than Qt).

### Proposed Solution

Extend `systemPreferences.getColor` to try getting the active GTK theme colors on Linux if available; Or add another method `systemPreferences.getGTKColors` that would return all available GTK colors detected on the system.

Preferred methods:
1. Read the values somehow from the default system theme Chromium is using
2. Initialize some empty / hidden GTK widget and read the values from there.   https://stackoverflow.com/questions/38871450/how-can-i-get-the-default-colors-in-gtk (Python API, I guess it's also possible with C++ bindings ?)

Other options:
Other option would be to somehow read the active theme name (either using GTK API ([Python example](https://stackoverflow.com/questions/50644945/get-color-scheme-from-gtk)) or by getting that from desktop environment settings manager (this should not even be considered, as [each DE has a different way of doing that](https://stackoverflow.com/a/44629154/4925661)), then find the theme files and process the CSS (obviously last resort if the preferred methods don't work for any reason).

### Alternatives Considered

1. Not implementing it / ignoring system colors on Linux.

### Additional Information

_No response_
Repository: PowerToys
Issue: File content search in Windows Search plugin 
Labels: Idea-Enhancement,Product-PowerToys Run,Run-Plugin

### Description of the new feature / enhancement

A toggle for enabling file content search in the Windows Search plugin for PowerToys Run.

### Scenario when this would be used?

### Scenario 1
A user wants to find a specific document among many similarly named files with different content (e.g. "lesson 12.pdf", "lesson 13.pdf", "lesson 14.pdf") based on words or phrases inside it because they don't remember the document's exact name.

### Scenario 2
A user wants to find all books and/or documents which share specific concepts but are named differently and/or don't feature the concept in their names (e.g. all history textbooks containing "Genghis Khan").

### Supporting information

It's uncomfortable to use two or more tools (e.g. PowerToys Run, Open-Shell Menu and/or File Explorer) for one purpose (general search).
Repository: neovim
Issue: regression: <esc> in cmdwin in a mapping works differently than in regular buffer
Labels: bug-vim,has:repro,bug-regression,mappings

### Neovim version (nvim -v)

NVIM v0.5.0

### Vim (not Nvim) behaves the same?

Yes

### Operating system/version

Kubuntu 21.04

### Terminal name/version

Konsole

### $TERM environment variable

xterm-256color

### Installation

appimage

### How to reproduce the issue

Copy this to system clipboard:

```
fun! CustomOperation()
	exe "norm! \<esc>"
endf
nnoremap X :<c-u>call CustomOperation()<cr>
```

Run:
```
nvim -u NONE
:@+
q:X
```

### Expected behavior

Using the "X" mapping in normal mode in cmdwin sends `<esc>` and nothing else happens.

### Actual behavior

Using the "X" mapping causes nvim to enter non-cmdwin command line. However, in a regular buffer this doesn't happen.

A simple mapping such as `nnoremap X <esc>` works as expected. 

In the 0.4 version, this behavior didn't exist
Repository: godot
Issue: texture_array_reflections is broken on mobile (GLES3)
Labels: bug,platform:android,topic:rendering,topic:3d

### Godot version

3.3.3.stable, 3.3.2.stable

### System information

Linux Manjaro 21.1.0, Android 10(Xiaomi Redmi 8, arm64-v8a, OpenGL 3.0.2, confirmed to occur on other phones as well), using GLES3

### Issue description

For backstory see #52064
texture_array_reflections seems broken on mobile.  
  
On PC:
<details>
<summary><b>texture_array_reflections</b> set to true on PC.</summary>

![pc](https://user-images.githubusercontent.com/26604491/131252184-1d2ef66a-2a90-4fe5-8d3e-a3e7a5aea900.png)
</details>  

  
On mobile:
<details>
<summary><b>texture_array_reflections.mobile</b> set to false, looks good.</summary>

![photo_2021-08-26_11-44-40](https://user-images.githubusercontent.com/26604491/130931697-e4b44cff-1007-4042-a6d0-1dbad7f24b35.jpg)
</details>

<details>
<summary><b>texture_array_reflections.mobile</b> set to true, broken.</summary>

![photo_2021-08-26_11-45-49](https://user-images.githubusercontent.com/26604491/130931894-4d657ce5-f8be-4fc9-bfdb-4ab09dd264de.jpg)
</details>


### Steps to reproduce

1. Create new GLES3 project
2. Import 3D model
3. Create new spatial material with albedo texture.
4. Apply material to the model and save it as a scene.
5. Instantiate child node in main scene using result of previous step(model with the material).
6. Create 3D camera in main scene.
8. Install android build template
9. Setup export to android.
10. Export to android and compare result from phone with the result when running F5 or using editor.


### Minimal reproduction project

Note: screens in issue description were made with normal/metallic/roughness maps and HDRI, but they are not included in project as they are not necessary to reproduce the bug.
[reproduce.zip](https://github.com/godotengine/godot/files/7072618/reproduce.zip)
Repository: PowerToys
Issue: Add toggle to FancyZones to allow CTRL+ALT+WIN+[Key] to set a custom layout to only 1 monitor
Labels: Idea-Enhancement,FancyZones-Layouts,Product-FancyZones

- FancyZones allows to span zones across monitors or to limit zones to 1 monitor
- FancyZones allows adding a key shortcut to switch between your custom layout
- FancyZones allows to set different custom layouts to different monitors using FancyZones Editor -> Monitor_A can use CustomLayout_1 and Monitor_B can use CustomLayout_3

When using a defined shortcut FanzcyZones applies an assigned custom layout to all monitors. So I can't quickly set a custom layout to only 1 monitor using the keyboard. 
Available scenario #1:
I have to go PowerToys then FancyZones then FancyZones Editor, then select a monitor, then select a layout, then close the window. 
Available scenario #2:
Use Win + ` then select a monitor, then select a layout, then close the window. 

Suggested solution:
Add a toggle to FancyZones:
"Allow CTRL+ALT+WIN+[Key] to set a custom layout to only 1 monitor" (based on mouse focus) 
- enabled will allow setting CustomLayout_1 to Monitor_A using the shortcut, but the layout of Monitor_B won't be updated
- disabled will allow setting CustomLayout_1 to all monitors
Repository: godot
Issue: `File.file_exists()` returns `false` if a file is currently opened on Windows
Labels: bug,platform:windows,topic:core

### Godot version

3.2

### System information

Windows 10 GLES 3

### Issue description

file_exists() returns 'false' if the file is "in use" (by Godot or another process) - this is clearly wrong as the file clearly does exist!

Note: get_modified_time() works with files in this state so I can modified time for non-existant files!!

File.Open(filename,File.READ) fails with error 12 (cannot be opened)
Surely it should be error 11 (file is in-use)??

Moreover, it should be possible to open files READ which are 'in-use' but not exclusively locked - pretty much every IDE/Editor does this (including Godot) and simply checks for updates in the background???

### Steps to reproduce

var f = File.instance()
f.open("res://Client.txt",File.WRITE)
var f2 = File.instance()
print(f.file_exists("res://Client.txt",File.WRITE)) # returns false
print(f2.get_modified_time("res://Client.txt")) # returns file modified time
print(f2.open("res://Client.txt",File.READ) # returns 12 

### Minimal reproduction project

_No response_
Repository: youtube-dl
Issue: Support for invidious download 
Labels: site-support-request

<!--

######################################################################
  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:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.06.06. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2021.06.06**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [x] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: https://invidious-us.kavin.rocks/watch?v=15TvLqK29PU&list=IVPLxy40xZSaui6mZCrEUbd-MeMQD41-k6D
- Playlist: https://invidious-us.kavin.rocks/playlist?list=IVPLxy40xZSaui6mZCrEUbd-MeMQD41-k6D


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

WRITE DESCRIPTION HERE
Invidious is open-source and privacy respecting youtube frontend, also there are many different server with different domains for example i am using invidious-us.kavin.rocks but there are others as well you can find the list here https://api.invidious.io/
Repository: godot
Issue: Disallow directories in the file name field of `FileDialog`
Labels: bug,topic:gui

### Godot version

3.3, master (7368004)

### System information

Windows 10

### Issue description

While working on https://github.com/godotengine/godot/pull/52189 I've run into a poorly handled behavior of `FileDialog`.

When saving a resource or a scene using a `FileDialog` popup it is possible to input something like `abc/xyz.tres` into the file name field. Saving this fails if this `abc` folder does not exist. If it does exist, it can lead to various issues on case-insensitive platforms such as Windows (the folder may be named `aBc`, but this would still work and can cause issues down the line).

It would be better to disable directory names in file names when saving from the `FileDialog` all together. And not just in the editor popups.

### Steps to reproduce

See above.

### Minimal reproduction project

_No response_
Repository: godot
Issue: Issues with saving files in case-insensitive file systems
Labels: bug,enhancement,platform:windows,topic:editor,confirmed

### Godot version

3.3, master (7368004)

### System information

Windows 10

### Issue description

While working on https://github.com/godotengine/godot/pull/52189 I've run into several issues regarding case sensitivity or lack thereof on Windows (probably applies to macOS as well). 

Windows, being case-insensitive by default, is pretty tolerant to replacing `res://aaa/file.tres` with `res://AaA/file.tres`. It will still open or save the file and won't complain about it. The problem is, we have no way to know if the actual path in the file system is different from what we imagine it is. There are several ways a user can run into this situation, and as a result they may have a resource/scene with its path set to a value that is not actually correct, but that would still work on Windows.

To solve this we need to be able to "sanitize" paths by the means of the OS or the FS, letting them handle the inconsistencies, and we also may need a dedicated method to fetch a valid case-sensitive path from the given path.

These can then be utilized in the resource and scene saving logic of the editor to make sure that these resources know their correct paths.

Interestingly we already have a case for a warning on Windows, but I was unable to trigger it on master even with blatantly mismatched paths. It just didn't go past the invalid handle check.

```cpp
#ifdef TOOLS_ENABLED
	// Windows is case insensitive, but all other platforms are sensitive to it
	// To ease cross-platform development, we issue a warning if users try to access
	// a file using the wrong case (which *works* on Windows, but won't on other
	// platforms).
	if (p_mode_flags == READ) {
		WIN32_FIND_DATAW d;
		HANDLE f = FindFirstFileW((LPCWSTR)(path.utf16().get_data()), &d);
		if (f != INVALID_HANDLE_VALUE) {
			String fname = String::utf16((const char16_t *)(d.cFileName));
			if (fname != String()) {
				String base_file = path.get_file();
				if (base_file != fname && base_file.findn(fname) == 0) {
					WARN_PRINT("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms.");
				}
			}
			FindClose(f);
		}
	}
#endif
```

Another option here may be to completely enforce case insensitivity so there is no way to create files with conflicting names on any platform.

### Steps to reproduce

One example would be to use a loophole in `FileDialog` and input the incorrectly-cased directory name into the "File" field when saving a scene. See https://github.com/godotengine/godot/issues/52230

### Minimal reproduction project

_No response_