Rollup merge of #22224 - sanxiyn:must-use, r=cmr

Fix #20109.
This commit is contained in:
Manish Goregaokar 2015-02-15 18:22:31 +05:30
commit 132b56cefc
3 changed files with 47 additions and 1 deletions

View file

@ -0,0 +1,5 @@
-include ../tools.mk
all: lib.rs
$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc lib.rs
$(HTMLDOCCK) $(TMPDIR)/doc lib.rs

View file

@ -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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type="lib"]
// @has lib/struct.Struct.html //pre '#[must_use]'
#[must_use]
pub struct Struct {
field: i32,
}
// @has lib/enum.Enum.html //pre '#[must_use = "message"]'
#[must_use = "message"]
pub enum Enum {
Variant(i32),
}