Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #44482

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
adfebed
Explicitly run perl for OpenSSL Configure
smaeul Aug 28, 2017
55f9087
rustdoc: Don't counts ids twice when using --enable-commonmark
ollie27 Sep 6, 2017
b4d0f61
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`
tbu- Sep 7, 2017
e36d8cd
update mdbook
steveklabnik Sep 8, 2017
cd1bf6d
Added short examples for 'str::from_utf8_mut'
smt923 Sep 10, 2017
51bbd69
Fix incorrect markdown title
smt923 Sep 10, 2017
f20b030
Fix trailing whitespace
smt923 Sep 10, 2017
bc1a4c6
Add doc example to String::as_mut_str
tommyip Sep 9, 2017
303b7c2
Fix markdown link for Utf8Error
smt923 Sep 10, 2017
204414b
Actually fix the trailing whitespace
smt923 Sep 10, 2017
01e9712
Remove the `cstore` reference from Session in order to prepare encaps…
michaelwoerister Sep 5, 2017
224d47d
rustc: Make `CrateStore` private to `TyCtxt`
alexcrichton Sep 7, 2017
69b9494
Alphabetize current label explanations
carols10cents Sep 10, 2017
28fc93f
Add explanations for undocumented labels
carols10cents Sep 10, 2017
f29eee9
Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
frewsxcv Sep 11, 2017
7765657
Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
frewsxcv Sep 11, 2017
dc34c64
Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
frewsxcv Sep 11, 2017
5ecaddb
Rollup merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
frewsxcv Sep 11, 2017
068b848
Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
frewsxcv Sep 11, 2017
098af1a
Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
frewsxcv Sep 11, 2017
b4e3c63
Rollup merge of #44472 - smt923:master, r=frewsxcv
frewsxcv Sep 11, 2017
92b633b
Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mar…
frewsxcv Sep 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,30 +400,53 @@ labels to triage issues:

* Magenta, **B**-prefixed labels identify bugs which are **blockers**.

* Dark blue, **beta-** labels track changes which need to be backported into
the beta branches.

* Light purple, **C**-prefixed labels represent the **category** of an issue.

* Green, **E**-prefixed labels explain the level of **experience** necessary
to fix the issue.

* The dark blue **final-comment-period** label marks bugs that are using the
RFC signoff functionality of [rfcbot][rfcbot] and are currenty in the final
comment period.

* Red, **I**-prefixed labels indicate the **importance** of the issue. The
[I-nominated][inom] label indicates that an issue has been nominated for
prioritizing at the next triage meeting.

* The purple **metabug** label marks lists of bugs collected by other
categories.

* Purple gray, **O**-prefixed labels are the **operating system** or platform
that this issue is specific to.

* Orange, **P**-prefixed labels indicate a bug's **priority**. These labels
are only assigned during triage meetings, and replace the [I-nominated][inom]
label.

* Blue, **T**-prefixed bugs denote which **team** the issue belongs to.
* The gray **proposed-final-comment-period** label marks bugs that are using
the RFC signoff functionality of [rfcbot][rfcbot] and are currently awaiting
signoff of all team members in order to enter the final comment period.

* Dark blue, **beta-** labels track changes which need to be backported into
the beta branches.
* Pink, **regression**-prefixed labels track regressions from stable to the
release channels.

* The purple **metabug** label marks lists of bugs collected by other
categories.
* The light orange **relnotes** label marks issues that should be documented in
the release notes of the next release.

* Gray, **S**-prefixed labels are used for tracking the **status** of pull
requests.

* Blue, **T**-prefixed bugs denote which **team** the issue belongs to.

If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.

[inom]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AI-nominated
[eeasy]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AE-easy
[lru]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-asc
[rfcbot]: https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md

## Out-of-tree Contributions

Expand Down
16 changes: 10 additions & 6 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ impl Step for Openssl {
drop(fs::remove_dir_all(&dst));
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));

let mut configure = Command::new(obj.join("Configure"));
let mut configure = Command::new("perl");
configure.arg(obj.join("Configure"));
configure.arg(format!("--prefix={}", dst.display()));
configure.arg("no-dso");
configure.arg("no-ssl2");
Expand Down
17 changes: 16 additions & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,22 @@ impl String {
self
}

/// Extracts a string slice containing the entire string.
/// Converts a `String` into a mutable string slice.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::ascii::AsciiExt;
///
/// let mut s = String::from("foobar");
/// let s_mut_str = s.as_mut_str();
///
/// s_mut_str.make_ascii_uppercase();
///
/// assert_eq!("FOOBAR", s_mut_str);
/// ```
#[inline]
#[stable(feature = "string_as_str", since = "1.7.0")]
pub fn as_mut_str(&mut self) -> &mut str {
Expand Down
31 changes: 31 additions & 0 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,37 @@ pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
}

