sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Unused import warning fires incorrectly for imports used and shadowed by decl_macro's.
Labels: A-lints,T-compiler,C-bug,F-decl_macro,L-unused_imports

I wanted to demonstrate name resolution detecting maro expansion shadowing
```rust
#![feature(decl_macro)]

mod foo {
    pub macro import_bar($name:ident) {
        use bar::time_travel as $name;
    }
}

mod bar {
    pub macro time_travel($name:ident) {
        // The uncommented version never errors.
        use foo::import_bar as $name;
        // use bar::time_travel as $name;
    }
}

use foo::*;

// Only if the invocation uses the glob import and `time_travel`
// shadows it to something *different*, does it produce an error.
/*foo::*/import_bar!(m2);
m2!(import_bar);
```

However, while the example works as expected, "warning: unused import: `foo::*`" is produced, despite the import being used by the first macro invocation (and trying to remove it results in an error).

This is likely caused by us marking imports as used after expansion is finished, so the `use foo::import_bar as import_bar;` import gets marked as used, instead of `use foo::*;`.

But the macro *couldn't* have expanded without the later-shadowed glob import, so maybe expansion *should* mark the imports used to find the macro, as used, early?

cc @petrochenkov @nikomatsakis
Repository: flutter
Issue: TextEditingController doesn't keep selection on text changes
Labels: a: text input,framework,a: fidelity,has reproducible steps,P3,team-framework,triaged-framework,found in release: 3.13,found in release: 3.17

**Steps to reproduce:**

- Create TextField with "start value" text with `final tf = TextField(controller: TextEditingController(text: 'start value'));`.
- Tap to a middle of the textfield to set the cursor to the middle of the text (like "start| value").
- Programmatically update text in the textfield with `tf.controller.text = 'new value';`

**Expected result:**

- The cursor stays in the middle of the textfield (like "new v|alue").

**Actual result:**

- The cursor moves to the end on the iOS (like "new value|") and to the start on the Android (like "|new value").

**Extra notes:**

