nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: rust-analyzer/rust-analyzer
Pull request #318 (2018-12-21 22:46:44)

Remove a completed and an unactionable todo


Patch:
diff --git a/crates/ra_syntax/src/lexer.rs b/crates/ra_syntax/src/lexer.rs
index f388da273f..c6acd095e5 100644
--- a/crates/ra_syntax/src/lexer.rs
+++ b/crates/ra_syntax/src/lexer.rs
@@ -160,7 +160,7 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind {
                 // if we find one, then this is an invalid character literal
                 if ptr.at('\'') {
                     ptr.bump();
-                    return CHAR; // TODO: error reporting
+                    return CHAR;
                 }
                 LIFETIME
             } else {


Test patch:
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs
index 14ad836b52..4266864bdf 100644
--- a/crates/ra_syntax/tests/test.rs
+++ b/crates/ra_syntax/tests/test.rs
@@ -65,14 +65,10 @@ fn self_hosting_parsing() {
     for entry in walkdir::WalkDir::new(dir)
         .into_iter()
         .filter_entry(|entry| {
-            !entry
-                .path()
-                .components()
-                // TODO: this more neatly
-                .any(|component| {
-                    // Get all files which are not in the crates/ra_syntax/tests/data folder
-                    component == Component::Normal(OsStr::new("data"))
-                })
+            !entry.path().components().any(|component| {
+                // Get all files which are not in the crates/ra_syntax/tests/data folder
+                component == Component::Normal(OsStr::new("data"))
+            })
         })
         .map(|e| e.unwrap())
         .filter(|entry| {
Repository: aws/aws-sdk-go
Pull request #3534 (2020-09-14 16:06:57)

service/s3/s3manager:  Prefer using allocated slices from pool over allocating new ones.
Problem:
S3 uploader could allocate more memory than it is actually needed.
Added unit test should showcase the problem

For changes to files under the `/model/` folder, and manual edits to autogenerated code (e.g. `/service/s3/api.go`) please create an Issue instead of a PR for those type of changes.

If there is an existing bug or feature this PR is answers please reference it here.


skmcgrail: Thanks you for this contribution @mikhail-chebakov this is a nice optimization corner case you've found. I'll give this a look over and work on getting it merged in.

Patch:
diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md
index 8a1927a39..b9f8f0f7f 100644
--- a/CHANGELOG_PENDING.md
+++ b/CHANGELOG_PENDING.md
@@ -1,5 +1,6 @@
 ### SDK Features
 
 ### SDK Enhancements
+* `service/s3/s3manager`:  Prefer using allocated slices from pool over allocating new ones. ([#3534](https://github.com/aws/aws-sdk-go/pull/3534))
 
 ### SDK Bugs
diff --git a/service/s3/s3manager/pool.go b/service/s3/s3manager/pool.go
index 05113286d..f6f27fc48 100644
--- a/service/s3/s3manager/pool.go
+++ b/service/s3/s3manager/pool.go
@@ -60,6 +60,14 @@ func (p *maxSlicePool) Get(ctx aws.Context) (*[]byte, error) {
 				return nil, errZeroCapacity
 			}
 			return bs, nil
+		case <-ctx.Done():
+			p.mtx.RUnlock()
+			return nil, ctx.Err()
+		default:
+			// pass
+		}
+
+		select {
 		case _, ok := <-p.allocations:
 			p.mtx.RUnlock()
 			if !ok {


Test patch:
diff --git a/service/s3/s3manager/pool_test.go b/service/s3/s3manager/pool_test.go
index 55de684f6..e609a31a9 100644
--- a/service/s3/s3manager/pool_test.go
+++ b/service/s3/s3manager/pool_test.go
@@ -90,6 +90,33 @@ func TestMaxSlicePool(t *testing.T) {
 	pool.Close()
 }
 
+func TestPoolShouldPreferAllocatedSlicesOverNewAllocations(t *testing.T) {
+	pool := newMaxSlicePool(0)
+	defer pool.Close()
+
+	// Prepare pool: make it so that pool contains 1 allocated slice and 1 allocation permit
+	pool.ModifyCapacity(2)
+	initialSlice, err := pool.Get(context.Background())
+	if err != nil {
+		t.Errorf("failed to get slice from pool: %v", err)
+	}
+	pool.Put(initialSlice)
+
+	for i := 0; i < 100; i++ {
+		newSlice, err := pool.Get(context.Background())
+		if err != nil {
+			t.Errorf("failed to get slice from pool: %v", err)
+			return
+		}
+
+		if newSlice != initialSlice {
+			t.Errorf("pool allocated a new slice despite it having pre-allocated one")
+			return
+		}
+		pool.Put(newSlice)
+	}
+}
+
 type recordedPartPool struct {
 	recordedAllocs      uint64
 	recordedGets        uint64
Repository: rust-analyzer/rust-analyzer
Pull request #398 (2019-01-01 12:11:56)

Fix the same bug as #396 but for bytes too
#396


Patch:
diff --git a/crates/ra_syntax/src/validation/byte.rs b/crates/ra_syntax/src/validation/byte.rs
index d0897eeedb..714224b099 100644
--- a/crates/ra_syntax/src/validation/byte.rs
+++ b/crates/ra_syntax/src/validation/byte.rs
@@ -88,7 +88,9 @@ fn validate_byte_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxErr
 
 fn validate_byte_code_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxError>) {
     // A ByteCodeEscape has 4 chars, example: `\xDD`
-    if text.len() < 4 {
+    if !text.is_ascii() {
+        errors.push(SyntaxError::new(MalformedByteCodeEscape, range));
+    } else if text.chars().count() < 4 {
         errors.push(SyntaxError::new(TooShortByteCodeEscape, range));
     } else {
         assert!(


Test patch:
diff --git a/crates/ra_syntax/tests/data/parser/fuzz-failures/0004.rs b/crates/ra_syntax/tests/data/parser/fuzz-failures/0004.rs
new file mode 100644
index 0000000000..003290f52f
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/fuzz-failures/0004.rs
@@ -0,0 +1,1 @@
+b"\xʿ
\ No newline at end of file
Repository: rust-analyzer/rust-analyzer
Pull request #619 (2019-01-23 18:59:20)

More correct raw ident handling
Also added the suggested test from #616.

It passed before the change to `scan_ident`, but at least now it should ensure that the behavior stays the same.


Patch:
diff --git a/crates/ra_syntax/src/lexer.rs b/crates/ra_syntax/src/lexer.rs
index 0c3847120f..f9362120e1 100644
--- a/crates/ra_syntax/src/lexer.rs
+++ b/crates/ra_syntax/src/lexer.rs
@@ -190,16 +190,19 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind {
 }
 
 fn scan_ident(c: char, ptr: &mut Ptr) -> SyntaxKind {
-    match (c, ptr.current()) {
+    let is_raw = match (c, ptr.current()) {
         ('r', Some('#')) => {
             ptr.bump();
+            true
         }
         ('_', Some(c)) if !is_ident_continue(c) => return UNDERSCORE,
-        _ => {}
-    }
+        _ => false,
+    };
     ptr.bump_while(is_ident_continue);
-    if let Some(kind) = SyntaxKind::from_keyword(ptr.current_token_text()) {
-        return kind;
+    if !is_raw {
+        if let Some(kind) = SyntaxKind::from_keyword(ptr.current_token_text()) {
+            return kind;
+        }
     }
     IDENT
 }


Test patch:
diff --git a/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.rs b/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.rs
new file mode 100644
index 0000000000..d59a6d3476
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.rs
@@ -0,0 +1,1 @@
+fn foo() { let r#struct = 92; let r#trait = r#struct * 2; }
\ No newline at end of file
diff --git a/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.txt b/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.txt
new file mode 100644
index 0000000000..f03ed17f5d
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.txt
@@ -0,0 +1,49 @@
+SOURCE_FILE@[0; 59)
+  FN_DEF@[0; 59)
+    FN_KW@[0; 2)
+    WHITESPACE@[2; 3)
+    NAME@[3; 6)
+      IDENT@[3; 6) "foo"
+    PARAM_LIST@[6; 8)
+      L_PAREN@[6; 7)
+      R_PAREN@[7; 8)
+    WHITESPACE@[8; 9)
+    BLOCK@[9; 59)
+      L_CURLY@[9; 10)
+      WHITESPACE@[10; 11)
+      LET_STMT@[11; 29)
+        LET_KW@[11; 14)
+        WHITESPACE@[14; 15)
+        BIND_PAT@[15; 23)
+          NAME@[15; 23)
+            IDENT@[15; 23) "r#struct"
+        WHITESPACE@[23; 24)
+        EQ@[24; 25)
+        WHITESPACE@[25; 26)
+        LITERAL@[26; 28)
+          INT_NUMBER@[26; 28) "92"
+        SEMI@[28; 29)
+      WHITESPACE@[29; 30)
+      LET_STMT@[30; 57)
+        LET_KW@[30; 33)
+        WHITESPACE@[33; 34)
+        BIND_PAT@[34; 41)
+          NAME@[34; 41)
+            IDENT@[34; 41) "r#trait"
+        WHITESPACE@[41; 42)
+        EQ@[42; 43)
+        WHITESPACE@[43; 44)
+        BIN_EXPR@[44; 56)
+          PATH_EXPR@[44; 52)
+            PATH@[44; 52)
+              PATH_SEGMENT@[44; 52)
+                NAME_REF@[44; 52)
+                  IDENT@[44; 52) "r#struct"
+          WHITESPACE@[52; 53)
+          STAR@[53; 54)
+          WHITESPACE@[54; 55)
+          LITERAL@[55; 56)
+            INT_NUMBER@[55; 56) "2"
+        SEMI@[56; 57)
+      WHITESPACE@[57; 58)
+      R_CURLY@[58; 59)
Repository: rust-analyzer/rust-analyzer
Pull request #672 (2019-01-26 12:41:59)

dont overwrite memfies


Patch:
diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs
index d1b0222e79..70a13f7655 100644
--- a/crates/ra_vfs/src/lib.rs
+++ b/crates/ra_vfs/src/lib.rs
@@ -264,7 +264,9 @@ impl Vfs {
                 self.pending_changes.push(change);
             }
             TaskResult::AddSingleFile { root, path, text } => {
-                self.do_add_file(root, path, text, false);
+                if self.find_file(root, &path).is_none() {
+                    self.do_add_file(root, path, text, false);
+                }
             }
             TaskResult::ChangeSingleFile { root, path, text } => {
                 if let Some(file) = self.find_file(root, &path) {


Test patch:
diff --git a/crates/ra_vfs/tests/vfs.rs b/crates/ra_vfs/tests/vfs.rs
index 357e1c775e..545e1dbdd2 100644
--- a/crates/ra_vfs/tests/vfs.rs
+++ b/crates/ra_vfs/tests/vfs.rs
@@ -165,6 +165,18 @@ fn test_vfs_works() -> std::io::Result<()> {
         assert_eq!(path, "sub1/sub2/new1.rs")
     );
 
+    {
+        vfs.add_file_overlay(&dir.path().join("a/memfile.rs"), "memfile".to_string());
+        assert_match!(
+            vfs.commit_changes().as_slice(),
+            [VfsChange::AddFile { text, .. }],
+            assert_eq!(text.as_str(), "memfile")
+        );
+        fs::write(&dir.path().join("a/memfile.rs"), "ignore me").unwrap();
+        process_tasks(&mut vfs, 1);
+        assert_match!(vfs.commit_changes().as_slice(), []);
+    }
+
     // should be ignored
     fs::create_dir_all(dir.path().join("a/target")).unwrap();
     fs::write(&dir.path().join("a/target/new.rs"), "ignore me").unwrap();
Repository: rust-analyzer/rust-analyzer
Pull request #1301 (2019-05-21 11:53:10)

fix odrer-of-iteration bug in tests


Patch:
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index fa5882deab..b84cb75032 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -236,7 +236,7 @@ impl MockDatabase {
 }
 
 #[derive(Default)]
-pub struct CrateGraphFixture(pub FxHashMap<String, (String, Edition, Vec<String>)>);
+pub struct CrateGraphFixture(pub Vec<(String, (String, Edition, Vec<String>))>);
 
 #[macro_export]
 macro_rules! crate_graph {
@@ -246,10 +246,10 @@ macro_rules! crate_graph {
             #[allow(unused_mut, unused_assignments)]
             let mut edition = ra_db::Edition::Edition2018;
             $(edition = ra_db::Edition::from_string($edition);)?
-            res.0.insert(
+            res.0.push((
                 $crate_name.to_string(),
                 ($crate_path.to_string(), edition, vec![$($dep.to_string()),*])
-            );
+            ));
         )*
         res
     }}


Test patch:
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 958871b17f..14c8ee50b6 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -61,8 +61,8 @@ fn def_map(fixtute: &str) -> String {
     render_crate_def_map(&dm)
 }
 
-fn def_map_with_crate_graph(fixtute: &str, graph: CrateGraphFixture) -> String {
-    let dm = compute_crate_def_map(fixtute, Some(graph));
+fn def_map_with_crate_graph(fixture: &str, graph: CrateGraphFixture) -> String {
+    let dm = compute_crate_def_map(fixture, Some(graph));
     render_crate_def_map(&dm)
 }
 
@@ -423,8 +423,12 @@ fn extern_crate_rename() {
     );
 
     assert_snapshot_matches!(map, @r###"
-        ⋮crate
-        ⋮Arc: t v
+   ⋮crate
+   ⋮alloc_crate: t
+   ⋮sync: t
+   ⋮
+   ⋮crate::sync
+   ⋮Arc: t v
     "###);
 }
 
@@ -453,6 +457,10 @@ fn extern_crate_rename_2015_edition() {
     assert_snapshot_matches!(map,
         @r###"
    ⋮crate
+   ⋮alloc_crate: t
+   ⋮sync: t
+   ⋮
+   ⋮crate::sync
    ⋮Arc: t v
     "###
     );
Repository: kbknapp/clap-rs
Pull request #876 (2017-02-25 23:11:28)

switch to regex 0.2
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>

coveralls: 
[![Coverage Status](https://coveralls.io/builds/10331932/badge)](https://coveralls.io/builds/10331932)

Coverage remained the same at 90.859% when pulling **3a8a9de305ee3429e084fe43ae0cfd2aa840d123 on ignatenkobrain:regex-bump** into **6ec80662d324a3f3e1eaa9a72ebce561c4574680 on kbknapp:master**.

kbknapp: Thanks! @homu r+
homu: :pushpin: Commit 29813d2 has been approved by `kbknapp`

<!-- @homu r=kbknapp 29813d2399f2a96852799f922ecd17b744023f23 -->
homu: :hourglass: Testing commit 29813d2 with merge e97dbc7...
coveralls: 
[![Coverage Status](https://coveralls.io/builds/10339104/badge)](https://coveralls.io/builds/10339104)

Changes Unknown when pulling **29813d2399f2a96852799f922ecd17b744023f23 on ignatenkobrain:regex-bump** into ** on kbknapp:master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/10339104/badge)](https://coveralls.io/builds/10339104)

Changes Unknown when pulling **29813d2399f2a96852799f922ecd17b744023f23 on ignatenkobrain:regex-bump** into ** on kbknapp:master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/10339192/badge)](https://coveralls.io/builds/10339192)

Changes Unknown when pulling **29813d2399f2a96852799f922ecd17b744023f23 on ignatenkobrain:regex-bump** into ** on kbknapp:master**.


Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 60229cd9..011ac3fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ clippy    = { version = "~0.0.112", optional = true }
 atty      = { version = "0.2.2",  optional = true }
 
 [dev-dependencies]
-regex = "~0.1.80"
+regex = "0.2"
 
 [features]
 default     = ["suggestions", "color", "wrap_help"]


Test patch:
diff --git a/clap-test.rs b/clap-test.rs
index 918a00e8..ebbf9ea0 100644
--- a/clap-test.rs
+++ b/clap-test.rs
@@ -12,8 +12,8 @@ mod test {
               S2: AsRef<str> {
         let re = Regex::new("\x1b[^m]*m").unwrap();
         // Strip out any mismatching \r character on windows that might sneak in on either side
-        let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "");
-        let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "");
+        let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "").into_owned();
+        let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "").into_owned();
         let b = left == right;
         if !b {
             println!("");
@@ -69,4 +69,4 @@ mod test {
                                     .arg_from_usage("-o --option [scoption]... 'tests options'")
                                     .arg_from_usage("[scpositional] 'tests positionals'"))
     }
-}
\ No newline at end of file
+}
Repository: kbknapp/clap-rs
Pull request #877 (2017-02-26 22:54:37)

Implement `ExactSizeIterator` for `Values`.


Patch:
diff --git a/Cargo.toml b/Cargo.toml
index c1b9f7b8..011ac3fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,7 @@ A simple to use, efficient, and full featured  Command Line Argument Parser
 """
 
 [dependencies]
-bitflags              = "0.7.0"
+bitflags              = "0.8.0"
 vec_map               = "0.6.0"
 unicode-width         = "0.1.4"
 unicode-segmentation  = "1.0.1"
@@ -29,7 +29,7 @@ clippy    = { version = "~0.0.112", optional = true }
 atty      = { version = "0.2.2",  optional = true }
 
 [dev-dependencies]
-regex = "~0.1.80"
+regex = "0.2"
 
 [features]
 default     = ["suggestions", "color", "wrap_help"]
diff --git a/src/args/arg_matches.rs b/src/args/arg_matches.rs
index b20d490d..12364fdc 100644
--- a/src/args/arg_matches.rs
+++ b/src/args/arg_matches.rs
@@ -568,6 +568,8 @@ impl<'a> DoubleEndedIterator for Values<'a> {
     fn next_back(&mut self) -> Option<&'a str> { self.iter.next_back() }
 }
 
+impl<'a> ExactSizeIterator for Values<'a> {}
+
 /// An iterator over the key-value pairs of a map.
 #[derive(Clone)]
 pub struct Iter<'a, V: 'a> {


Test patch:
diff --git a/clap-test.rs b/clap-test.rs
index 918a00e8..ebbf9ea0 100644
--- a/clap-test.rs
+++ b/clap-test.rs
@@ -12,8 +12,8 @@ mod test {
               S2: AsRef<str> {
         let re = Regex::new("\x1b[^m]*m").unwrap();
         // Strip out any mismatching \r character on windows that might sneak in on either side
-        let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "");
-        let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "");
+        let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "").into_owned();
+        let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "").into_owned();
         let b = left == right;
         if !b {
             println!("");
@@ -69,4 +69,4 @@ mod test {
                                     .arg_from_usage("-o --option [scoption]... 'tests options'")
                                     .arg_from_usage("[scpositional] 'tests positionals'"))
     }
-}
\ No newline at end of file
+}
Repository: kbknapp/clap-rs
Pull request #924 (2017-04-05 14:52:29)

NextLineHelp with autogenerated help/ver bug


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kbknapp/clap-rs/924)
<!-- Reviewable:end -->


mention-bot: @kbknapp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hgrecco, @tormol and @sru to be potential reviewers.
kbknapp: I've run all the tests locally for both Linux and Windows. I'm going to push this through.

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19ee5e55..fef1c23d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+<a name="v2.23.1"></a>
+### v2.23.1 (2017-04-05)
+
+
+#### Bug Fixes
+
+*   fixes a missing newline character in the autogenerated help and version messages in some instances ([5ae9007d](https://github.com/kbknapp/clap-rs/commit/5ae9007d984ae94ae2752df51bcbaeb0ec89bc15))
+
+
 <a name="v2.23.0"></a>
 ## v2.23.0 (2017-04-05)
 
diff --git a/Cargo.toml b/Cargo.toml
index 306fd5c9..2f8c089d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 
 name = "clap"
-version = "2.23.0"
+version = "2.23.1"
 authors = ["Kevin K. <kbknapp@gmail.com>"]
 exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"]
 repository = "https://github.com/kbknapp/clap-rs.git"
diff --git a/README.md b/README.md
index 36b8677e..ee7e3191 100644
--- a/README.md
+++ b/README.md
@@ -45,8 +45,9 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
 
 ## What's New
 
-Here's the highlights for v2.23.0
+Here's the highlights for v2.23.1
 
+* fixes a missing newline character in the autogenerated help and version messages in some instances 
 * allows specifying a short help vs a long help (i.e. varying levels of detail depending on if -h or --help was used) 
 * **clap_app!:**  adds support for arg names with hyphens similar to longs with hyphens 
 * fixes a bug that wasn't allowing help and version to be properly overridden 
diff --git a/src/app/help.rs b/src/app/help.rs
index c79142fe..f8ca3348 100644
--- a/src/app/help.rs
+++ b/src/app/help.rs
@@ -498,6 +498,9 @@ impl<'a> Help<'a> {
                 }
                 try!(write!(self.writer, "{}", part));
             }
+        } else if nlh || self.force_next_line {
+            try!(write!(self.writer, "{}", help));
+            try!(write!(self.writer, "\n"));
         } else {
             try!(write!(self.writer, "{}", help));
         }


Test patch:
diff --git a/tests/help.rs b/tests/help.rs
index 89ed7ec6..0d515007 100644
--- a/tests/help.rs
+++ b/tests/help.rs
@@ -288,6 +288,7 @@ USAGE:
 FLAGS:
     -h, --help
             Prints help information
+
     -V, --version
             Prints version
             information";
Repository: kbknapp/clap-rs
Pull request #955 (2017-05-10 17:53:21)

fix: fixes a bug where positional argument help text is misaligned


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kbknapp/clap-rs/955)
<!-- Reviewable:end -->


mention-bot: @kbknapp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @sru, @mgeisler and @glowing-chemist to be potential reviewers.
coveralls: 
[![Coverage Status](https://coveralls.io/builds/11462191/badge)](https://coveralls.io/builds/11462191)

Coverage remained the same at 91.807% when pulling **ac10b3082973823e470bca857dc32157c5d83e4f on three-dots** into **c556b39fd0512bc3ea1e11d009390c2888194834 on master**.

kbknapp: @homu r+
homu: :pushpin: Commit ac10b30 has been approved by `kbknapp`

<!-- @homu r=kbknapp ac10b3082973823e470bca857dc32157c5d83e4f -->
homu: :hourglass: Testing commit ac10b30 with merge 795c31e...
homu: :boom: Test timed out

Patch:
diff --git a/src/args/arg_builder/positional.rs b/src/args/arg_builder/positional.rs
index 82c2f11e..b80a235e 100644
--- a/src/args/arg_builder/positional.rs
+++ b/src/args/arg_builder/positional.rs
@@ -104,7 +104,7 @@ impl<'n, 'e> Display for PosBuilder<'n, 'e> {
         } else {
             try!(write!(f, "<{}>", self.b.name));
         }
-        if self.b.settings.is_set(ArgSettings::Multiple) && self.v.val_names.is_none() {
+        if self.b.settings.is_set(ArgSettings::Multiple) && (self.v.val_names.is_none() || self.v.val_names.as_ref().unwrap().len() == 1) {
             try!(write!(f, "..."));
         }
 


Test patch:
diff --git a/tests/help.rs b/tests/help.rs
index 73b695cc..32dda3e3 100644
--- a/tests/help.rs
+++ b/tests/help.rs
@@ -398,8 +398,8 @@ OPTIONS:
     -t, --timeout <SECONDS>    Timeout in seconds. By default, there is no timeout.
 
 ARGS:
-    <BINFILE>    The path of the binary to be profiled. If empty, Cargo.toml is searched for a binary.
-    <ARGS>...       Any arguments you wish to pass to the binary being profiled.";
+    <BINFILE>    The path of the binary to be profiled. for a binary.
+    <ARGS>...    Any arguments you wish to pass to the being profiled.";
 
 static LAST_ARG_REQ_MULT: &'static str = "example 1.0
 
@@ -501,12 +501,12 @@ fn args_with_last_usage() {
             .takes_value(true)
         )
         .arg(Arg::with_name("binary path")
-            .help("The path of the binary to be profiled. If empty, Cargo.toml is searched for a binary.")
+            .help("The path of the binary to be profiled. for a binary.")
             .takes_value(true)
             .value_name("BINFILE")
         )
         .arg(Arg::with_name("pass through args")
-            .help("Any arguments you wish to pass to the binary being profiled.")
+            .help("Any arguments you wish to pass to the being profiled.")
             .value_name("ARGS")
             .last(true)
             .multiple(true)