From e0ac65e669e2a59a674327f7ff2590afbc2f3442 Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Sat, 7 Oct 2017 13:19:34 +0300 Subject: address more FIXME whose associated issues were marked as closed update FIXME(#6298) to point to open issue 15020 update FIXME(#6268) to point to RFC 811 update FIXME(#10520) to point to RFC 1751 remove FIXME for emscripten issue 4563 and include target in `test_estimate_scaling_factor` remove FIXME(#18207) since node_id isn't used for `ref` pattern analysis remove FIXME(#6308) since DST was implemented in #12938 remove FIXME(#2658) since it was decided to not reorganize module remove FIXME(#20590) since it was decided to stay conservative with projection types remove FIXME(#20297) since it was decided that solving the issue is unnecessary remove FIXME(#27086) since closures do correspond to structs now remove FIXME(#13846) and enable `function_sections` for windows remove mention of #22079 in FIXME(#22079) since this is a general FIXME remove FIXME(#5074) since the restriction on borrow were lifted --- src/libcore/tests/num/flt2dec/estimator.rs | 5 --- src/librustc/middle/dataflow.rs | 2 +- src/librustc/middle/mem_categorization.rs | 6 ++-- src/librustc/middle/region.rs | 4 +-- src/librustc/session/filesearch.rs | 2 -- src/librustc/traits/coherence.rs | 1 - src/librustc/traits/select.rs | 14 ++------- src/librustc/ty/outlives.rs | 36 ---------------------- src/librustc_back/target/windows_base.rs | 3 +- src/librustc_borrowck/borrowck/README.md | 5 +-- src/librustc_borrowck/borrowck/check_loans.rs | 4 +-- src/librustc_borrowck/borrowck/gather_loans/mod.rs | 5 ++- src/librustc_typeck/check/regionck.rs | 3 +- 13 files changed, 16 insertions(+), 74 deletions(-) diff --git a/src/libcore/tests/num/flt2dec/estimator.rs b/src/libcore/tests/num/flt2dec/estimator.rs index 0bca616ea9a..857aae72c8a 100644 --- a/src/libcore/tests/num/flt2dec/estimator.rs +++ b/src/libcore/tests/num/flt2dec/estimator.rs @@ -8,11 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// FIXME https://github.com/kripken/emscripten/issues/4563 -// NB we have to actually not compile this test to avoid -// an undefined symbol error -#![cfg(not(target_os = "emscripten"))] - use core::num::flt2dec::estimator::*; #[test] diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index e88678dea1d..5c86554f907 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -171,7 +171,7 @@ fn build_local_id_to_index(body: Option<&hir::Body>, -> FxHashMap> { let mut index = FxHashMap(); - // FIXME (#6298): Would it be better to fold formals from decl + // FIXME(#15020) Would it be better to fold formals from decl // into cfg itself? i.e. introduce a fn-based flow-graph in // addition to the current block-based flow-graph, rather than // have to put traversals like this here? diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index c973881c980..8754316ca84 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -477,10 +477,8 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { fn pat_ty(&self, pat: &hir::Pat) -> McResult> { let base_ty = self.node_ty(pat.hir_id)?; - // FIXME (Issue #18207): This code detects whether we are - // looking at a `ref x`, and if so, figures out what the type - // *being borrowed* is. But ideally we would put in a more - // fundamental fix to this conflated use of the node id. + // This code detects whether we are looking at a `ref x`, + // and if so, figures out what the type *being borrowed* is. let ret_ty = match pat.node { PatKind::Binding(..) => { let bm = *self.tables diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index b909ee9f93b..635bcbf7771 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -960,7 +960,7 @@ fn resolve_expr<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'a, 'tcx>, expr: hir::ExprAssignOp(..) | hir::ExprIndex(..) | hir::ExprUnary(..) | hir::ExprCall(..) | hir::ExprMethodCall(..) => { - // FIXME(#6268) Nested method calls + // FIXME(https://github.com/rust-lang/rfcs/issues/811) Nested method calls // // The lifetimes for a call or method call look as follows: // @@ -1081,8 +1081,6 @@ fn resolve_local<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'a, 'tcx>, // Here, the expression `[...]` has an extended lifetime due to rule // A, but the inner rvalues `a()` and `b()` have an extended lifetime // due to rule C. - // - // FIXME(#6308) -- Note that `[]` patterns work more smoothly post-DST. if let Some(expr) = init { record_rvalue_scope_if_borrow_expr(visitor, &expr, blk_scope); diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs index 1004b282602..b636fc6c995 100644 --- a/src/librustc/session/filesearch.rs +++ b/src/librustc/session/filesearch.rs @@ -28,8 +28,6 @@ pub enum FileMatch { } // A module for searching for libraries -// FIXME (#2658): I'm not happy how this module turned out. Should -// probably just be folded into cstore. pub struct FileSearch<'a> { pub sysroot: &'a Path, diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs index f3682f8d35d..dc5ce735324 100644 --- a/src/librustc/traits/coherence.rs +++ b/src/librustc/traits/coherence.rs @@ -252,7 +252,6 @@ fn uncovered_tys<'tcx>(tcx: TyCtxt, ty: Ty<'tcx>, infer_is_local: InferIsLocal) fn is_type_parameter(ty: Ty) -> bool { match ty.sty { - // FIXME(#20590) straighten story about projection types ty::TyProjection(..) | ty::TyParam(..) => true, _ => false, } diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 00f0672822f..cec79faff31 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -1309,13 +1309,13 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { }; if obligation.predicate.skip_binder().self_ty().is_ty_var() { - // FIXME(#20297): Self is a type variable (e.g. `_: AsRef`). + // Self is a type variable (e.g. `_: AsRef`). // // This is somewhat problematic, as the current scheme can't really // handle it turning to be a projection. This does end up as truly // ambiguous in most cases anyway. // - // Until this is fixed, take the fast path out - this also improves + // Take the fast path out - this also improves // performance by preventing assemble_candidates_from_impls from // matching every impl for this trait. return Ok(SelectionCandidateSet { vec: vec![], ambiguous: true }); @@ -1383,8 +1383,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { { debug!("assemble_candidates_for_projected_tys({:?})", obligation); - // FIXME(#20297) -- just examining the self-type is very simplistic - // before we go into the whole skolemization thing, just // quickly check if the self-type is a projection at all. match obligation.predicate.0.trait_ref.self_ty().sty { @@ -2174,14 +2172,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { } ty::TyClosure(def_id, ref substs) => { - // FIXME(#27086). We are invariant w/r/t our - // func_substs, but we don't see them as - // constituent types; this seems RIGHT but also like - // something that a normal type couldn't simulate. Is - // this just a gap with the way that PhantomData and - // OIBIT interact? That is, there is no way to say - // "make me invariant with respect to this TYPE, but - // do not act as though I can reach it" substs.upvar_tys(def_id, self.tcx()).collect() } diff --git a/src/librustc/ty/outlives.rs b/src/librustc/ty/outlives.rs index 657ed407791..5e1dc485d42 100644 --- a/src/librustc/ty/outlives.rs +++ b/src/librustc/ty/outlives.rs @@ -73,42 +73,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { // projection). match ty.sty { ty::TyClosure(def_id, ref substs) => { - // FIXME(#27086). We do not accumulate from substs, since they - // don't represent reachable data. This means that, in - // practice, some of the lifetime parameters might not - // be in scope when the body runs, so long as there is - // no reachable data with that lifetime. For better or - // worse, this is consistent with fn types, however, - // which can also encapsulate data in this fashion - // (though it's somewhat harder, and typically - // requires virtual dispatch). - // - // Note that changing this (in a naive way, at least) - // causes regressions for what appears to be perfectly - // reasonable code like this: - // - // ``` - // fn foo<'a>(p: &Data<'a>) { - // bar(|q: &mut Parser| q.read_addr()) - // } - // fn bar(p: Box) { - // } - // ``` - // - // Note that `p` (and `'a`) are not used in the - // closure at all, but to meet the requirement that - // the closure type `C: 'static` (so it can be coerced - // to the object type), we get the requirement that - // `'a: 'static` since `'a` appears in the closure - // type `C`. - // - // A smarter fix might "prune" unused `func_substs` -- - // this would avoid breaking simple examples like - // this, but would still break others (which might - // indeed be invalid, depending on your POV). Pruning - // would be a subtle process, since we have to see - // what func/type parameters are used and unused, - // taking into consideration UFCS and so forth. for upvar_ty in substs.upvar_tys(def_id, *self) { self.compute_components(upvar_ty, out); diff --git a/src/librustc_back/target/windows_base.rs b/src/librustc_back/target/windows_base.rs index e6aa745d54e..21b8c4e082e 100644 --- a/src/librustc_back/target/windows_base.rs +++ b/src/librustc_back/target/windows_base.rs @@ -64,8 +64,7 @@ pub fn opts() -> TargetOptions { ]); TargetOptions { - // FIXME(#13846) this should be enabled for windows - function_sections: false, + function_sections: true, linker: "gcc".to_string(), dynamic_linking: true, executables: true, diff --git a/src/librustc_borrowck/borrowck/README.md b/src/librustc_borrowck/borrowck/README.md index 034b7cbadd9..fb70a6c3e84 100644 --- a/src/librustc_borrowck/borrowck/README.md +++ b/src/librustc_borrowck/borrowck/README.md @@ -781,8 +781,9 @@ the base path, it will still be considered freezable. -**FIXME #10520: Restrictions against mutating the base pointer.** When -an `&mut` pointer is frozen or claimed, we currently pass along the +**FIXME(https://github.com/rust-lang/rfcs/issues/1751) +Restrictions against mutating the base pointer.** +When an `&mut` pointer is frozen or claimed, we currently pass along the restriction against MUTATE to the base pointer. I do not believe this restriction is needed. It dates from the days when we had a way to mutate that preserved the value being mutated (i.e., swap). Nowadays diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index fea662e21fa..0fc1b68b878 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -659,7 +659,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { debug!("check_if_path_is_moved(id={:?}, use_kind={:?}, lp={:?})", id, use_kind, lp); - // FIXME (22079): if you find yourself tempted to cut and paste + // FIXME: if you find yourself tempted to cut and paste // the body below and then specializing the error reporting, // consider refactoring this instead! @@ -720,7 +720,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { // the path must be initialized to prevent a case of // partial reinitialization // - // FIXME (22079): could refactor via hypothetical + // FIXME: could refactor via hypothetical // generalized check_if_path_is_moved let loan_path = owned_ptr_base_path_rc(lp_base); self.move_data.each_move_of(id, &loan_path, |_, _| { diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index a58b62ba2a7..6b52d842f8b 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -406,7 +406,7 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> { self.all_loans.push(loan); // if loan_gen_scope != borrow_id { - // FIXME(#6268) Nested method calls + // FIXME(https://github.com/rust-lang/rfcs/issues/811) Nested method calls // // Typically, the scope of the loan includes the point at // which the loan is originated. This @@ -417,9 +417,8 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> { //let restr = restrictions::compute_restrictions( // self.bccx, borrow_span, cmt, RESTR_EMPTY); //let loan = { - // let all_loans = &mut *self.all_loans; // FIXME(#5074) // Loan { - // index: all_loans.len(), + // index: self.all_loans.len(), // loan_path, // cmt, // mutbl: ConstMutability, diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 609af638e97..ad7978480a6 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -815,7 +815,8 @@ impl<'a, 'gcx, 'tcx> Visitor<'gcx> for RegionCtxt<'a, 'gcx, 'tcx> { // the type of the node expr.id here *before applying // adjustments*. // - // FIXME(#6268) nested method calls requires that this rule change + // FIXME(https://github.com/rust-lang/rfcs/issues/811) + // nested method calls requires that this rule change let ty0 = self.resolve_node_type(expr.hir_id); self.type_must_outlive(infer::AddrOf(expr.span), ty0, expr_region); intravisit::walk_expr(self, expr); -- cgit 1.4.1-3-g733a5 From 6f653bb1b15b327c1adb5018e2957631cd708d5d Mon Sep 17 00:00:00 2001 From: Pirh Date: Mon, 9 Oct 2017 19:20:07 +0100 Subject: Document defaults for stdin, stdout, and stderr methods of Command --- src/libstd/process.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index dbb58991215..1352c640fdd 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -552,6 +552,15 @@ impl Command { /// Configuration for the child process's standard input (stdin) handle. /// + /// Defaults to [`inherit`] when used with `spawn` or `status`, and + /// defaults to [`piped`] when used with `output`. + /// + /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is + /// set, no stdin is connected unless explicitly assigned. + /// + /// [`inherit`]: struct.Stdio.html#method.inherit + /// [`piped`]: struct.Stdio.html#method.piped + /// /// # Examples /// /// Basic usage: @@ -572,6 +581,15 @@ impl Command { /// Configuration for the child process's standard output (stdout) handle. /// + /// Defaults to [`inherit`] when used with `spawn` or `status`, and + /// defaults to [`piped`] when used with `output`. + /// + /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is + /// set, no stdout is connected unless explicitly assigned. + /// + /// [`inherit`]: struct.Stdio.html#method.inherit + /// [`piped`]: struct.Stdio.html#method.piped + /// /// # Examples /// /// Basic usage: @@ -592,6 +610,15 @@ impl Command { /// Configuration for the child process's standard error (stderr) handle. /// + /// Defaults to [`inherit`] when used with `spawn` or `status`, and + /// defaults to [`piped`] when used with `output`. + /// + /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is + /// set, no stderr is connected unless explicitly assigned. + /// + /// [`inherit`]: struct.Stdio.html#method.inherit + /// [`piped`]: struct.Stdio.html#method.piped + /// /// # Examples /// /// Basic usage: -- cgit 1.4.1-3-g733a5 From 210c91100fe76926647eb5d71a77dc3b527ef038 Mon Sep 17 00:00:00 2001 From: Pirh Date: Tue, 10 Oct 2017 17:58:13 +0100 Subject: Remove misleading line on Windows Subsystem stdio --- src/libstd/process.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 1352c640fdd..d110fcfee6b 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -555,9 +555,6 @@ impl Command { /// Defaults to [`inherit`] when used with `spawn` or `status`, and /// defaults to [`piped`] when used with `output`. /// - /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is - /// set, no stdin is connected unless explicitly assigned. - /// /// [`inherit`]: struct.Stdio.html#method.inherit /// [`piped`]: struct.Stdio.html#method.piped /// @@ -584,9 +581,6 @@ impl Command { /// Defaults to [`inherit`] when used with `spawn` or `status`, and /// defaults to [`piped`] when used with `output`. /// - /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is - /// set, no stdout is connected unless explicitly assigned. - /// /// [`inherit`]: struct.Stdio.html#method.inherit /// [`piped`]: struct.Stdio.html#method.piped /// @@ -613,9 +607,6 @@ impl Command { /// Defaults to [`inherit`] when used with `spawn` or `status`, and /// defaults to [`piped`] when used with `output`. /// - /// On Windows, if the `#![windows_subsystem = "windows"]` attribute is - /// set, no stderr is connected unless explicitly assigned. - /// /// [`inherit`]: struct.Stdio.html#method.inherit /// [`piped`]: struct.Stdio.html#method.piped /// -- cgit 1.4.1-3-g733a5 From b7d378a94cb5e0f01872f8ce2036357c934bf93b Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sun, 15 Oct 2017 16:59:23 +0200 Subject: Fix typo in rustdoc book --- src/doc/rustdoc/src/command-line-arguments.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index 0f0bda65ce3..bf72a489b5a 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -96,7 +96,7 @@ Using this flag looks like this: $ rustdoc src/lib.rs --crate-name mycrate ``` -By default, `rustodc` assumes that the name of your crate is the same name +By default, `rustdoc` assumes that the name of your crate is the same name as the `.rs` file. `--crate-name` lets you override this assumption with whatever name you choose. @@ -253,7 +253,7 @@ $ rustdoc README.md --html-before-content extra.html ``` This flag takes a list of files, and inserts them inside the `` tag but -before the other content `rustodc` would normally produce in the rendered +before the other content `rustdoc` would normally produce in the rendered documentation. ## `--html-after-content`: include more HTML after the content @@ -266,7 +266,7 @@ $ rustdoc README.md --html-after-content extra.html ``` This flag takes a list of files, and inserts them before the `` tag but -after the other content `rustodc` would normally produce in the rendered +after the other content `rustdoc` would normally produce in the rendered documentation. -- cgit 1.4.1-3-g733a5 From fdb3e37126b2d061b2bc1110f649bcd70723eb50 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sun, 15 Oct 2017 17:02:45 +0200 Subject: Rustdoc book: Add missing headlines Some options were missing headlines, which looked a bit inconsistent. --- src/doc/rustdoc/src/command-line-arguments.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index 0f0bda65ce3..d3462c7773a 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -100,7 +100,7 @@ By default, `rustodc` assumes that the name of your crate is the same name as the `.rs` file. `--crate-name` lets you override this assumption with whatever name you choose. -## `-L`/`--library-path`: +## `-L`/`--library-path`: where to look for dependencies Using this flag looks like this: @@ -186,7 +186,7 @@ on documentation tests](documentation-tests.html). See also `--test-args`. -## `--test-args`: +## `--test-args`: pass options to test runner Using this flag looks like this: @@ -199,7 +199,7 @@ For more, see [the chapter on documentation tests](documentation-tests.html). See also `--test`. -## `--target`: +## `--target`: generate documentation for the specified target triple Using this flag looks like this: -- cgit 1.4.1-3-g733a5 From 3bd9d62963ec81bc54fd26f5f01758596cb97378 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sun, 15 Oct 2017 19:09:25 +0200 Subject: aarch64 is not whitelisted for ARM features --- src/librustc_trans/llvm_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index 448feb5259d..d6cc3004f97 100644 --- a/src/librustc_trans/llvm_util.rs +++ b/src/librustc_trans/llvm_util.rs @@ -89,7 +89,7 @@ pub fn target_features(sess: &Session) -> Vec { let target_machine = create_target_machine(sess); let whitelist = match &*sess.target.target.arch { - "arm" => ARM_WHITELIST, + "arm" | "aarch64" => ARM_WHITELIST, "x86" | "x86_64" => X86_WHITELIST, "hexagon" => HEXAGON_WHITELIST, "powerpc" | "powerpc64" => POWERPC_WHITELIST, -- cgit 1.4.1-3-g733a5 From 696612c02f7e64b8ca5f62c4614d0cb5b20ff9b7 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Sun, 15 Oct 2017 19:02:45 -0700 Subject: don't issue "expected statement after outer attr." after inner attr. While an inner attribute here is in fact erroneous, that error ("inner attribute is not permitted in this context") successfully gets set earlier; this further admonition is nonsensical. Resolves #45296. --- src/libsyntax/parse/parser.rs | 4 ++-- src/test/ui/issue-45296.rs | 15 +++++++++++++++ src/test/ui/issue-45296.stderr | 11 +++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/test/ui/issue-45296.rs create mode 100644 src/test/ui/issue-45296.stderr diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bd400ef6dd6..8fd2bad4e44 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4088,11 +4088,11 @@ impl<'a> Parser<'a> { node: StmtKind::Item(i), }, None => { - let unused_attrs = |attrs: &[_], s: &mut Self| { + let unused_attrs = |attrs: &[Attribute], s: &mut Self| { if !attrs.is_empty() { if s.prev_token_kind == PrevTokenKind::DocComment { s.span_fatal_err(s.prev_span, Error::UselessDocComment).emit(); - } else { + } else if attrs.iter().any(|a| a.style == AttrStyle::Outer) { s.span_err(s.span, "expected statement after outer attribute"); } } diff --git a/src/test/ui/issue-45296.rs b/src/test/ui/issue-45296.rs new file mode 100644 index 00000000000..7a2b4e56d69 --- /dev/null +++ b/src/test/ui/issue-45296.rs @@ -0,0 +1,15 @@ +// Copyright 2017 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. + +fn main() { + let unused = (); + + #![allow(unused_variables)] +} diff --git a/src/test/ui/issue-45296.stderr b/src/test/ui/issue-45296.stderr new file mode 100644 index 00000000000..7bfcac974c5 --- /dev/null +++ b/src/test/ui/issue-45296.stderr @@ -0,0 +1,11 @@ +error: an inner attribute is not permitted in this context + --> $DIR/issue-45296.rs:14:7 + | +14 | #![allow(unused_variables)] + | ^ + | + = note: inner attributes and doc comments, like `#![no_std]` or `//! My crate`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes and doc comments, like `#[test]` and + `/// My function`, annotate the item following them. + +error: aborting due to previous error + -- cgit 1.4.1-3-g733a5 From 6020f3033561076f30062258b92a146b26a0e322 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 16 Oct 2017 13:33:43 +0200 Subject: introduce a whitelist for aarch64 --- src/librustc_trans/llvm_util.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index d6cc3004f97..4fe726364f2 100644 --- a/src/librustc_trans/llvm_util.rs +++ b/src/librustc_trans/llvm_util.rs @@ -73,6 +73,8 @@ unsafe fn configure_llvm(sess: &Session) { const ARM_WHITELIST: &'static [&'static str] = &["neon\0", "vfp2\0", "vfp3\0", "vfp4\0"]; +const AARCH64_WHITELIST: &'static [&'static str] = &["neon\0"]; + const X86_WHITELIST: &'static [&'static str] = &["avx\0", "avx2\0", "bmi\0", "bmi2\0", "sse\0", "sse2\0", "sse3\0", "sse4.1\0", "sse4.2\0", "ssse3\0", "tbm\0", "lzcnt\0", "popcnt\0", @@ -89,7 +91,8 @@ pub fn target_features(sess: &Session) -> Vec { let target_machine = create_target_machine(sess); let whitelist = match &*sess.target.target.arch { - "arm" | "aarch64" => ARM_WHITELIST, + "arm" => ARM_WHITELIST, + "aarch64" => AARCH64_WHITELIST, "x86" | "x86_64" => X86_WHITELIST, "hexagon" => HEXAGON_WHITELIST, "powerpc" | "powerpc64" => POWERPC_WHITELIST, -- cgit 1.4.1-3-g733a5 From 90f6bc0bc7689ae33f0b5c953f5f026ec39994cd Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 16 Oct 2017 14:25:33 +0000 Subject: turn link to RFC 1751 into a markdown link --- src/librustc_borrowck/borrowck/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_borrowck/borrowck/README.md b/src/librustc_borrowck/borrowck/README.md index fb70a6c3e84..b877c5a9cbc 100644 --- a/src/librustc_borrowck/borrowck/README.md +++ b/src/librustc_borrowck/borrowck/README.md @@ -781,7 +781,7 @@ the base path, it will still be considered freezable. -**FIXME(https://github.com/rust-lang/rfcs/issues/1751) +**FIXME [RFC 1751](https://github.com/rust-lang/rfcs/issues/1751) Restrictions against mutating the base pointer.** When an `&mut` pointer is frozen or claimed, we currently pass along the restriction against MUTATE to the base pointer. I do not believe this -- cgit 1.4.1-3-g733a5 From 978349ea434c09a3e2355b86b5e7fd6b1a1a502a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 16 Oct 2017 08:25:58 -0700 Subject: ci: Update Travis OSX builders Looks like Travis [has announced][blog] that our current `xcode8.2` image is being deprecated and the recommended Xcode 7 image is `xcode7.3`. This updates us to these ahead of time to make sure we can shake out any bugs, if any. [blog]: https://blog.travis-ci.com/2017-10-16-a-new-default-os-x-image-is-coming --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 139f06ec570..88be81be755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ matrix: NO_LLVM_ASSERTIONS=1 NO_DEBUG_ASSERTIONS=1 os: osx - osx_image: xcode7 + osx_image: xcode7.3 if: branch = auto # macOS builders. These are placed near the beginning because they are very @@ -57,7 +57,7 @@ matrix: NO_LLVM_ASSERTIONS=1 NO_DEBUG_ASSERTIONS=1 os: osx - osx_image: xcode8.2 + osx_image: xcode8.3 if: branch = auto - env: > @@ -71,7 +71,7 @@ matrix: NO_LLVM_ASSERTIONS=1 NO_DEBUG_ASSERTIONS=1 os: osx - osx_image: xcode8.2 + osx_image: xcode8.3 if: branch = auto # OSX builders producing releases. These do not run the full test suite and @@ -91,7 +91,7 @@ matrix: NO_LLVM_ASSERTIONS=1 NO_DEBUG_ASSERTIONS=1 os: osx - osx_image: xcode7 + osx_image: xcode7.3 if: branch = auto - env: > @@ -105,7 +105,7 @@ matrix: NO_LLVM_ASSERTIONS=1 NO_DEBUG_ASSERTIONS=1 os: osx - osx_image: xcode7 + osx_image: xcode7.3 if: branch = auto # Linux builders, remaining docker images -- cgit 1.4.1-3-g733a5 From 094c2ae16ce6f78b99d0e69c1084a2c14f0ad59f Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 16 Oct 2017 22:53:25 +0300 Subject: revert change to function_sections for windows --- src/librustc_back/target/windows_base.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_back/target/windows_base.rs b/src/librustc_back/target/windows_base.rs index 21b8c4e082e..e6aa745d54e 100644 --- a/src/librustc_back/target/windows_base.rs +++ b/src/librustc_back/target/windows_base.rs @@ -64,7 +64,8 @@ pub fn opts() -> TargetOptions { ]); TargetOptions { - function_sections: true, + // FIXME(#13846) this should be enabled for windows + function_sections: false, linker: "gcc".to_string(), dynamic_linking: true, executables: true, -- cgit 1.4.1-3-g733a5 From cefaaf21ee2dad6e615c5b2905d2bf9750547ce8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 17 Oct 2017 00:19:25 +0200 Subject: Remove duplicated word --- src/libstd/sys/windows/ext/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/sys/windows/ext/fs.rs b/src/libstd/sys/windows/ext/fs.rs index d58a3505154..a532163f61e 100644 --- a/src/libstd/sys/windows/ext/fs.rs +++ b/src/libstd/sys/windows/ext/fs.rs @@ -393,8 +393,8 @@ pub trait MetadataExt { /// to. For a directory, the structure specifies when the directory was /// created. /// - /// If the underlying filesystem does not support the last write time - /// time, the returned value is 0. + /// If the underlying filesystem does not support the last write time, + /// the returned value is 0. /// /// # Examples /// -- cgit 1.4.1-3-g733a5 From cbe41168e07852d976e6aa334de7b2ef0eab6c95 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Tue, 17 Oct 2017 15:01:49 +0900 Subject: bootstrap: Avoid fetching jemalloc if it's disabled Fix #45300 --- src/bootstrap/bootstrap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 842144ff1ea..c441dc9acb8 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -648,7 +648,8 @@ class RustBuild(object): if not ((module.endswith("llvm") and self.get_toml('llvm-config')) or (module.endswith("jemalloc") and - self.get_toml('jemalloc')))] + (self.get_toml('use-jemalloc') == "false" or + self.get_toml('jemalloc'))))] run(["git", "submodule", "update", "--init", "--recursive"] + submodules, cwd=self.rust_root, verbose=self.verbose) -- cgit 1.4.1-3-g733a5 From 8528508aa0850fa8286fb73503fb93263edaa976 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Tue, 17 Oct 2017 08:29:29 +0200 Subject: Update array documentation for Clone trait changes --- src/libstd/primitive_docs.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 1edb35d8fe7..9e1da318242 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -284,7 +284,6 @@ mod prim_pointer { } /// Arrays of sizes from 0 to 32 (inclusive) implement the following traits if /// the element type allows it: /// -/// - [`Clone`][clone] (only if `T: `[`Copy`][copy]) /// - [`Debug`][debug] /// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`) /// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord] @@ -299,8 +298,10 @@ mod prim_pointer { } /// entirely different types. As a stopgap, trait implementations are /// statically generated up to size 32. /// -/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]. This -/// works because the [`Copy`][copy] trait is specially known to the compiler. +/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy] +/// and [`Clone`][clone] if the element type is [`Clone`][clone]. This works +/// because [`Copy`][copy] and [`Clone`][clone] traits are specially known +/// to the compiler. /// /// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on /// an array. Indeed, this provides most of the API for working with arrays. -- cgit 1.4.1-3-g733a5