- As I can see per [TextEditingController sources](https://github.com/flutter/flutter/blob/989cf18b0daed99ea7c83226bd76fa39693bf94c/packages/flutter/lib/src/widgets/editable_text.dart#L80) it explicitly drops selection with text update. 

**Flutter doctor:**
```
flutter -v doctor
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.8.2 at /Users/alexkorovyansky/Library/Flutter
    • Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/alexkorovyansky/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 27.0.3
    • ANDROID_HOME = /Users/alexkorovyansky/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

```
Repository: scrcpy
Issue: Not an issue but an improved version for raspberry pi
Labels: raspberry pi

I am interested in using OpenMax library to hardware decode on pi zero: I have modified decoder.c code to decode stream from socket with broadcom ilclient but I am not an expert c/c++ coder so I need help to review the code.
I attach the modified cose here, you can simply put a switch at compile time to compile one of the ffmpeg or ilclient/openmax decoder.c code.
Please give me a feedback if any of you are interested in this, I am working on project to made a pi zero android docking station for desktop use.
[decoder.c.log](https://github.com/Genymobile/scrcpy/files/2407955/decoder.c.log)
Repository: pytorch
Issue: [caffe2] Documentation of Optimizers (Python API)
Labels: caffe2

I have been searching for a while and I have not found any documentation regarding the optimizers such as adam, sgd, rms_prop and adagrad. It would be very nice to have some documentation like the one for pytorch https://pytorch.org/docs/stable/optim.html
Repository: rust
Issue: Failure to parse `{2} + {2}`
Labels: A-grammar,A-parser,T-lang,C-discussion

These examples should compile according to the rust reference:

```rust
fn compiles() -> i32 {
    ({2}) + ({2})
}

fn fails() -> i32 {
    {2} + {2}
}

fn compiles2() -> i32 {
    2 + {2}
}

fn fails2() -> i32 {
    {2} + 2
}
```

([Playground](https://play.rust-lang.org/?gist=36a06367e5e9b2eded3b7a15067306d5&version=stable&mode=debug&edition=2015))

Errors:

```
   Compiling playground v0.0.1 (file:///playground)
error: expected expression, found `+`
 --> src/lib.rs:6:9
  |
6 |     {2} + {2}
  |         ^ expected expression

error: expected expression, found `+`
  --> src/lib.rs:14:9
   |
14 |     {2} + 2
   |         ^ expected expression

error: aborting due to 2 previous errors

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

```

Rust reference snippet (thanks @Moongoodboy-K for the help here):
> Expression : BlockExpression | OperatorExpression | ..
> OperatorExpression : ArithmeticOrLogicalExpression | ..
> ArithmeticOrLogicalExpression : Expression `+` Expression | ..
> BlockExpression : `{` InnerAttribute* Statement* Expression? `}`

cc: @Moongoodboy-K
Repository: TypeScript
Issue: `export default interface` in augmentation shadows original default export
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  master (5fb3976)

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** default export interface augmentation 

**Code**

```ts
declare module "example" {
    const y = 42;
    export default y;
    
    // Augmentation
    module "example" {
        export default interface Foo {}
    }
}

declare module "example2" {
    import y from "example";
    // Actual: error TS2693: 'y' only refers to a type, but is being used as a value here.
    const yy: typeof y;
}
```

**Expected behavior:** No error (declarations merge properly), or error on `export default interface Foo {}` that default exports in augmentations aren't supported.

**Actual behavior:** Error as marked.

**Playground Link:** [Link](https://www.typescriptlang.org/play/#src=declare%20module%20%22example%22%20%7B%0D%0A%20%20%20%20const%20y%20%3D%2042%3B%0D%0A%20%20%20%20export%20default%20y%3B%0D%0A%20%20%20%20%0D%0A%20%20%20%20%2F%2F%20Augmentation%0D%0A%20%20%20%20module%20%22example%22%20%7B%0D%0A%20%20%20%20%20%20%20%20export%20default%20interface%20Foo%20%7B%7D%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Adeclare%20module%20%22example2%22%20%7B%0D%0A%20%20%20%20import%20y%20from%20%22example%22%3B%0D%0A%20%20%20%20%2F%2F%20Actual%3A%20error%20TS2693%3A%20'y'%20only%20refers%20to%20a%20type%2C%20but%20is%20being%20used%20as%20a%20value%20here.%0D%0A%20%20%20%20const%20yy%3A%20typeof%20y%3B%0D%0A%7D%0D%0A)

**Related Issues:** #14080
Repository: pytorch
Issue: [Enhancement] Increase user-friendliness of dataset.random_split
Labels: triaged,enhancement,module: data

## Issue description

Currently, when using the [random_split function](https://github.com/pytorch/pytorch/blob/master/torch/utils/data/dataset.py)  the parameters that need to be given are:
- dataset
- list that contains the lengths of splits to be produced

This means a user has to calculate these upfront and add them to the function as parameters like this:
`train_size = int(0.8 * len(dataset))`
`test_size = len(dataset) - train_size`
`train_dataset, test_dataset = torch.utils.data.random_split(dataset, [train_size,test_size])`

Wouldn't it be better if the second parameter was a list that contains the percentages in which the users wants the split to happen, like this:
`train_dataset, test_dataset = torch.utils.data.random_split(dataset,[0.8,0.2])` .

The result of this change would be cleaner code for the user and also I believer in a more natural way of creating the splits.

I would like to pick this up as a pull request!





cc @VitalyFedyunin @ejguan
Repository: pytorch
Issue: [feature request] Publish wheels with debug symbols
Labels: module: binaries,triaged

It would be great if wheels of pytorch with debug symbols were published (or at least made available via https://ci.pytorch.org), so that users can investigate native crashes without going through the whole (error prone) process of building pytorch themselves.

For reference, I asked [the question on the forums first, but got no answer](https://discuss.pytorch.org/t/pytorch-wheel-with-debug-symbols/25169).

cc @ezyang @seemethere @malfet @walterddr
Repository: flutter
Issue: Tracing macros from FML and Fuchsia trace/event.h collide.
Labels: engine,platform-fuchsia,P2,team-engine,triaged-engine

Their APIs do not match exactly either which makes constructing the same tricky. FML should just have its own tracing variants with the FML_ prefix.
Repository: rust
Issue: try_replace, try_swap in RefCell (code included)
Labels: T-libs-api,C-feature-request

Every method has a non-panicking variant except for `replace` and `swap`. It would be fairly simple to add them, leveraging the `try_borrow_mut` method; here's the code:
```rust
/// An error returned by [`RefCell::try_replace`](struct.RefCell.html#method.try_replace).
pub struct ReplaceError { _private: () }

/// An error returned by [`RefCell::try_swap`](struct.RefCell.html#method.try_swap).
pub struct SwapError { _private: () }

/// Replaces the wrapped value with a new one, returning the old value,
/// without deinitializing either one, or an error if the value is currently
/// borrowed.
///
/// This function corresponds to [`std::mem::replace`](../mem/fn.replace.html).
///
/// This is the non-panicking variant of [`replace`](#method.replace)
#[inline]
#[unstable(feature = "try_replace_swap")]
pub fn try_replace(&self, t: T) -> Result<T, ReplaceError> {
    match self.try_borrow_mut() {
        Ok(mut b) => Ok(mem::replace(&mut *b, t)),
        Err(_) => Err(ReplaceError { _private: () })
    }
}


/// Swaps the wrapped value of `self` with the wrapped value of `other`,
/// without deinitializing either one. Returns an error if either value is
/// currently borrowed.
///
/// This function corresponds to [`std::mem::swap`](../mem/fn.swap.html).
///
/// This is the non-panicking variant of [`swap`](#method.swap)
#[inline]
#[unstable(feature = "try_replace_swap")]
pub fn try_swap(&self, other: &Self) -> Result<(), SwapError> {
    match (self.try_borrow_mut(), other.try_borrow_mut()) {
        (Ok(mut s), Ok(mut o)) => {
            mem::swap(&mut *s, &mut *o);
            Ok(())
        },
        _ => Err(SwapError { _private: () })
    }
}
```

I currently don't have the ability to clone the repo, test, etc. right now. I'm also bad at making examples, so those need to be added. 😏 

So I've made this issue. If / when I have time, I will probably try to make a PR for this myself, if no one's done it yet. However, that might be months...

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: go
Issue: spec: clarify order in which operands of multi-value assignments are evaluated
Labels: Documentation,NeedsInvestigation

(This issue is separated from https://github.com/golang/go/issues/27804 after I realized it is not a proposal but just a doc improvement. There are no language changes in the improvement.)

Currently, for assignments in Go, Go specification specifies

> The assignment proceeds in two phases. First, the operands of index expressions and pointer indirections (including implicit pointer indirections in selectors) on the left and the expressions on the right are all evaluated in the usual order. Second, the assignments are carried out in left-to-right order.

The rule description is some ambiguous. It doesn't specify clearly how the operands in the mentioned expressions on the left should be **exactly** evaluated. This is the cause of [some](https://github.com/golang/go/issues/23188#issuecomment-403951267) [disputes](https://github.com/golang/go/issues/15620).

For the following program, if it is compiled with `gccgo` (version 8), then it will panic. But if it is compiled with the standard Go compiler, then the program will exit without panicking.

```golang
package main

func main() {
	s := []int{1, 2, 3}
	s, s[2] = []int{1}, 9 // gccgo 8 think s[2] is index of range
}
```

Obviously, gccgo think the multi-value assignment is equivalent to 
```golang
	s = []int{1}
	s[2] = 9
```

However, the standard Go thinks it is equivalent to 
```golang
	tmp1 = &s
	tmp2 = &s[2]
	*tmp1, *tmp2 = []int{1}, 9
```

Most Go team members think the interpretation of the standard Go compiler is what Go specification wants to express. I also hold this opinion.

To avoid description ambiguities, it would be good to append the following description to the rule.

> In the first phase, if the map value in a destination expression is not addressable, the map value will be saved in and replaced by a temporary map value. Just before the second phase is carried out, each destination expression on the left will be further evaluated as its elementary form. Different destination expressions have different elementary forms:
> * If a destination expression is a blank identifier, then its elementary form is still a blank identifier.
> * If a destination expression is a map index expression `m[k]` then its elementary form is `(*maddr)[k]`, where `maddr` is the address of `m`.
> * For other cases, the destination expression must be addressable, then its elementary form is a dereference to its address.

I think these supplement descriptions can avoid the above mentioned disputes.

[update at Oct. 18, 2019]: [an imperfection](https://github.com/golang/go/issues/27821#issuecomment-543611217) is found by @mdempsky. The below is a simpler alternative improved description:
> .... Second, the assignments are carried out in left-to-right order. The assignments carried-out during the second phase don't affect the expression evaluation results got at the end of the first phase.
Repository: rust
Issue: Arrays not coercing a mutable reference in the first position
Labels: T-compiler,C-bug,A-coercions,A-array

Given i, j and k of type &mut isize, then `&mut [i,j,k]` moves i, but not j or k. I discovered this when calling `vec![i,j,k]`.

Similar issues: Arise from `let r = &mut 0; [&mut 0, r]; *r += 1;` works, but `let r = &mut 0; [r, &mut 0]; *r += 1;` complains about use of moved value `*r`.

See an example full program here: https://play.rust-lang.org/?gist=13c2a934ae9d3f6c22b62c433fee4244&version=stable&mode=debug&edition=2015
Repository: javascript-algorithms
Issue: Italian Language
Labels: enhancement

Can I help you with the Italian translation? You did a great job!
Repository: pytorch
Issue: Test the Caffe2 Installation with GPU erro
Labels: caffe2

Hi，everyone，when I test the Caffe2 Installation with GPU with this command：
python caffe2/python/operator_test/activation_ops_test.py
It shows ：
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:75: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:84: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:92: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
what‘s wrong？
My Hypothesis is 3.57.0
Repository: flutter
Issue: iPhone X nav drawer safety issue
Labels: e: device-specific,platform-ios,framework,has reproducible steps,P2,found in release: 3.3,found in release: 3.6,team-ios,triaged-ios

[This app](https://gist.github.com/jonahgreenthal/fe304c7d72e387345623f361d106c6d6) does not properly handle the iPhone X safe area:
![screen shot 2018-09-23 at 10 28 22 am](https://user-images.githubusercontent.com/737172/45929782-fe85bd80-bf1b-11e8-9d07-957a3d3e2209.png)
The gray background behind the logo should extend to the top of the drawer.

This may be similar to #12103.
Repository: vue
Issue: On SSR, do not escape RAW nodes
Labels: improvement

### What problem does this feature solve?
When rendering a script tag on server the content is escaped, breaking the js code.

```html
<script>
  var x = "y";
</script>
```

is rendered as 

```html
<script>
  var x = &quot;y&quot;;
</script>
```


### What does the proposed API look like?
A solution would be to allow users to define what to be escaped, to override this map

https://github.com/vuejs/vue/blob/833175e9d6e8f47367e49e1752cd149a677cdae8/src/platforms/web/server/util.js#L43

Or a option to disable escaping et all here 

https://github.com/vuejs/vue/blob/52719ccab8fccffbdf497b96d3731dc86f04c1ce/src/server/optimizing-compiler/codegen.js#L228

Thanks.

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: rust
Issue: Confusing error message with reference to boxed trait object
Labels: C-enhancement,A-diagnostics,T-compiler,A-coercions,D-confusing,A-trait-objects

```rust
fn main() {
    let _: Box<dyn '_ + Fn()> = Box::new(|| {});
    let _: &'_ Box<dyn '_ + Fn()> = &Box::new(|| {}); //~ ERROR
}
```
[Results in](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=de814d02496552c5d35241a9f39c5faa):
```
error[E0308]: mismatched types
 --> src/main.rs:3:37
  |
3 |     let _: &'_ Box<dyn '_ + Fn()> = &Box::new(|| {});
  |                                     ^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure
  |
  = note: expected type `&std::boxed::Box<dyn std::ops::Fn()>`
             found type `&std::boxed::Box<[closure@src/main.rs:3:47: 3:52]>`
```
This error message is confusing, because without the reference the types match up, so it seems odd that there's a type error as soon as a reference is introduced.
Repository: vue
Issue: Using multiple selects with v-model and bound and unbound values causes value overriding
Labels: bug,has workaround

### Version
2.5.17

### Reproduction link
[https://jsfiddle.net/du578xc0/32/](https://jsfiddle.net/du578xc0/32/)





### Steps to reproduce
change first select to "Some", then change newly displayed select. You will see that val2 is being set to the bound vals from the val1 select instead of it's own values.

You can change the first select to use the .number modifier on the v-model and exchange the bound number values for strings to fix this issue. (at least for this very specific desired effect).

You can "fix" the problem by either using v-bind:value on all values, or by using non-bound values on all values - but as far as I can tell, if you mix them, then it will cause this override bug

### What is expected?
different values for each variable

### What is actually happening?
second variable is being overwritten with the first's value

---
This was posted/discussed in the discord chat

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: rust
Issue: Expand examples on str functions
Labels: C-enhancement,P-medium,T-libs-api,A-docs

Functions like contains, starts_with, ends_with, match_indices, etc could use more examples, for example `foo.contains('\n')` (check if a string contains newlines).

find, split, matches, trim_matches, etc all have them.
Repository: TypeScript
Issue: Allow specifying regex for module alias paths
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

alias regex, import alias regex, regex

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

Allow specifying path alias using regex with match replacement.

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

Using path alias when they are automatically generated by custom script in webpack or more fine grained control over path resolution with more complex directories. Current approach does not allow having dynamic alias which consists of 1 or more intermediate path variables.

## Examples

<!-- Show how this would be used and what the behavior would be -->

Having this path: `<projectDir>/modules/Users/resources/js` should be resolvable with a regex, e.g.

**RegEx**: `^#(.+?)\/(.*)$`
**Resolve**: `./modules/$1/resources/js/$2`

So that importing from `'#Users/manage'` would be resolved to `modules/Users/resources/js/manage(.ts|.js)` etc..

## 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. new expression-level syntax)
Repository: flutter
Issue: How can I have an expansion panel with custom shadow?
Labels: c: new feature,framework,f: material design,P2,team-design,triaged-design

Hi, is there a way to change the expansion panel's shadow?
Repository: scrcpy
Issue: Show FPS directly on screen
Labels: feature request

Thanks for you work, but could you please show the FPS on the screen instead of stdout.
My English is poor, please don't mind.
Repository: angular
Issue: Animated child node's state is set to "void" when its parent is moved as a result of sorting.
Labels: type: bug/fix,area: animations,freq2: medium,P3

In [animation_integration_spec.ts - 'should retain state styles when the underlying DOM structure changes even if there are no insert/remove animations'], if you wrap the item in another div and move the animation to that div, like this:
`<div *ngFor="let item of items">
	<div class="item" [@color]="colorExp">{{ item }}</div>
</div>`
you will see that item "1" loses background color after sorting.

_Originally posted by @stmihai in https://github.com/angular/angular/pull/23534/comment#issuecomment-423910784_