/// Converts a mutable slice of bytes to a mutable string slice.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::str;
///
/// // "Hello, Rust!" as a mutable vector
/// let mut hellorust = vec![72, 101, 108, 108, 111, 44, 32, 82, 117, 115, 116, 33];
///
/// // As we know these bytes are valid, we can use `unwrap()`
/// let outstr = str::from_utf8_mut(&mut hellorust).unwrap();
///
/// assert_eq!("Hello, Rust!", outstr);
/// ```
///
/// Incorrect bytes:
///
/// ```
/// use std::str;
///
/// // Some invalid bytes in a mutable vector
/// let mut invalid = vec![128, 223];
///
/// assert!(str::from_utf8_mut(&mut invalid).is_err());
/// ```
/// See the docs for [`Utf8Error`][error] for more details on the kinds of
/// errors that can be returned.
///
/// [error]: struct.Utf8Error.html
#[stable(feature = "str_mut_extras", since = "1.20.0")]
pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
run_utf8_validation(v)?;
Expand Down
9 changes: 7 additions & 2 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use hir::map::definitions::DefPathData;
use hir::def_id::{DefIndex, DefId, CRATE_DEF_INDEX};
use hir::def::{Def, PathResolution};
use lint::builtin::PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES;
use middle::cstore::CrateStore;
use rustc_data_structures::indexed_vec::IndexVec;
use session::Session;
use util::common::FN_OUTPUT_NAME;
Expand Down Expand Up @@ -75,6 +76,8 @@ pub struct LoweringContext<'a> {
// Use to assign ids to hir nodes that do not directly correspond to an ast node
sess: &'a Session,

cstore: &'a CrateStore,

// As we walk the AST we must keep track of the current 'parent' def id (in
// the form of a DefIndex) so that if we create a new node which introduces
// a definition, then we can properly create the def id.
Expand Down Expand Up @@ -119,6 +122,7 @@ pub trait Resolver {
}

