From 4b00e871035ae52fb936cd4282cf383a6dcb1e05 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Thu, 26 Feb 2015 09:10:17 +0000 Subject: [PATCH 1/9] Standardize manpage markup Use consistent markup between rust and rustdoc manpages. Avoid use of the troublesome unquoted '-' troff character. --- man/rustc.1 | 267 +++++++++++++++++++++++++++++--------------------- man/rustdoc.1 | 102 ++++++++++--------- 2 files changed, 210 insertions(+), 159 deletions(-) diff --git a/man/rustc.1 b/man/rustc.1 index 49056afa045..5b2d6a52fb6 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -7,224 +7,267 @@ rustc \- The Rust compiler .SH DESCRIPTION This program is a compiler for the Rust language, available at -<\fBhttps://www.rust-lang.org\fR>. +.UR https://www.rust\-lang.org +.UE . .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR -Display the help message +Display the help message. .TP -\fB\-\-cfg\fR SPEC -Configure the compilation environment +\fB\-\-cfg\fR \fISPEC\fR +Configure the compilation environment. .TP -\fB\-L\fR [KIND=]PATH -Add a directory to the library search path. The optional KIND can be one of: - dependency = only lookup transitive dependencies here - crate = only lookup local `extern crate` directives here - native = only lookup native libraries here - framework = only look for OSX frameworks here - all = look for anything here (the default) +\fB\-L\fR [\fIKIND\fR=]\fIPATH\fR +Add a directory to the library search path. +The optional \fIKIND\fR can be one of: +.RS .TP -\fB\-l\fR [KIND=]NAME -Link the generated crate(s) to the specified native library NAME. The optional -KIND can be one of, static, dylib, or framework. If omitted, dylib is assumed. +\fBdependency\fR +only lookup transitive dependencies here .TP -\fB\-\-crate-type\fR [bin|lib|rlib|dylib|staticlib] -Comma separated list of types of crates for the compiler to emit +.B crate +only lookup local `extern crate` directives here .TP -\fB\-\-crate-name NAME\fR -Specify the name of the crate being built +.B native +only lookup native libraries here .TP -\fB\-\-emit\fR [asm|llvm-bc|llvm-ir|obj|link|dep-info] -Configure the output that rustc will produce +.B framework +only look for OSX frameworks here .TP -\fB\-\-print\fR [crate-name|file-names|sysroot] -Comma separated list of compiler information to print on stdout +.B all +look for anything here (the default) +.RE +.TP +\fB\-l\fR [\fIKIND\fR=]\fINAME\fR +Link the generated crate(s) to the specified native library \fINAME\fR. +The optional \fIKIND\fR can be one of \fIstatic\fR, \fIdylib\fR, or +\fIframework\fR. +If omitted, \fIdylib\fR is assumed. +.TP +\fB\-\-crate\-type\fR [bin|lib|rlib|dylib|staticlib] +Comma separated list of types of crates for the compiler to emit. +.TP +\fB\-\-crate\-name\fR \fINAME\fR +Specify the name of the crate being built. +.TP +\fB\-\-emit\fR [asm|llvm\-bc|llvm\-ir|obj|link|dep\-info] +Configure the output that \fBrustc\fR will produce. +.TP +\fB\-\-print\fR [crate\-name|file\-names|sysroot] +Comma separated list of compiler information to print on stdout. .TP \fB\-g\fR -Equivalent to \fI\-C\fR debuginfo=2 +Equivalent to \fI\-C\ debuginfo=2\fR. .TP \fB\-O\fR -Equivalent to \fI\-C\fR opt-level=2 +Equivalent to \fI\-C\ opt\-level=2\fR. .TP -\fB\-o\fR FILENAME -Write output to . Ignored if multiple \fI\-\-emit\fR outputs are -specified. +\fB\-o\fR \fIFILENAME\fR +Write output to \fIFILENAME\fR. +Ignored if multiple \fI\-\-emit\fR outputs are specified. .TP -\fB\-\-out\-dir\fR DIR -Write output to compiler-chosen filename in . Ignored if \fI\-o\fR is -specified. Defaults to the current directory. +\fB\-\-out\-dir\fR \fIDIR\fR +Write output to compiler\[hy]chosen filename in \fIDIR\fR. +Ignored if \fI\-o\fR is specified. +Defaults to the current directory. .TP -\fB\-\-explain\fR OPT -Provide a detailed explanation of an error message +\fB\-\-explain\fR \fIOPT\fR +Provide a detailed explanation of an error message. .TP \fB\-\-test\fR -Build a test harness +Build a test harness. .TP -\fB\-\-target\fR TRIPLE -Target triple cpu-manufacturer-kernel[-os] to compile for (see chapter 3.4 of -http://www.sourceware.org/autobook/ for details) +\fB\-\-target\fR \fITRIPLE\fR +Target triple \fIcpu\fR\-\fImanufacturer\fR\-\fIkernel\fR[\-\fIos\fR] +to compile for (see chapter 3.4 of +.UR http://www.sourceware.org/autobook/ +.UE +for details). .TP -\fB\-W\fR help -Print 'lint' options and default settings +\fB\-W help\fR +Print 'lint' options and default settings. .TP -\fB\-W\fR OPT, \fB\-\-warn\fR OPT -Set lint warnings +\fB\-W\fR \fIOPT\fR, \fB\-\-warn\fR \fIOPT\fR +Set lint warnings. .TP -\fB\-A\fR OPT, \fB\-\-allow\fR OPT -Set lint allowed +\fB\-A\fR \fIOPT\fR, \fB\-\-allow\fR \fIOPT\fR +Set lint allowed. .TP -\fB\-D\fR OPT, \fB\-\-deny\fR OPT -Set lint denied +\fB\-D\fR \fIOPT\fR, \fB\-\-deny\fR \fIOPT\fR +Set lint denied. .TP -\fB\-F\fR OPT, \fB\-\-forbid\fR OPT -Set lint forbidden +\fB\-F\fR \fIOPT\fR, \fB\-\-forbid\fR \fIOPT\fR +Set lint forbidden. .TP -\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL] -Set a codegen-related flag to the value specified. Use "-C help" to print -available flags. See CODEGEN OPTIONS below +\fB\-C\fR \fIFLAG\fR[=\fIVAL\fR], \fB\-\-codegen\fR \fIFLAG\fR[=\fIVAL\fR] +Set a codegen\[hy]related flag to the value specified. +Use \fI\-C help\fR to print available flags. +See CODEGEN OPTIONS below. .TP \fB\-V\fR, \fB\-\-version\fR -Print version info and exit +Print version info and exit. .TP \fB\-v\fR, \fB\-\-verbose\fR -Use verbose output +Use verbose output. .TP -\fB\-\-extern\fR NAME=PATH -Specify where an external rust library is located +\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR +Specify where an external rust library is located. .TP -\fB\-\-sysroot\fR PATH -Override the system root +\fB\-\-sysroot\fR \fIPATH\fR +Override the system root. .TP -\fB\-Z\fR FLAG -Set internal debugging options. Use "-Z help" to print available options. +\fB\-Z\fR \fIFLAG\fR +Set internal debugging options. +Use \fI\-Z help\fR to print available options. .TP \fB\-\-color\fR auto|always|never Configure coloring of output: - auto = colorize, if output goes to a tty (default); - always = always colorize output; - never = never colorize output +.RS +.TP +.B auto +colorize, if output goes to a tty (default); +.TP +.B always +always colorize output; +.TP +.B never +never colorize output. +.RE .SH CODEGEN OPTIONS .TP -\fBar\fR=/path/to/ar +\fBar\fR=\fI/path/to/ar\fR Path to the archive utility to use when assembling archives. .TP -\fBlinker\fR=/path/to/cc +\fBlinker\fR=\fI/path/to/cc\fR Path to the linker utility to use when linking libraries, executables, and objects. .TP -\fBlink-args\fR='-flag1 -flag2' -A space-separated list of extra arguments to pass to the linker when the linker +\fBlink\-args\fR='\fI\-FLAG1 \-FLAG2\fR' +A space\[hy]separated list of extra arguments to pass to the linker when the linker is invoked. .TP \fBlto\fR -Perform LLVM link-time optimizations. +Perform LLVM link\[hy]time optimizations. .TP -\fBtarget-cpu\fR=help -Selects a target processor. If the value is 'help', then a list of available -CPUs is printed. +\fBtarget\-cpu\fR=\fIhelp\fR +Selects a target processor. +If the value is 'help', then a list of available CPUs is printed. .TP -\fBtarget-feature\fR='+feature1,-feature2' -A comma-separated list of features to enable or disable for the target. A -preceding '+' enables a feature while a preceding '-' disables it. Available -features can be discovered through target-cpu=help. +\fBtarget\-feature\fR='\fI+FEATURE1\fR,\fI\-FEATURE2\fR' +A comma\[hy]separated list of features to enable or disable for the target. +A preceding '+' enables a feature while a preceding '\-' disables it. +Available features can be discovered through \fItarget\-cpu=help\fR. .TP -\fBpasses\fR=list -A space-separated list of extra LLVM passes to run. A value of 'list' will -cause rustc to print all known passes and exit. The passes specified are -appended at the end of the normal pass manager. +\fBpasses\fR=\fILIST\fR +A space\[hy]separated list of extra LLVM passes to run. +A value of 'list' will cause \fBrustc\fR to print all known passes and +exit. +The passes specified are appended at the end of the normal pass manager. .TP -\fBllvm-args\fR='-arg1 -arg2' -A space-separated list of arguments to pass through to LLVM. +\fBllvm\-args\fR='\fI\-ARG1\fR \fI\-ARG2\fR' +A space\[hy]separated list of arguments to pass through to LLVM. .TP -\fBsave-temps\fR -If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated +\fBsave\-temps\fR +If specified, the compiler will save more files (.bc, .o, .no\-opt.bc) generated throughout compilation in the output directory. .TP \fBrpath\fR If specified, then the rpath value for dynamic libraries will be set in either dynamic library or executable outputs. .TP -\fBno-prepopulate-passes\fR -Suppresses pre-population of the LLVM pass manager that is run over the module. +\fBno\-prepopulate\-passes\fR +Suppresses pre\[hy]population of the LLVM pass manager that is run over the module. .TP -\fBno-vectorize-loops\fR +\fBno\-vectorize\-loops\fR Suppresses running the loop vectorization LLVM pass, regardless of optimization level. .TP -\fBno-vectorize-slp\fR +\fBno\-vectorize\-slp\fR Suppresses running the LLVM SLP vectorization pass, regardless of optimization level. .TP -\fBsoft-float\fR +\fBsoft\-float\fR Generates software floating point library calls instead of hardware instructions. .TP -\fBprefer-dynamic\fR +\fBprefer\-dynamic\fR Prefers dynamic linking to static linking. .TP -\fBno-integrated-as\fR +\fBno\-integrated\-as\fR Force usage of an external assembler rather than LLVM's integrated one. .TP -\fBno-redzone\fR +\fBno\-redzone\fR Disable the use of the redzone. .TP -\fBrelocation-model\fR=[pic,static,dynamic-no-pic] -The relocation model to use. (Default: pic) +\fBrelocation\-model\fR=[pic,static,dynamic\-no\-pic] +The relocation model to use. +(Default: \fIpic\fR) .TP -\fBcode-model\fR=[small,kernel,medium,large] +\fBcode\-model\fR=[small,kernel,medium,large] Choose the code model to use. .TP -\fBmetadata\fR=val +\fBmetadata\fR=\fIVAL\fR Metadata to mangle symbol names with. .TP -\fBextra-filename\fR=val +\fBextra\-filename\fR=\fIVAL\fR Extra data to put in each output filename. .TP -\fBcodegen-units\fR=val -Divide crate into N units to optimize in parallel. +\fBcodegen\-units\fR=\fIN\fR +Divide crate into \fIN\fR units to optimize in parallel. .TP -\fBremark\fR=val +\fBremark\fR=\fIVAL\fR Print remarks for these optimization passes (space separated, or "all"). .TP -\fBno-stack-check\fR -Disable checks for stack exhaustion (a memory-safety hazard!). +\fBno\-stack\-check\fR +Disable checks for stack exhaustion (a memory\[hy]safety hazard!). .TP -\fBdebuginfo\fR=val +\fBdebuginfo\fR=\fIVAL\fR Debug info emission level: - 0 = no debug info; - 1 = line-tables only (for stacktraces and breakpoints); - 2 = full debug info with variable and type information. +.RS .TP -\fBopt-level\fR=val -Optimize with possible levels 0-3 +.B 0 +no debug info; +.TP +.B 1 +line\[hy]tables only (for stacktraces and breakpoints); +.TP +.B 2 +full debug info with variable and type information. +.RE +.TP +\fBopt\-level\fR=\fIVAL\fR +Optimize with possible levels 0\[en]3 .SH "EXAMPLES" To build an executable from a source file with a main function: - $ rustc -o hello hello.rs + $ rustc \-o hello hello.rs To build a library from a source file: - $ rustc --crate-type=lib hello-lib.rs + $ rustc \-\-crate\-type=lib hello\-lib.rs To build either with a crate (.rs) file: $ rustc hello.rs To build an executable with debug info: - $ rustc -g -o hello hello.rs + $ rustc \-g \-o hello hello.rs .SH "SEE ALSO" -rustdoc +.BR rustdoc (1) .SH "BUGS" -See <\fBhttps://github.com/rust-lang/rust/issues\fR> for issues. +See +.UR https://github.com/rust\-lang/rust/issues +.UE +for issues. .SH "AUTHOR" -See \fBAUTHORS.txt\fR in the Rust source distribution. +See \fIAUTHORS.txt\fR in the Rust source distribution. .SH "COPYRIGHT" -This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR -file in the rust source distribution. +This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms. +See \fICOPYRIGHT\fR file in the rust source distribution. diff --git a/man/rustdoc.1 b/man/rustdoc.1 index 830884b19bd..1738354fb43 100644 --- a/man/rustdoc.1 +++ b/man/rustdoc.1 @@ -8,76 +8,79 @@ rustdoc \- generate documentation from Rust source code .SH DESCRIPTION This tool generates API reference documentation by extracting comments from source code written in the Rust language, available at -<\fBhttps://www.rust-lang.org\fR>. It accepts several input formats and provides -several output formats for the generated documentation. +.UR https://www.rust\-lang.org +.UE . +It accepts several input formats and provides several output formats +for the generated documentation. .SH OPTIONS .TP --r --input-format +\fB\-r\fR, \fB\-\-input\-format\fR \fIFORMAT\fR html or json (default: inferred) .TP --w --output-format +\fB\-w\fR, \fB\-\-output\-format\fR \fIFORMAT\fR html or json (default: html) .TP --o --output -where to place the output (default: doc/ for html, doc.json for json) +\fB\-o\fR, \fB\-\-output\fR \fIOUTPUT\fR +where to place the output (default: \fIdoc/\fR for html, +\fIdoc.json\fR for json) .TP ---passes -space-separated list of passes to run (default: '') +\fB\-\-passes\fR \fILIST\fR +space\[hy]separated list of passes to run (default: '') .TP ---no-defaults +\fB\-\-no\-defaults\fR don't run the default passes .TP ---plugins +\fB\-\-plugins\fR \fILIST\fR space-separated list of plugins to run (default: '') .TP ---plugin-path -directory to load plugins from (default: /tmp/rustdoc_ng/plugins) +\fB\-\-plugin\-path\fR \fIDIR\fR +directory to load plugins from (default: \fI/tmp/rustdoc_ng/plugins\fR) .TP ---target +\fB\-\-target\fR \fITRIPLE\fR target triple to document .TP ---crate-name +\fB\-\-crate\-name\fR \fINAME\fR specify the name of this crate .TP --L --library-path +\fB\-L\fR, \fB\-\-library\-path\fR \fIDIR\fR directory to add to crate search path .TP ---cfg -pass a --cfg to rustc +\fB\-\-cfg\fR \fISPEC\fR +pass a \fI\-\-cfg\fR to rustc .TP ---extern -pass an --extern to rustc +\fB\-\-extern\fR \fIVAL\fR +pass an \fI\-\-extern\fR to rustc .TP ---test +\fB\-\-test\fR run code examples as tests .TP ---test-args +\fB\-\-test\-args\fR \fIARGS\fR pass arguments to the test runner .TP ---html-in-header +\fB\-\-html\-in\-header\fR \fIFILE\fR file to add to .TP ---html-before-content +\fB\-\-html\-before\-content\fR \fIFILE\fR file to add in , before content .TP ---html-after-content +\fB\-\-html\-after\-content\fR \fIFILE\fR file to add in , after content .TP ---markdown-css +\fB\-\-markdown\-css\fR \fIFILE\fR CSS files to include via in a rendered Markdown file .TP ---markdown-playground-url +\fB\-\-markdown\-playground\-url\fR \fIURL\fR URL to send code snippets to .TP ---markdown-no-toc +\fB\-\-markdown\-no\-toc\fR don't include table of contents .TP --h, --help +\fB\-h\fR, \fB\-\-help\fR Print help .TP --V, --version +\fB\-V\fR, \fB\-\-version\fR Print rustdoc's version .SH "OUTPUT FORMATS" @@ -85,14 +88,15 @@ Print rustdoc's version The rustdoc tool can generate output in either an HTML or JSON format. If using an HTML format, then the specified output destination will be the root -directory of an HTML structure for all the documentation. Pages will be placed -into this directory, and source files will also possibly be rendered into it as -well. +directory of an HTML structure for all the documentation. +Pages will be placed into this directory, and source files will also +possibly be rendered into it as well. If using a JSON format, then the specified output destination will have the -rustdoc output serialized as JSON into it. This output format exists to -pre-compile documentation for crates, and for usage in non-rustdoc tools. The -JSON output is the following hash: +rustdoc output serialized as JSON into it. +This output format exists to pre\[hy]compile documentation for crates, +and for usage in non\[hy]rustdoc tools. +The JSON output is the following hash: { "schema": VERSION, @@ -100,11 +104,12 @@ JSON output is the following hash: "plugins": ..., } -The schema version indicates what the structure of crate/plugins will look -like. Within a schema version the structure will remain the same. The `crate` -field will contain all relevant documentation for the source being documented, -and the `plugins` field will contain the output of the plugins run over the -crate. +The schema version indicates what the structure of crate/plugins will +look like. +Within a schema version the structure will remain the same. +The \fIcrate\fR field will contain all relevant documentation for the +source being documented, and the \fIplugins\fR field will contain the +output of the plugins run over the crate. .SH "EXAMPLES" @@ -112,25 +117,28 @@ To generate documentation for the source in the current directory: $ rustdoc hello.rs List all available passes that rustdoc has, along with default passes: - $ rustdoc --passes list + $ rustdoc \-\-passes list To precompile the documentation for a crate, and then use it to render html at a later date: - $ rustdoc -w json hello.rs + $ rustdoc \-w json hello.rs $ rustdoc doc.json The generated HTML can be viewed with any standard web browser. .SH "SEE ALSO" -rustc +.BR rustc (1) .SH "BUGS" -See <\fBhttps://github.com/rust-lang/rust/issues\fR> for issues. +See +.UR https://github.com/rust\-lang/rust/issues +.UE +for issues. .SH "AUTHOR" -See \fBAUTHORS.txt\fR in the Rust source distribution. +See \fIAUTHORS.txt\fR in the Rust source distribution. .SH "COPYRIGHT" -This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR -file in the rust source distribution. +This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms. +See \fICOPYRIGHT\fR file in the rust source distribution. From 9093e239739bfb6944b38141bbf26c358907b149 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Thu, 26 Feb 2015 22:50:16 +0000 Subject: [PATCH 2/9] rustc.1: lowercase codegen replaceable options This is more consistent with `rustc -C help` output. --- man/rustc.1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/man/rustc.1 b/man/rustc.1 index 5b2d6a52fb6..f37e6600190 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -146,7 +146,7 @@ Path to the archive utility to use when assembling archives. Path to the linker utility to use when linking libraries, executables, and objects. .TP -\fBlink\-args\fR='\fI\-FLAG1 \-FLAG2\fR' +\fBlink\-args\fR='\fI\-flag1 \-flag2\fR' A space\[hy]separated list of extra arguments to pass to the linker when the linker is invoked. .TP @@ -157,18 +157,18 @@ Perform LLVM link\[hy]time optimizations. Selects a target processor. If the value is 'help', then a list of available CPUs is printed. .TP -\fBtarget\-feature\fR='\fI+FEATURE1\fR,\fI\-FEATURE2\fR' +\fBtarget\-feature\fR='\fI+feature1\fR,\fI\-feature2\fR' A comma\[hy]separated list of features to enable or disable for the target. A preceding '+' enables a feature while a preceding '\-' disables it. Available features can be discovered through \fItarget\-cpu=help\fR. .TP -\fBpasses\fR=\fILIST\fR +\fBpasses\fR=\fIval\fR A space\[hy]separated list of extra LLVM passes to run. A value of 'list' will cause \fBrustc\fR to print all known passes and exit. The passes specified are appended at the end of the normal pass manager. .TP -\fBllvm\-args\fR='\fI\-ARG1\fR \fI\-ARG2\fR' +\fBllvm\-args\fR='\fI\-arg1\fR \fI\-arg2\fR' A space\[hy]separated list of arguments to pass through to LLVM. .TP \fBsave\-temps\fR @@ -210,22 +210,22 @@ The relocation model to use. \fBcode\-model\fR=[small,kernel,medium,large] Choose the code model to use. .TP -\fBmetadata\fR=\fIVAL\fR +\fBmetadata\fR=\fIval\fR Metadata to mangle symbol names with. .TP -\fBextra\-filename\fR=\fIVAL\fR +\fBextra\-filename\fR=\fIval\fR Extra data to put in each output filename. .TP -\fBcodegen\-units\fR=\fIN\fR -Divide crate into \fIN\fR units to optimize in parallel. +\fBcodegen\-units\fR=\fIn\fR +Divide crate into \fIn\fR units to optimize in parallel. .TP -\fBremark\fR=\fIVAL\fR +\fBremark\fR=\fIval\fR Print remarks for these optimization passes (space separated, or "all"). .TP \fBno\-stack\-check\fR Disable checks for stack exhaustion (a memory\[hy]safety hazard!). .TP -\fBdebuginfo\fR=\fIVAL\fR +\fBdebuginfo\fR=\fIval\fR Debug info emission level: .RS .TP From e8ed2d41505826df2c3c53131de401f69b1df427 Mon Sep 17 00:00:00 2001 From: Dan Burkert Date: Fri, 6 Mar 2015 00:24:47 -0800 Subject: [PATCH 3/9] Implement std::error::Error for std::sync::mpsc error types --- src/libstd/sync/mpsc/mod.rs | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 1a1e9e69e71..2ae1d4a9d50 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -318,6 +318,7 @@ use prelude::v1::*; use sync::Arc; +use error; use fmt; use mem; use cell::UnsafeCell; @@ -975,6 +976,18 @@ impl fmt::Display for SendError { } } +#[stable(feature = "rust1", since = "1.0.0")] +impl error::Error for SendError { + + fn description(&self) -> &str { + "sending on a closed channel" + } + + fn cause(&self) -> Option<&error::Error> { + None + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for TrySendError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -999,6 +1012,25 @@ impl fmt::Display for TrySendError { } } +#[stable(feature = "rust1", since = "1.0.0")] +impl error::Error for TrySendError { + + fn description(&self) -> &str { + match *self { + TrySendError::Full(..) => { + "sending on a full channel" + } + TrySendError::Disconnected(..) => { + "sending on a closed channel" + } + } + } + + fn cause(&self) -> Option<&error::Error> { + None + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Display for RecvError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -1006,6 +1038,18 @@ impl fmt::Display for RecvError { } } +#[stable(feature = "rust1", since = "1.0.0")] +impl error::Error for RecvError { + + fn description(&self) -> &str { + "receiving on a closed channel" + } + + fn cause(&self) -> Option<&error::Error> { + None + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Display for TryRecvError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -1020,6 +1064,25 @@ impl fmt::Display for TryRecvError { } } +#[stable(feature = "rust1", since = "1.0.0")] +impl error::Error for TryRecvError { + + fn description(&self) -> &str { + match *self { + TryRecvError::Empty => { + "receiving on an empty channel" + } + TryRecvError::Disconnected => { + "receiving on a closed channel" + } + } + } + + fn cause(&self) -> Option<&error::Error> { + None + } +} + #[cfg(test)] mod test { use prelude::v1::*; From 3dbf969103adf5e84b1b76d67193608ad2eb3200 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Sun, 8 Mar 2015 20:46:04 +0100 Subject: [PATCH 4/9] For FRU, evaluate field expressions (into scratch temps) before base expression. Fix #23112. --- src/librustc_trans/trans/expr.rs | 70 +++++++++++++-------- src/test/run-pass/struct-order-of-eval-1.rs | 3 +- src/test/run-pass/struct-order-of-eval-2.rs | 3 +- src/test/run-pass/struct-order-of-eval-3.rs | 46 ++++++++++++++ src/test/run-pass/struct-order-of-eval-4.rs | 43 +++++++++++++ 5 files changed, 138 insertions(+), 27 deletions(-) create mode 100644 src/test/run-pass/struct-order-of-eval-3.rs create mode 100644 src/test/run-pass/struct-order-of-eval-4.rs diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index 60455119d58..e1c264feb00 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -1494,31 +1494,14 @@ pub fn trans_adt<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, // panic occur before the ADT as a whole is ready. let custom_cleanup_scope = fcx.push_custom_cleanup_scope(); - // First we trans the base, if we have one, to the dest - if let Some(base) = optbase { - assert_eq!(discr, 0); - - match ty::expr_kind(bcx.tcx(), &*base.expr) { - ty::RvalueDpsExpr | ty::RvalueDatumExpr if !bcx.fcx.type_needs_drop(ty) => { - bcx = trans_into(bcx, &*base.expr, SaveIn(addr)); - }, - ty::RvalueStmtExpr => bcx.tcx().sess.bug("unexpected expr kind for struct base expr"), - _ => { - let base_datum = unpack_datum!(bcx, trans_to_lvalue(bcx, &*base.expr, "base")); - for &(i, t) in &base.fields { - let datum = base_datum.get_element( - bcx, t, |srcval| adt::trans_field_ptr(bcx, &*repr, srcval, discr, i)); - assert!(type_is_sized(bcx.tcx(), datum.ty)); - let dest = adt::trans_field_ptr(bcx, &*repr, addr, discr, i); - bcx = datum.store_to(bcx, dest); - } - } - } - } - - debug_location.apply(bcx.fcx); - if ty::type_is_simd(bcx.tcx(), ty) { + // Issue 23112: The original logic appeared vulnerable to same + // order-of-eval bug. But, SIMD values are tuple-structs; + // i.e. functional record update (FRU) syntax is unavailable. + // + // To be safe, double-check that we did not get here via FRU. + assert!(optbase.is_none()); + // This is the constructor of a SIMD type, such types are // always primitive machine types and so do not have a // destructor or require any clean-up. @@ -1537,8 +1520,45 @@ pub fn trans_adt<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, vec_val = InsertElement(bcx, vec_val, value, position); } Store(bcx, vec_val, addr); + } else if let Some(base) = optbase { + // Issue 23112: If there is a base, then order-of-eval + // requires field expressions eval'ed before base expression. + + // First, trans field expressions to temporary scratch values. + let scratch_vals: Vec<_> = fields.iter().map(|&(i, ref e)| { + let datum = unpack_datum!(bcx, trans(bcx, &**e)); + (i, datum) + }).collect(); + + debug_location.apply(bcx.fcx); + + // Second, trans the base to the dest. + assert_eq!(discr, 0); + + match ty::expr_kind(bcx.tcx(), &*base.expr) { + ty::RvalueDpsExpr | ty::RvalueDatumExpr if !bcx.fcx.type_needs_drop(ty) => { + bcx = trans_into(bcx, &*base.expr, SaveIn(addr)); + }, + ty::RvalueStmtExpr => bcx.tcx().sess.bug("unexpected expr kind for struct base expr"), + _ => { + let base_datum = unpack_datum!(bcx, trans_to_lvalue(bcx, &*base.expr, "base")); + for &(i, t) in &base.fields { + let datum = base_datum.get_element( + bcx, t, |srcval| adt::trans_field_ptr(bcx, &*repr, srcval, discr, i)); + assert!(type_is_sized(bcx.tcx(), datum.ty)); + let dest = adt::trans_field_ptr(bcx, &*repr, addr, discr, i); + bcx = datum.store_to(bcx, dest); + } + } + } + + // Finally, move scratch field values into actual field locations + for (i, datum) in scratch_vals.into_iter() { + let dest = adt::trans_field_ptr(bcx, &*repr, addr, discr, i); + bcx = datum.store_to(bcx, dest); + } } else { - // Now, we just overwrite the fields we've explicitly specified + // No base means we can write all fields directly in place. for &(i, ref e) in fields { let dest = adt::trans_field_ptr(bcx, &*repr, addr, discr, i); let e_ty = expr_ty_adjusted(bcx, &**e); diff --git a/src/test/run-pass/struct-order-of-eval-1.rs b/src/test/run-pass/struct-order-of-eval-1.rs index 6cebd17496a..a64477242c0 100644 --- a/src/test/run-pass/struct-order-of-eval-1.rs +++ b/src/test/run-pass/struct-order-of-eval-1.rs @@ -12,11 +12,12 @@ struct S { f0: String, f1: int } pub fn main() { let s = "Hello, world!".to_string(); - let _s = S { + let s = S { f0: s.to_string(), ..S { f0: s, f1: 23 } }; + assert_eq!(s.f0, "Hello, world!"); } diff --git a/src/test/run-pass/struct-order-of-eval-2.rs b/src/test/run-pass/struct-order-of-eval-2.rs index 786f080bb9e..359ecdab630 100644 --- a/src/test/run-pass/struct-order-of-eval-2.rs +++ b/src/test/run-pass/struct-order-of-eval-2.rs @@ -15,8 +15,9 @@ struct S { pub fn main() { let s = "Hello, world!".to_string(); - let _s = S { + let s = S { f1: s.to_string(), f0: s }; + assert_eq!(s.f0, "Hello, world!"); } diff --git a/src/test/run-pass/struct-order-of-eval-3.rs b/src/test/run-pass/struct-order-of-eval-3.rs new file mode 100644 index 00000000000..856ed7c105e --- /dev/null +++ b/src/test/run-pass/struct-order-of-eval-3.rs @@ -0,0 +1,46 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks that functional-record-update order-of-eval is as expected +// even when no Drop-implementations are involved. + +use std::sync::atomic::{Ordering, AtomicUsize, ATOMIC_USIZE_INIT}; + +struct W { wrapped: u32 } +struct S { f0: W, _f1: i32 } + +pub fn main() { + const VAL: u32 = 0x89AB_CDEF; + let w = W { wrapped: VAL }; + let s = S { + f0: { event(0x01); W { wrapped: w.wrapped + 1 } }, + ..S { + f0: { event(0x02); w}, + _f1: 23 + } + }; + assert_eq!(s.f0.wrapped, VAL + 1); + let actual = event_log(); + let expect = 0x01_02; + assert!(expect == actual, + "expect: 0x{:x} actual: 0x{:x}", expect, actual); +} + +static LOG: AtomicUsize = ATOMIC_USIZE_INIT; + +fn event_log() -> usize { + LOG.load(Ordering::SeqCst) +} + +fn event(tag: u8) { + let old_log = LOG.load(Ordering::SeqCst); + let new_log = (old_log << 8) + tag as usize; + LOG.store(new_log, Ordering::SeqCst); +} diff --git a/src/test/run-pass/struct-order-of-eval-4.rs b/src/test/run-pass/struct-order-of-eval-4.rs new file mode 100644 index 00000000000..25923beffdd --- /dev/null +++ b/src/test/run-pass/struct-order-of-eval-4.rs @@ -0,0 +1,43 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks that struct-literal expression order-of-eval is as expected +// even when no Drop-implementations are involved. + +use std::sync::atomic::{Ordering, AtomicUsize, ATOMIC_USIZE_INIT}; + +struct W { wrapped: u32 } +struct S { f0: W, _f1: i32 } + +pub fn main() { + const VAL: u32 = 0x89AB_CDEF; + let w = W { wrapped: VAL }; + let s = S { + _f1: { event(0x01); 23 }, + f0: { event(0x02); w }, + }; + assert_eq!(s.f0.wrapped, VAL); + let actual = event_log(); + let expect = 0x01_02; + assert!(expect == actual, + "expect: 0x{:x} actual: 0x{:x}", expect, actual); +} + +static LOG: AtomicUsize = ATOMIC_USIZE_INIT; + +fn event_log() -> usize { + LOG.load(Ordering::SeqCst) +} + +fn event(tag: u8) { + let old_log = LOG.load(Ordering::SeqCst); + let new_log = (old_log << 8) + tag as usize; + LOG.store(new_log, Ordering::SeqCst); +} From 5c3a0b191eade884808e76045ec69a0b086bc53e Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 9 Mar 2015 19:18:43 +0100 Subject: [PATCH 5/9] Add tests checking that a number of feature gates are gating their features. Namely: * `quote` * `link_args` * `link_llvm_intrinsics` * `thread_local` * `unsafe_destructor` Also updates test for `plugin_registrar` to make it clear that it is only testing the `plugin_registrar` feature gate. Cc #22820. --- src/test/compile-fail-fulldeps/gated-quote.rs | 50 +++++++++++++++++++ src/test/compile-fail/gated-link-args.rs | 19 +++++++ .../gated-link-llvm-intrinsics.rs | 19 +++++++ .../compile-fail/gated-plugin_registrar.rs | 8 ++- src/test/compile-fail/gated-thread-local.rs | 25 ++++++++++ .../compile-fail/gated-unsafe-destructor.rs | 23 +++++++++ 6 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 src/test/compile-fail-fulldeps/gated-quote.rs create mode 100644 src/test/compile-fail/gated-link-args.rs create mode 100644 src/test/compile-fail/gated-link-llvm-intrinsics.rs create mode 100644 src/test/compile-fail/gated-thread-local.rs create mode 100644 src/test/compile-fail/gated-unsafe-destructor.rs diff --git a/src/test/compile-fail-fulldeps/gated-quote.rs b/src/test/compile-fail-fulldeps/gated-quote.rs new file mode 100644 index 00000000000..6a5cd88a591 --- /dev/null +++ b/src/test/compile-fail-fulldeps/gated-quote.rs @@ -0,0 +1,50 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `quote`-related macro are gated by `quote` feature gate. + +// (To sanity-check the code, uncomment this.) +// #![feature(quote)] + +// FIXME the error message that is current emitted seems pretty bad. + +#![feature(rustc_private)] +#![allow(dead_code, unused_imports, unused_variables)] + +#[macro_use] +extern crate syntax; + +use syntax::ast; +use syntax::codemap::Span; +use syntax::parse; + +struct ParseSess; + +impl ParseSess { + fn cfg(&self) -> ast::CrateConfig { loop { } } + fn parse_sess<'a>(&'a self) -> &'a parse::ParseSess { loop { } } + fn call_site(&self) -> Span { loop { } } + fn ident_of(&self, st: &str) -> ast::Ident { loop { } } + fn name_of(&self, st: &str) -> ast::Name { loop { } } +} + +pub fn main() { + let ecx = &ParseSess; + let x = quote_tokens!(ecx, 3); //~ ERROR macro undefined: 'quote_tokens!' + let x = quote_expr!(ecx, 3); //~ ERROR macro undefined: 'quote_expr!' + let x = quote_ty!(ecx, 3); //~ ERROR macro undefined: 'quote_ty!' + let x = quote_method!(ecx, 3); //~ ERROR macro undefined: 'quote_method!' + let x = quote_item!(ecx, 3); //~ ERROR macro undefined: 'quote_item!' + let x = quote_pat!(ecx, 3); //~ ERROR macro undefined: 'quote_pat!' + let x = quote_arm!(ecx, 3); //~ ERROR macro undefined: 'quote_arm!' + let x = quote_stmt!(ecx, 3); //~ ERROR macro undefined: 'quote_stmt!' + let x = quote_matcher!(ecx, 3); //~ ERROR macro undefined: 'quote_matcher!' + let x = quote_attr!(ecx, 3); //~ ERROR macro undefined: 'quote_attr!' +} diff --git a/src/test/compile-fail/gated-link-args.rs b/src/test/compile-fail/gated-link-args.rs new file mode 100644 index 00000000000..c8845ced2fc --- /dev/null +++ b/src/test/compile-fail/gated-link-args.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `#[link_args]` attribute is gated by `link_args` +// feature gate. + +#[link_args = "aFdEfSeVEEE"] +extern {} +//~^ ERROR the `link_args` attribute is not portable across platforms +//~| HELP add #![feature(link_args)] to the crate attributes to enable + +fn main() { } diff --git a/src/test/compile-fail/gated-link-llvm-intrinsics.rs b/src/test/compile-fail/gated-link-llvm-intrinsics.rs new file mode 100644 index 00000000000..716ea9f8dba --- /dev/null +++ b/src/test/compile-fail/gated-link-llvm-intrinsics.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern { + #[link_name = "llvm.sqrt.f32"] + fn sqrt(x: f32) -> f32; + //~^ ERROR linking to LLVM intrinsics is experimental + //~| HELP add #![feature(link_llvm_intrinsics)] to the crate attributes +} + +fn main(){ +} diff --git a/src/test/compile-fail/gated-plugin_registrar.rs b/src/test/compile-fail/gated-plugin_registrar.rs index f6e11ffd9e5..d716c53e1d1 100644 --- a/src/test/compile-fail/gated-plugin_registrar.rs +++ b/src/test/compile-fail/gated-plugin_registrar.rs @@ -8,8 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Test that `#[plugin_registrar]` attribute is gated by `plugin_registrar` +// feature gate. + // the registration function isn't typechecked yet #[plugin_registrar] -pub fn registrar() {} //~ ERROR compiler plugins are experimental - +pub fn registrar() {} +//~^ ERROR compiler plugins are experimental +//~| HELP add #![feature(plugin_registrar)] to the crate attributes to enable fn main() {} diff --git a/src/test/compile-fail/gated-thread-local.rs b/src/test/compile-fail/gated-thread-local.rs new file mode 100644 index 00000000000..f355c6562c8 --- /dev/null +++ b/src/test/compile-fail/gated-thread-local.rs @@ -0,0 +1,25 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `#[thread_local]` attribute is gated by `thread_local` +// feature gate. +// +// (Note that the `thread_local!` macro is explicitly *not* gated; it +// is given permission to expand into this unstable attribute even +// when the surrounding context does not have permission to use it.) + +#[thread_local] //~ ERROR `#[thread_local]` is an experimental feature +static FOO: i32 = 3; + +pub fn main() { + FOO.with(|x| { + println!("x: {}", x); + }); +} diff --git a/src/test/compile-fail/gated-unsafe-destructor.rs b/src/test/compile-fail/gated-unsafe-destructor.rs new file mode 100644 index 00000000000..6024fef9fb8 --- /dev/null +++ b/src/test/compile-fail/gated-unsafe-destructor.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor` +// feature gate. + +struct D<'a>(&'a u32); + +#[unsafe_destructor] +impl<'a> Drop for D<'a> { + //~^ ERROR `#[unsafe_destructor]` allows too many unsafe patterns + fn drop(&mut self) { } +} +//~^ HELP: add #![feature(unsafe_destructor)] to the crate attributes to enable + +pub fn main() { } From c2fe7c4a036eccbdfb00e8609868f9a88d4596af Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Mon, 9 Mar 2015 20:28:36 +0100 Subject: [PATCH 6/9] Rustdoc: Add Headline Style for `tymethod` Fixes #23230 --- src/librustdoc/html/static/main.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index 21b7de9ff7c..1f075566ad5 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -83,7 +83,7 @@ h2 { h3 { font-size: 1.3em; } -h1, h2, h3:not(.impl):not(.method):not(.type), h4:not(.method):not(.type) { +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { color: black; font-weight: 500; margin: 20px 0 15px 0; @@ -93,7 +93,7 @@ h1.fqn { border-bottom: 1px dashed #D5D5D5; margin-top: 0; } -h2, h3:not(.impl):not(.method):not(.type), h4:not(.method):not(.type) { +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { border-bottom: 1px solid #DDDDDD; } h3.impl, h3.method, h4.method, h3.type, h4.type { From bc927a69b2967ccff3ba0a0cc7a8f6829dbf7cfd Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 8 Mar 2015 13:58:14 -0400 Subject: [PATCH 7/9] Explain super in the crates guide. Fixes #19808 --- src/doc/trpl/crates-and-modules.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doc/trpl/crates-and-modules.md b/src/doc/trpl/crates-and-modules.md index f3c0195855c..8eaad5067f0 100644 --- a/src/doc/trpl/crates-and-modules.md +++ b/src/doc/trpl/crates-and-modules.md @@ -555,6 +555,13 @@ Here we have a `pub use` for each function we want to bring into the `japanese` scope. We could alternatively use the wildcard syntax to include everything from `greetings` into the current scope: `pub use self::greetings::*`. +What about the `self`? Well, by default, `use` declarations are absolute paths, +starting from your crate root. `self` makes that path relative to your current +place in the hierarchy instead. There's one more special form of `use`: you can +`use super::` to reach one level up the tree from your current location. Some +people like to think of `self` as `.` and `super` as `..`, from many shells' +display for the current directory and the parent directory. + Also, note that we `pub use`d before we declared our `mod`s. Rust requires that `use` declarations go first. From 7a86bfc5df7f6813375baf574ff3d08e0f690bde Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 8 Mar 2015 10:08:07 -0400 Subject: [PATCH 8/9] Shrink table in the reference Fixes #20051 --- src/doc/reference.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index a772d98583e..6eab5d255b6 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -229,14 +229,14 @@ cases mentioned in [Number literals](#number-literals) below. ##### Characters and strings -| | Example | Number of `#` pairs allowed | Available characters | Escapes | Equivalent to | -|---|---------|-----------------------------|----------------------|---------|---------------| -| [Character](#character-literals) | `'H'` | `N/A` | All unicode | `\'` & [Byte escapes](#byte-escapes) & [Unicode escapes](#unicode-escapes) | `N/A` | -| [String](#string-literals) | `"hello"` | `N/A` | All unicode | `\"` & [Byte escapes](#byte-escapes) & [Unicode escapes](#unicode-escapes) | `N/A` | -| [Raw](#raw-string-literals) | `r##"hello"##` | `0...` | All unicode | `N/A` | `N/A` | -| [Byte](#byte-literals) | `b'H'` | `N/A` | All ASCII | `\'` & [Byte escapes](#byte-escapes) | `u8` | -| [Byte string](#byte-string-literals) | `b"hello"` | `N/A` | All ASCII | `\"` & [Byte escapes](#byte-escapes) | `&'static [u8]` | -| [Raw byte string](#raw-byte-string-literals) | `br##"hello"##` | `0...` | All ASCII | `N/A` | `&'static [u8]` (unsure...not stated) | +| | Example | # sets | Characters | Escapes | +|----------------------------------------------|---------------|--------|-------------|---------------------| +| [Character](#character-literals) | 'H' | N/A | All Unicode | \' & [Byte](#byte-escapes) & [Unicode](#unicode-escapes) | +| [String](#string-literals) | "hello" | N/A | All Unicode | \" & [Byte](#byte-escapes) & [Unicode](#unicode-escapes) | +| [Raw](#raw-string-literals) | r#"hello"# | 0... | All Unicode | N/A | +| [Byte](#byte-literals) | b'H' | N/A | All ASCII | \' & [Byte](#byte-escapes) | +| [Byte string](#byte-string-literals) | b"hello" | N/A | All ASCII | \" & [Byte](#byte-escapes) | +| [Raw byte string](#raw-byte-string-literals) | br#"hello"# | 0... | All ASCII | N/A | ##### Byte escapes From d0ae7caa49501250eba4fb6648c239748714f5c7 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Mon, 9 Mar 2015 16:25:50 -0700 Subject: [PATCH 9/9] fixing configure so that it works on bitrig/openbsd --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index d56000b14e2..b0d0c3f29b8 100755 --- a/configure +++ b/configure @@ -701,8 +701,8 @@ probe CFG_ADB adb if [ ! -z "$CFG_PANDOC" ] then + # Extract "MAJOR MINOR" from Pandoc's version number PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' | - # Extract "MAJOR MINOR" from Pandoc's version number sed -E 's/pandoc(.exe)? ([0-9]+)\.([0-9]+).*/\2 \3/') MIN_PV_MAJOR="1"