]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 3 Jun 2014 00:16:31 +0000 (17:16 -0700)
committerbors <bors@rust-lang.org>
Tue, 3 Jun 2014 00:16:31 +0000 (17:16 -0700)
Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly. `norust` as a negative statement is a bad
tag.

This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.

Also fix markdown.rs to not highlight non-rust code.

Amends the documentation to reflect the new
behaviour.

1  2 
src/doc/rust.md
src/libsyntax/ext/deriving/generic/mod.rs

diff --combined src/doc/rust.md
index 61fd83c10d4a9a71164b8100a563a1b9afe4f0f1,8935e84c78bb68305aec35675e0417df488ca3a9..b690c2eb983474635ccc9565b417576f06e09fd5
@@@ -59,7 -59,7 +59,7 @@@ dialect of EBNF supported by common aut
  `llgen`, rather than the dialect given in ISO 14977. The dialect can be
  defined self-referentially as follows:
  
- ~~~~ {.notrust .ebnf .notation}
+ ~~~~ {.ebnf .notation}
  grammar : rule + ;
  rule    : nonterminal ':' productionrule ';' ;
  productionrule : production [ '|' production ] * ;
@@@ -153,7 -153,7 +153,7 @@@ Some productions are defined by exclusi
  
  ## Comments
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  comment : block_comment | line_comment ;
  block_comment : "/*" block_comment_body * '*' + '/' ;
  block_comment_body : [block_comment | character] * ;
@@@ -174,7 -174,7 +174,7 @@@ Non-doc comments are interpreted as a f
  
  ## Whitespace
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  whitespace_char : '\x20' | '\x09' | '\x0a' | '\x0d' ;
  whitespace : [ whitespace_char | comment ] + ;
  ~~~~
@@@ -191,7 -191,7 +191,7 @@@ with any other legal whitespace element
  
  ## Tokens
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  simple_token : keyword | unop | binop ;
  token : simple_token | ident | literal | symbol | whitespace token ;
  ~~~~
@@@ -205,7 -205,7 +205,7 @@@ grammar as double-quoted strings. Othe
  
  The keywords are the following strings:
  
- ~~~~ {.notrust .keyword}
+ ~~~~ {.text .keyword}
  as
  box break
  continue crate
@@@ -233,13 -233,13 +233,13 @@@ evaluates to, rather than referring to 
  rule. A literal is a form of constant expression, so is evaluated (primarily)
  at compile time.
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  literal : string_lit | char_lit | num_lit ;
  ~~~~
  
  #### Character and string literals
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  char_lit : '\x27' char_body '\x27' ;
  string_lit : '"' string_body * '"' | 'r' raw_string ;
  