pub fn lower_crate(sess: &Session,
cstore: &CrateStore,
krate: &Crate,
resolver: &mut Resolver)
-> hir::Crate {
Expand All @@ -130,6 +134,7 @@ pub fn lower_crate(sess: &Session,
LoweringContext {
crate_root: std_inject::injected_crate_name(krate),
sess,
cstore,
parent_def: None,
resolver,
name_map: FxHashMap(),
Expand Down Expand Up @@ -535,7 +540,7 @@ impl<'a> LoweringContext<'a> {
if id.is_local() {
self.resolver.definitions().def_key(id.index)
} else {
self.sess.cstore.def_key(id)
self.cstore.def_key(id)
}
}

Expand Down Expand Up @@ -787,7 +792,7 @@ impl<'a> LoweringContext<'a> {
return n;
}
assert!(!def_id.is_local());
let n = self.sess.cstore.item_generics_cloned_untracked(def_id).regions.len();
let n = self.cstore.item_generics_cloned_untracked(def_id).regions.len();
self.type_def_lifetime_params.insert(def_id, n);
n
});
Expand Down
13 changes: 9 additions & 4 deletions src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
//! way. Therefore we break lifetime name resolution into a separate pass.

use hir::map::Map;
use session::Session;
use hir::def::Def;
use hir::def_id::DefId;
use middle::cstore::CrateStore;
use session::Session;
use ty;

use std::cell::Cell;
Expand Down Expand Up @@ -160,6 +161,7 @@ pub struct NamedRegionMap {

struct LifetimeContext<'a, 'tcx: 'a> {
sess: &'a Session,
cstore: &'a CrateStore,
hir_map: &'a Map<'tcx>,
map: &'a mut NamedRegionMap,
scope: ScopeRef<'a>,
Expand Down Expand Up @@ -251,6 +253,7 @@ type ScopeRef<'a> = &'a Scope<'a>;
const ROOT_SCOPE: ScopeRef<'static> = &Scope::Root;

pub fn krate(sess: &Session,
cstore: &CrateStore,
hir_map: &Map)
-> Result<NamedRegionMap, ErrorReported> {
let krate = hir_map.krate();
Expand All @@ -262,6 +265,7 @@ pub fn krate(sess: &Session,
sess.track_errors(|| {
let mut visitor = LifetimeContext {
sess,
cstore,
hir_map,
map: &mut map,
scope: ROOT_SCOPE,
Expand Down Expand Up @@ -765,12 +769,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
fn with<F>(&mut self, wrap_scope: Scope, f: F) where
F: for<'b> FnOnce(ScopeRef, &mut LifetimeContext<'b, 'tcx>),
{
let LifetimeContext {sess, hir_map, ref mut map, ..} = *self;
let LifetimeContext {sess, cstore, hir_map, ref mut map, ..} = *self;
let labels_in_fn = replace(&mut self.labels_in_fn, vec![]);
let xcrate_object_lifetime_defaults =
replace(&mut self.xcrate_object_lifetime_defaults, DefIdMap());
let mut this = LifetimeContext {
sess,
cstore,
hir_map,
map: *map,
scope: &wrap_scope,
Expand Down Expand Up @@ -932,7 +937,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
let def_key = if def_id.is_local() {
this.hir_map.def_key(def_id)
} else {
this.sess.cstore.def_key(def_id)
this.cstore.def_key(def_id)
};
DefId {
krate: def_id.krate,
Expand Down Expand Up @@ -976,7 +981,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
let unsubst = if let Some(id) = self.hir_map.as_local_node_id(def_id) {
&map.object_lifetime_defaults[&id]
} else {
let cstore = &self.sess.cstore;
let cstore = self.cstore;
self.xcrate_object_lifetime_defaults.entry(def_id).or_insert_with(|| {
cstore.item_generics_cloned_untracked(def_id).types.into_iter().map(|def| {
def.object_lifetime_default
Expand Down
17 changes: 6 additions & 11 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1953,13 +1953,12 @@ mod tests {
use errors;
use getopts;
use lint;
use middle::cstore::{self, DummyCrateStore};
use middle::cstore;
use session::config::{build_configuration, build_session_options_and_crate_config};
use session::build_session;
use std::collections::{BTreeMap, BTreeSet};
use std::iter::FromIterator;
use std::path::PathBuf;
use std::rc::Rc;
use super::{OutputType, OutputTypes, Externs};
use rustc_back::{PanicStrategy, RelroLevel};
use syntax::symbol::Symbol;
Expand Down Expand Up @@ -1991,7 +1990,7 @@ mod tests {
};
let registry = errors::registry::Registry::new(&[]);
let (sessopts, cfg) = build_session_options_and_crate_config(matches);
let sess = build_session(sessopts, &dep_graph, None, registry, Rc::new(DummyCrateStore));
let sess = build_session(sessopts, &dep_graph, None, registry);
let cfg = build_configuration(&sess, cfg);
assert!(cfg.contains(&(Symbol::intern("test"), None)));
}
Expand All @@ -2010,8 +2009,7 @@ mod tests {
};
let registry = errors::registry::Registry::new(&[]);
let (sessopts, cfg) = build_session_options_and_crate_config(matches);
let sess = build_session(sessopts, &dep_graph, None, registry,
Rc::new(DummyCrateStore));
let sess = build_session(sessopts, &dep_graph, None, registry);
let cfg = build_configuration(&sess, cfg);
let mut test_items = cfg.iter().filter(|&&(name, _)| name == "test");
assert!(test_items.next().is_some());
Expand All @@ -2027,8 +2025,7 @@ mod tests {
]).unwrap();
let registry = errors::registry::Registry::new(&[]);
let (sessopts, _) = build_session_options_and_crate_config(&matches);
let sess = build_session(sessopts, &dep_graph, None, registry,
Rc::new(DummyCrateStore));
let sess = build_session(sessopts, &dep_graph, None, registry);
assert!(!sess.diagnostic().can_emit_warnings);
}

Expand All @@ -2039,8 +2036,7 @@ mod tests {
]).unwrap();
let registry = errors::registry::Registry::new(&[]);
let (sessopts, _) = build_session_options_and_crate_config(&matches);
let sess = build_session(sessopts, &dep_graph, None, registry,
Rc::new(DummyCrateStore));
let sess = build_session(sessopts, &dep_graph, None, registry);
assert!(sess.diagnostic().can_emit_warnings);
}

Expand All @@ -2050,8 +2046,7 @@ mod tests {
]).unwrap();
let registry = errors::registry::Registry::new(&[]);
let (sessopts, _) = build_session_options_and_crate_config(&matches);
let sess = build_session(sessopts, &dep_graph, None, registry,
Rc::new(DummyCrateStore));
let sess = build_session(sessopts, &dep_graph, None, registry);
assert!(sess.diagnostic().can_emit_warnings);
}
}
Expand Down
Loading