Skip to content

Commit d71c9f0

Browse files
author
Ariel Ben-Yehuda
committed
---
yaml --- r: 235187 b: refs/heads/stable c: 78761d6 h: refs/heads/master i: 235185: 2492579 235183: 5052f9d v: v3
1 parent a6e0cf0 commit d71c9f0

File tree

7 files changed

+52
-31
lines changed

7 files changed

+52
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 20f421cd522e35021049d6ec31f6b6ea3fc68c06
32+
refs/heads/stable: 78761d64a990a58c7c99688717e77ed0ea477e2a
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/mk/main.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
295295
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
296296
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
297297
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
298+
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
298299
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
299300
ifeq ($$(findstring freebsd,$(1)),freebsd)
300301
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/stable/src/doc/trpl/comments.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ fn add_one(x: i32) -> i32 {
3838
}
3939
```
4040

41-
There is another style of doc comment, `//!`, to comment containing items (e.g.
42-
crates, modules or functions), instead of the items following it. Commonly used
43-
inside crates root (lib.rs) or modules root (mod.rs):
44-
45-
```
46-
//! # The Rust Standard Library
47-
//!
48-
//! The Rust Standard Library provides the essential runtime
49-
//! functionality for building portable Rust software.
50-
```
51-
5241
When writing doc comments, providing some examples of usage is very, very
5342
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
5443
two values, and `panic!`s if they’re not equal to each other. It’s very helpful

branches/stable/src/etc/mklldeps.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
f = open(sys.argv[1], 'wb')
1616

17-
components = sys.argv[2].split() # splits on whitespace
17+
components = sys.argv[2].split(' ')
18+
components = [i for i in components if i] # ignore extra whitespaces
1819
enable_static = sys.argv[3]
19-
llvm_config = sys.argv[4]
20+
llconfig = sys.argv[4]
2021

2122
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2223
// file at the top-level directory of this distribution and at
@@ -38,15 +39,15 @@ def run(args):
3839
out, err = proc.communicate()
3940

4041
if err:
41-
print("failed to run llvm_config: args = `{}`".format(args))
42+
print("failed to run llconfig: args = `{}`".format(args))
4243
print(err)
4344
sys.exit(1)
4445
return out
4546

4647
f.write("\n")
4748

4849
# LLVM libs
49-
args = [llvm_config, '--libs', '--system-libs']
50+
args = [llconfig, '--libs', '--system-libs']
5051

5152
args.extend(components)
5253
out = run(args)
@@ -68,13 +69,13 @@ def run(args):
6869
f.write(")]\n")
6970

7071
# LLVM ldflags
71-
out = run([llvm_config, '--ldflags'])
72+
out = run([llconfig, '--ldflags'])
7273
for lib in out.strip().split(' '):
7374
if lib[:2] == "-l":
7475
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
7576

7677
# C++ runtime library
77-
out = run([llvm_config, '--cxxflags'])
78+
out = run([llconfig, '--cxxflags'])
7879
if enable_static == '1':
7980
assert('stdlib=libc++' not in out)
8081
f.write("#[link(name = \"stdc++\", kind = \"static\")]\n")

branches/stable/src/librustc_typeck/astconv.rs

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ fn report_ambiguous_associated_type(tcx: &ty::ctxt,
11131113
// any ambiguity.
11141114
fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11151115
ty_param_node_id: ast::NodeId,
1116+
ty_param_name: Option<ast::Name>,
11161117
assoc_name: ast::Name,
11171118
span: Span)
11181119
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
@@ -1138,12 +1139,21 @@ fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11381139
.filter(|b| this.trait_defines_associated_type_named(b.def_id(), assoc_name))
11391140
.collect();
11401141

1141-
let ty_param_name = tcx.type_parameter_def(ty_param_node_id).name;
1142-
one_bound_for_assoc_type(tcx,
1143-
suitable_bounds,
1144-
&token::get_name(ty_param_name),
1145-
&token::get_name(assoc_name),
1146-
span)
1142+
if let Some(s) = ty_param_name {
1143+
// borrowck doesn't like this any other way
1144+
one_bound_for_assoc_type(tcx,
1145+
suitable_bounds,
1146+
&token::get_name(s),
1147+
&token::get_name(assoc_name),
1148+
span)
1149+
} else {
1150+
one_bound_for_assoc_type(tcx,
1151+
suitable_bounds,
1152+
"Self",
1153+
&token::get_name(assoc_name),
1154+
span)
1155+
1156+
}
11471157
}
11481158

11491159

@@ -1240,12 +1250,20 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
12401250
_ => unreachable!()
12411251
}
12421252
}
1243-
(&ty::TyParam(_), def::DefTyParam(..)) |
1244-
(&ty::TyParam(_), def::DefSelfTy(Some(_), None)) => {
1245-
// A type parameter or Self, we need to find the associated item from
1246-
// a bound.
1247-
let ty_param_node_id = ty_path_def.local_node_id();
1248-
match find_bound_for_assoc_item(this, ty_param_node_id, assoc_name, span) {
1253+
(&ty::TyParam(_), def::DefSelfTy(Some(trait_did), None)) => {
1254+
assert_eq!(trait_did.krate, ast::LOCAL_CRATE);
1255+
match find_bound_for_assoc_item(this, trait_did.node, None, assoc_name, span) {
1256+
Ok(bound) => bound,
1257+
Err(ErrorReported) => return (tcx.types.err, ty_path_def),
1258+
}
1259+
}
1260+
(&ty::TyParam(_), def::DefTyParam(_, _, param_did, param_name)) => {
1261+
assert_eq!(param_did.krate, ast::LOCAL_CRATE);
1262+
match find_bound_for_assoc_item(this,
1263+
param_did.node,
1264+
Some(param_name),
1265+
assoc_name,
1266+
span) {
12491267
Ok(bound) => bound,
12501268
Err(ErrorReported) => return (tcx.types.err, ty_path_def),
12511269
}

branches/stable/src/libstd/collections/hash/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub trait HashState {
3838
/// A structure which is a factory for instances of `Hasher` which implement the
3939
/// default trait.
4040
///
41-
/// This struct is 0-sized and does not need construction.
41+
/// This struct has is 0-sized and does not need construction.
4242
pub struct DefaultState<H>(marker::PhantomData<H>);
4343

4444
impl<H: Default + hash::Hasher> HashState for DefaultState<H> {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn avg<T=T::Item>(_: T) {} //~ ERROR associated type `Item` not found for `T`
12+
fn main() {}

0 commit comments

Comments
 (0)