@@@ -321,7 -321,7 +321,7 @@@ r##"foo #"# bar"##;                // f
  
  #### Number literals
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
          | '0' [       [ dec_digit | '_' ] * num_suffix ?
                | 'b'   [ '1' | '0' | '_' ] + int_suffix ?
@@@ -419,7 -419,7 +419,7 @@@ The two values of the boolean type are 
  
  ### Symbols
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  symbol : "::" "->"
         | '#' | '[' | ']' | '(' | ')' | '{' | '}'
         | ',' | ';' ;
@@@ -434,7 -434,7 +434,7 @@@ operators](#binary-operator-expressions
  
  ## Paths
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  expr_path : [ "::" ] ident [ "::" expr_path_tail ] + ;
  expr_path_tail : '<' type_expr [ ',' type_expr ] + '>'
                 | expr_path ;
@@@ -543,7 -543,7 +543,7 @@@ All of the above extensions are express
  
  ## Macros
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ;
  macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ;
  matcher : '(' matcher * ')' | '[' matcher * ']'
@@@ -687,7 -687,7 +687,7 @@@ each of which may have some number of [
  
  ## Items
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  item : mod_item | fn_item | type_item | struct_item | enum_item
       | static_item | trait_item | impl_item | extern_block ;
  ~~~~
@@@ -735,7 -735,7 +735,7 @@@ That is, Rust has no notion of type abs
  
  ### Modules
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  mod_item : "mod" ident ( ';' | '{' mod '}' );
  mod : [ view_item | item ] * ;
  ~~~~
@@@ -803,7 -803,7 +803,7 @@@ mod task 
  
  #### View items
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  view_item : extern_crate_decl | use_decl ;
  ~~~~
  
@@@ -816,7 -816,7 +816,7 @@@ There are several kinds of view item
  
  ##### Extern crate declarations
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  extern_crate_decl : "extern" "crate" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
  link_attrs : link_attr [ ',' link_attrs ] + ;
  link_attr : ident '=' literal ;
@@@ -848,7 -848,7 +848,7 @@@ extern crate foo = "some/where/rust-foo
  
  ##### Use declarations
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  use_decl : "pub" ? "use" [ ident '=' path
                            | path_glob ] ;
  
@@@ -904,7 -904,7 +904,7 @@@ An example of re-exporting
  ~~~~
  # fn main() { }
  mod quux {
 -    pub use quux::foo::*;
 +    pub use quux::foo::{bar, baz};
  
      pub mod foo {
          pub fn bar() { }
  }
  ~~~~
  
 -In this example, the module `quux` re-exports all of the public names defined in `foo`.
 +In this example, the module `quux` re-exports two public names defined in `foo`.
  
  Also note that the paths contained in `use` items are relative to the crate root.
 -So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
 +So, in the previous example, the `use` refers to `quux::foo::{bar, baz}`, and not simply to `foo::{bar, baz}`.
  This also means that top-level module declarations should be at the crate root if direct usage
  of the declared modules within `use` items is desired.  It is also possible to use `self` and `super`
  at the beginning of a `use` item to refer to the current and direct parent modules respectively.
@@@ -1274,7 -1274,7 +1274,7 @@@ whereas `Dog` is simply called an enum 
  
  ### Static items
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  static_item : "static" ident ':' type '=' expr ';' ;
  ~~~~
  
@@@ -1519,7 -1519,7 +1519,7 @@@ impl Seq<bool> for u32 
  
  ### External blocks
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  extern_block_item : "extern" '{' extern_block '}' ;
  extern_block : [ foreign_fn ] * ;
  ~~~~
@@@ -1741,7 -1741,7 +1741,7 @@@ import public items from their destinat
  
  ## Attributes
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  attribute : '#' '!' ? '[' meta_item ']' ;
  meta_item : ident [ '=' literal
                    | '(' meta_seq ')' ] ? ;
@@@ -2383,7 -2383,7 +2383,7 @@@ declaring a function-local item
  
  #### Slot declarations
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  let_decl : "let" pat [':' type ] ? [ init ] ? ';' ;
  init : [ '=' ] expr ;
  ~~~~
@@@ -2483,7 -2483,7 +2483,7 @@@ values
  
  ### Structure expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  struct_expr : expr_path '{' ident ':' expr
                        [ ',' ident ':' expr ] *
                        [ ".." expr ] '}' |
@@@ -2537,7 -2537,7 +2537,7 @@@ Point3d {y: 0, z: 10, .. base}
  
  ### Block expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  block_expr : '{' [ view_item ] *
                   [ stmt ';' | item ] *
                   [ expr ] '}' ;
@@@ -2555,7 -2555,7 +2555,7 @@@ of the block are that of the expressio
  
  ### Method-call expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  method_call_expr : expr '.' ident paren_expr_list ;
  ~~~~
  
@@@ -2566,7 -2566,7 +2566,7 @@@ or dynamically dispatching if the left-
  
  ### Field expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  field_expr : expr '.' ident ;
  ~~~~
  
@@@ -2588,7 -2588,7 +2588,7 @@@ it is automatically dereferenced to mak
  
  ### Vector expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  vec_expr : '[' "mut" ? vec_elems? ']' ;
  
  vec_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
@@@ -2610,7 -2610,7 +2610,7 @@@ as a [literal](#literals) or a [static 
  
  ### Index expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  idx_expr : expr '[' expr ']' ;
  ~~~~
  
@@@ -2662,7 -2662,7 +2662,7 @@@ before the expression they apply to
  
  ### Binary operator expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  binop_expr : expr binop expr ;
  ~~~~
  
@@@ -2803,7 -2803,7 +2803,7 @@@ Any such expression always has the [`un
  The precedence of Rust binary operators is ordered as follows, going
  from strong to weak:
  
- ~~~~ {.notrust .precedence}
+ ~~~~ {.text .precedence}
  * / %
  as
  + -
@@@ -2827,7 -2827,7 +2827,7 @@@ An expression enclosed in parentheses e
  expression.  Parentheses can be used to explicitly specify evaluation order
  within an expression.
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  paren_expr : '(' expr ')' ;
  ~~~~
  
@@@ -2840,7 -2840,7 +2840,7 @@@ let x = (2 + 3) * 4
  
  ### Call expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  expr_list : [ expr [ ',' expr ]* ] ? ;
  paren_expr_list : '(' expr_list ')' ;
  call_expr : expr paren_expr_list ;
@@@ -2863,7 -2863,7 +2863,7 @@@ let pi: Option<f32> = FromStr::from_str
  
  ### Lambda expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  ident_list : [ ident [ ',' ident ]* ] ? ;
  lambda_expr : '|' ident_list '|' expr ;
  ~~~~
@@@ -2906,7 -2906,7 +2906,7 @@@ ten_times(|j| println!("hello, {}", j))
  
  ### While loops
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  while_expr : "while" expr '{' block '}' ;
  ~~~~
  
@@@ -2930,7 -2930,7 +2930,7 @@@ while i < 10 
  
  A `loop` expression denotes an infinite loop.
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  loop_expr : [ lifetime ':' ] "loop" '{' block '}';
  ~~~~
  
@@@ -2941,7 -2941,7 +2941,7 @@@ See [Break expressions](#break-expressi
  
  ### Break expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  break_expr : "break" [ lifetime ];
  ~~~~
  
@@@ -2954,7 -2954,7 +2954,7 @@@ but must enclose it
  
  ### Continue expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  continue_expr : "continue" [ lifetime ];
  ~~~~
  
@@@ -2973,7 -2973,7 +2973,7 @@@ A `continue` expression is only permitt
  
  ### For expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  for_expr : "for" pat "in" expr '{' block '}' ;
  ~~~~
  
@@@ -3007,7 -3007,7 +3007,7 @@@ for i in range(0u, 256) 
  
  ### If expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  if_expr : "if" expr '{' block '}'
            else_tail ? ;
  
@@@ -3028,7 -3028,7 +3028,7 @@@ then any `else` block is executed
  
  ### Match expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  match_expr : "match" expr '{' match_arm * '}' ;
  
  match_arm : attribute * match_pat "=>" [ expr "," | '{' block '}' ] ;
@@@ -3219,7 -3219,7 +3219,7 @@@ let message = match maybe_digit 
  
  ### Return expressions
  
- ~~~~ {.notrust .ebnf .gram}
+ ~~~~ {.ebnf .gram}
  return_expr : "return" expr ? ;
  ~~~~
  
@@@ -3496,7 -3496,7 +3496,7 @@@ x = bo(5,7)
  
  ### Closure types
  
- ~~~~ {.notrust .ebnf .notation}
+ ~~~~ {.ebnf .notation}
  closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
                  [ ':' bound-list ] [ '->' type ]
  procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
@@@ -4107,7 -4107,7 +4107,7 @@@ fn main() 
  
  These four log levels correspond to levels 1-4, as controlled by `RUST_LOG`:
  
- ```notrust,bash
+ ```sh
  $ RUST_LOG=rust=3 ./rust
  This is an error log
  This is a warn log
index eb224d255e535562ff2b6ffc49eceb2d7f849c68,101a9c7e3a3c45773964a73146184f0d1aa1cf0c..228f5f02beea4779390a269161923b2dd3dce518
@@@ -102,7 -102,7 +102,7 @@@ above `PartialEq`, `A`, `B` and `C`
  
  When generating the `expr` for the `A` impl, the `SubstructureFields` is
  
- ~~~notrust
+ ~~~text
  Struct(~[FieldInfo {
             span: <span of x>
             name: Some(<ident of x>),
  
  For the `B` impl, called with `B(a)` and `B(b)`,
  
- ~~~notrust
+ ~~~text
  Struct(~[FieldInfo {
            span: <span of `int`>,
            name: None,
  When generating the `expr` for a call with `self == C0(a)` and `other
  == C0(b)`, the SubstructureFields is
  
- ~~~notrust
+ ~~~text
  EnumMatching(0, <ast::Variant for C0>,
               ~[FieldInfo {
                  span: <span of int>
  
  For `C1 {x}` and `C1 {x}`,
  
- ~~~notrust
+ ~~~text
  EnumMatching(1, <ast::Variant for C1>,
               ~[FieldInfo {
                  span: <span of x>
  
  For `C0(a)` and `C1 {x}` ,
  
- ~~~notrust
+ ~~~text
  EnumNonMatching(~[(0, <ast::Variant for B0>,
                     ~[(<span of int>, None, <expr for &a>)]),
                    (1, <ast::Variant for B1>,
  
  A static method on the above would result in,
  
- ~~~~notrust
+ ~~~text
  StaticStruct(<ast::StructDef of A>, Named(~[(<ident of x>, <span of x>)]))
  
  StaticStruct(<ast::StructDef of B>, Unnamed(~[<span of x>]))
@@@ -191,9 -191,8 +191,9 @@@ use codemap::Span
  use owned_slice::OwnedSlice;
  use parse::token::InternedString;
  
 -pub use self::ty::*;
 -mod ty;
 +use self::ty::*;
 +
 +pub mod ty;
  
  pub struct TraitDef<'a> {
      /// The span for the current #[deriving(Foo)] header.
@@@ -793,7 -792,7 +793,7 @@@ impl<'a> MethodDef<'a> 
      /**
      Creates the nested matches for an enum definition recursively, i.e.
  
-    ~~~notrust
+    ~~~text
      match self {
         Variant1 => match other { Variant1 => matching, Variant2 => nonmatching, ... },
         Variant2 => match other { Variant1 => nonmatching, Variant2 => matching, ... },