Skip to content

Commit 39557b1

Browse files
committed
---
yaml --- r: 106339 b: refs/heads/auto c: 940bfb2 h: refs/heads/master i: 106337: aced0ee 106335: 4e29bbb v: v3
1 parent 8c241d7 commit 39557b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+528
-579
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 29436d54ee64f202730d6e21d3b078ed6f1948b0
16+
refs/heads/auto: 940bfb2ce0c08de32d02d8a1ee3844db70e497d9
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/Makefile.in

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ include config.mk
177177

178178
# Just a few macros used everywhere
179179
include $(CFG_SRC_DIR)mk/util.mk
180-
# Reconfiguring when the makefiles or submodules change
181-
include $(CFG_SRC_DIR)mk/reconfig.mk
182180
# All crates and their dependencies
183181
include $(CFG_SRC_DIR)mk/crates.mk
182+
# Reconfiguring when the makefiles or submodules change
183+
include $(CFG_SRC_DIR)mk/reconfig.mk
184184
# Various bits of setup, common macros, and top-level rules
185185
include $(CFG_SRC_DIR)mk/main.mk
186186
# C and assembly components that are not LLVM
@@ -232,20 +232,19 @@ ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
232232
include $(CFG_SRC_DIR)mk/prepare.mk
233233
endif
234234

235+
# (Unix) Installation from the build directory
236+
ifneq ($(findstring install,$(MAKECMDGOALS)),)
237+
CFG_INFO := $(info cfg: including install rules)
238+
include $(CFG_SRC_DIR)mk/install.mk
239+
endif
240+
235241
# Source and binary distribution artifacts
236242
ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
237-
$(findstring install,$(MAKECMDGOALS)) \
238243
$(findstring clean,$(MAKECMDGOALS))),)
239244
CFG_INFO := $(info cfg: including dist rules)
240245
include $(CFG_SRC_DIR)mk/dist.mk
241246
endif
242247

243-
# (Unix) Installation from the build directory
244-
ifneq ($(findstring install,$(MAKECMDGOALS)),)
245-
CFG_INFO := $(info cfg: including install rules)
246-
include $(CFG_SRC_DIR)mk/install.mk
247-
endif
248-
249248
# Cleaning
250249
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
251250
CFG_INFO := $(info cfg: including clean rules)

branches/auto/configure

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
383383
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
384384
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
385385
opt rpath 1 "build rpaths into rustc itself"
386-
opt nightly 0 "build nightly packages"
387386
valopt prefix "/usr/local" "set installation prefix"
388387
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
389388
valopt llvm-root "" "set LLVM root"
@@ -402,8 +401,7 @@ valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
402401
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
403402

404403
# On windows we just store the libraries in the bin directory because
405-
# there's no rpath. This is where the build system itself puts libraries;
406-
# --libdir is used to configure the installation directory.
404+
# there's no rpath
407405
# FIXME: Thise needs to parameterized over target triples. Do it in platform.mk
408406
CFG_LIBDIR_RELATIVE=lib
409407
if [ "$CFG_OSTYPE" = "pc-mingw32" ]
@@ -412,6 +410,7 @@ then
412410
fi
413411

414412
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
413+
valopt rustlibdir "rustlib" "subdirectory name for rustc's libraries"
415414

416415
if [ $HELP -eq 1 ]
417416
then
@@ -778,10 +777,10 @@ do
778777
make_dir $h/stage$i/test
779778

780779
# target bin dir
781-
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/bin
780+
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/$CFG_RUSTLIBDIR/$t/bin
782781

783782
# target lib dir
784-
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/lib
783+
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/$CFG_RUSTLIBDIR/$t/lib
785784
done
786785
done
787786

@@ -1040,6 +1039,7 @@ putvar CFG_HOST
10401039
putvar CFG_TARGET
10411040
putvar CFG_C_COMPILER
10421041
putvar CFG_LIBDIR
1042+
putvar CFG_RUSTLIBDIR
10431043
putvar CFG_LIBDIR_RELATIVE
10441044
putvar CFG_DISABLE_MANAGE_SUBMODULES
10451045
putvar CFG_ANDROID_CROSS_PATH

branches/auto/mk/crates.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ COMPILER_DOC_CRATES := rustc syntax
105105
# $(1) is the crate to generate variables for
106106
define RUST_CRATE
107107
CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs
108-
RSINPUTS_$(1) := $$(call rwildcard,$(S)src/lib$(1)/,*.rs)
108+
RSINPUTS_$(1) := $$(wildcard $$(addprefix $(S)src/lib$(1), \
109+
*.rs */*.rs */*/*.rs */*/*/*.rs))
109110
RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1)))
110111
NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1))))
111112
endef
@@ -116,7 +117,8 @@ $(foreach crate,$(CRATES),$(eval $(call RUST_CRATE,$(crate))))
116117
#
117118
# $(1) is the crate to generate variables for
118119
define RUST_TOOL
119-
TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
120+
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $$(dir $$(TOOL_SOURCE_$(1))), \
121+
*.rs */*.rs */*/*.rs */*/*/*.rs))
120122
endef
121123

122124
$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))

branches/auto/mk/dist.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# * dist-tar-bins - Ad-hoc Unix binary installers
2323
# * dist-docs - Stage docs for upload
2424

25-
PKG_NAME := $(CFG_PACKAGE_NAME)
25+
PKG_NAME = $(CFG_PACKAGE_NAME)
2626

2727
# License suitable for displaying in a popup
2828
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
@@ -199,10 +199,8 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
199199
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
200200
dist-install-dir-$(1): PREPARE_CLEAN=true
201201
dist-install-dir-$(1): prepare-base-dir-$(1)
202-
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
203-
> tmp/dist/manifest-$(1).in
204-
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
205-
# Add remaining non-installed files
202+
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f) \
203+
> $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/$$(CFG_RUSTLIBDIR)/manifest
206204
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
207205
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
208206
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)

branches/auto/mk/install.mk

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,70 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11+
# FIXME: Docs are currently not installed from the stageN dirs.
12+
# For consistency it might be desirable for stageN to be an exact
13+
# mirror of the installation directory structure.
1114

12-
install: dist-install-dir-$(CFG_BUILD)
13-
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)"
14-
# Remove tmp files while we can because they may have been created under sudo
15-
$(Q)rm -R tmp/dist/$(PKG_NAME)-$(CFG_BUILD/
15+
# The stage we install from
16+
ISTAGE = $(PREPARE_STAGE)
1617

17-
uninstall: dist-install-dir-$(CFG_BUILD)
18-
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)"
18+
$(eval $(call DEF_PREPARE,mkfile-install))
1919

20+
install: PREPARE_HOST=$(CFG_BUILD)
21+
install: PREPARE_TARGETS=$(CFG_TARGET)
22+
install: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
23+
install: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
24+
install: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
25+
install: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
26+
install: PREPARE_SOURCE_DIR=$(PREPARE_HOST)/stage$(PREPARE_STAGE)
27+
install: PREPARE_SOURCE_BIN_DIR=$(PREPARE_SOURCE_DIR)/bin
28+
install: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE)
29+
install: PREPARE_SOURCE_MAN_DIR=$(S)/man
30+
install: PREPARE_DEST_BIN_DIR=$(DESTDIR)$(CFG_PREFIX)/bin
31+
install: PREPARE_DEST_LIB_DIR=$(DESTDIR)$(CFG_LIBDIR)
32+
install: PREPARE_DEST_MAN_DIR=$(DESTDIR)$(CFG_MANDIR)/man1
33+
install: prepare-everything-mkfile-install
34+
35+
36+
# Uninstall code
37+
38+
PREFIX_ROOT = $(CFG_PREFIX)
39+
PREFIX_BIN = $(PREFIX_ROOT)/bin
40+
PREFIX_LIB = $(CFG_LIBDIR)
41+
42+
INSTALL_TOOLS := $(PREPARE_TOOLS)
43+
44+
# Shorthand for build/stageN/bin
45+
HB = $(HBIN$(ISTAGE)_H_$(CFG_BUILD))
46+
HB2 = $(HBIN2_H_$(CFG_BUILD))
47+
# Shorthand for build/stageN/lib
48+
HL = $(HLIB$(ISTAGE)_H_$(CFG_BUILD))
49+
# Shorthand for the prefix bin directory
50+
PHB = $(PREFIX_BIN)
51+
# Shorthand for the prefix bin directory
52+
PHL = $(PREFIX_LIB)
53+
54+
HOST_LIB_FROM_HL_GLOB = \
55+
$(patsubst $(HL)/%,$(PHL)/%,$(wildcard $(HL)/$(1)))
56+
57+
uninstall: $(foreach tool,$(INSTALL_TOOLS),uninstall-tool-$(tool))
58+
$(Q)rm -Rf $(PHL)/$(CFG_RUSTLIBDIR)
59+
60+
define UNINSTALL_TOOL
61+
uninstall-tool-$(1): $$(foreach dep,$$(TOOL_DEPS_$(1)),uninstall-lib-$$(dep))
62+
$$(Q)rm -f $$(PHB)/$(1)$$(X_$$(CFG_BUILD))
63+
$$(Q)rm -f $$(CFG_MANDIR)/man1/$(1).1
64+
endef
65+
66+
$(foreach tool,$(INSTALL_TOOLS),$(eval $(call UNINSTALL_TOOL,$(tool))))
67+
68+
define UNINSTALL_LIB
69+
uninstall-lib-$(1): $$(foreach dep,$$(RUST_DEPS_$(1)),uninstall-lib-$$(dep))
70+
$$(Q)rm -f $$(call HOST_LIB_FROM_HL_GLOB,$$(call CFG_LIB_GLOB_$$(CFG_BUILD),$(1)))
71+
endef
72+
73+
$(foreach lib,$(CRATES),$(eval $(call UNINSTALL_LIB,$(lib))))
2074

21-
######################################################################
22-
# Android remote installation
23-
######################################################################
2475

2576
# Android runtime setup
2677
# FIXME: This probably belongs somewhere else

branches/auto/mk/main.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
CFG_RELEASE_NUM=0.10
1717
CFG_RELEASE_LABEL=-pre
1818

19-
ifndef CFG_ENABLE_NIGHTLY
19+
ifndef CFG_NIGHTLY
2020
# This is the normal version string
2121
CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)
2222
CFG_PACKAGE_VERS=$(CFG_RELEASE)
@@ -281,6 +281,7 @@ export CFG_LLVM_ROOT
281281
export CFG_ENABLE_MINGW_CROSS
282282
export CFG_PREFIX
283283
export CFG_LIBDIR
284+
export CFG_RUSTLIBDIR
284285
export CFG_LIBDIR_RELATIVE
285286
export CFG_DISABLE_INJECT_STD_VERSION
286287

@@ -301,7 +302,7 @@ HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
301302
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
302303

303304
# Destinations of artifacts for target architectures
304-
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)
305+
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLIBDIR)/$(2)
305306
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
306307
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
307308

branches/auto/mk/prepare.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ PREPARE_TOOLS = $(filter-out compiletest, $(TOOLS))
8686
define DEF_PREPARE_HOST_TOOL
8787
prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \
8888
$$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \
89-
$$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \
9089
prepare-host-dirs-$(4)
9190
$$(if $$(findstring $(2), $$(PREPARE_STAGE)),\
9291
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
@@ -122,8 +121,8 @@ endef
122121
# $(4) tag
123122
define DEF_PREPARE_TARGET_N
124123
# Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets
125-
prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(2)/lib
126-
prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib
124+
prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib
125+
prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib
127126
prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
128127
$$(foreach crate,$$(TARGET_CRATES), \
129128
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \

branches/auto/mk/stage0.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(SNAPSHOT_RUSTC_POST_CLEANUP): \
1515
# Note: the variable "SNAPSHOT_FILE" is generally not set, and so
1616
# we generally only pass one argument to this script.
1717
ifdef CFG_ENABLE_LOCAL_RUST
18-
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) rustlib
18+
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) $(CFG_RUSTLIBDIR)
1919
else
2020
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
2121
ifdef CFG_ENABLE_PAX_FLAGS

branches/auto/mk/target.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# This is the compile-time target-triple for the compiler. For the compiler at
1212
# runtime, this should be considered the host-triple. More explanation for why
1313
# this exists can be found on issue #2400
14-
export CFG_COMPILER_HOST_TRIPLE
14+
export CFG_COMPILER
1515

1616
# The standard libraries should be held up to a higher standard than any old
1717
# code, make sure that these common warnings are denied by default. These can
@@ -68,7 +68,7 @@ $(foreach host,$(CFG_HOST), \
6868
# $(4) is the crate name
6969
define RUST_TARGET_STAGE_N
7070

71-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
71+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER = $(2)
7272
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7373
$$(CRATEFILE_$(4)) \
7474
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \

branches/auto/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ifdef CFG_WINDOWSY_$(1)
104104
stage2/$$(CFG_LIBDIR_RELATIVE), \
105105
$$(if $$(findstring stage3,$$(1)), \
106106
stage3/$$(CFG_LIBDIR_RELATIVE), \
107-
)))))/rustlib/$$(CFG_BUILD)/lib
107+
)))))/$$(CFG_RUSTLIBDIR)/$$(CFG_BUILD)/lib
108108
CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(3)),$$(1))
109109
endif
110110

@@ -350,7 +350,7 @@ else
350350
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
351351
endif
352352

353-
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2)
353+
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
354354
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
355355
$$(CRATEFILE_$(4)) \
356356
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))

branches/auto/src/doc/tutorial.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal muta
21032103
These are types that do not contain any data whose lifetime is bound to
21042104
a particular stack frame. These are types that do not contain any
21052105
references, or types where the only contained references
2106-
have the `'static` lifetime. (For more on named lifetimes and their uses,
2106+
have the `'static` lifetime. (For more on named lifetimes and their uses,
21072107
see the [references and lifetimes guide][lifetimes].)
21082108
21092109
> ***Note:*** These two traits were referred to as 'kinds' in earlier
@@ -2430,25 +2430,23 @@ select the method to call at runtime.
24302430
24312431
This usage of traits is similar to Java interfaces.
24322432
2433-
There are some built-in bounds, such as `Send` and `Share`, which are properties
2434-
of the components of types. By design, trait objects don't know the exact type
2435-
of their contents and so the compiler cannot reason about those properties.
2433+
By default, each of the three storage classes for traits enforce a
2434+
particular set of built-in kinds that their contents must fulfill in
2435+
order to be packaged up in a trait object of that storage class.
24362436
2437-
You can instruct the compiler, however, that the contents of a trait object must
2438-
acribe to a particular bound with a trailing colon (`:`). These are examples of
2439-
valid types:
2437+
* The contents of owned traits (`~Trait`) must fulfill the `Send` bound.
2438+
* The contents of reference traits (`&Trait`) are not constrained by any bound.
24402439
2441-
~~~rust
2442-
trait Foo {}
2443-
trait Bar<T> {}
2440+
Consequently, the trait objects themselves automatically fulfill their
2441+
respective kind bounds. However, this default behavior can be overridden by
2442+
specifying a list of bounds on the trait type, for example, by writing `~Trait:`
2443+
(which indicates that the contents of the owned trait need not fulfill any
2444+
bounds), or by writing `~Trait:Send+Share`, which indicates that in addition
2445+
to fulfilling `Send`, contents must also fulfill `Share`, and as a consequence,
2446+
the trait itself fulfills `Share`.
24442447
2445-
fn sendable_foo(f: ~Foo:Send) { /* ... */ }
2446-
fn shareable_bar<T: Share>(b: &Bar<T>: Share) { /* ... */ }
2447-
~~~
2448-
2449-
When no colon is specified (such as the type `~Foo`), it is inferred that the
2450-
value ascribes to no bounds. They must be added manually if any bounds are
2451-
necessary for usage.
2448+
* `~Trait:Send` is equivalent to `~Trait`.
2449+
* `&Trait:` is equivalent to `&Trait`.
24522450
24532451
Builtin kind bounds can also be specified on closure types in the same way (for
24542452
example, by writing `fn:Send()`), and the default behaviours are the same as

0 commit comments

Comments
 (0)